> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tread.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Search Dispatch Numbers based on the current Dispatch results

> Searches `DispatchNumbers` in a typeahead style but instead of all `DispatchNumbers` for a `Company` this returns all `DispatchNumbers` that are associated to the dispatch list, where the dispatch list is defined by the `filter` and `search` inputs that belong to a `Company`.



## OpenAPI

````yaml /api-reference/openapi.json get /v1/companies/{company-id}/orders/dispatch_numbers/faceted_search
openapi: 3.0.3
info:
  title: Horizon API V1
  version: '1.0'
  contact:
    name: Tread
    url: https://tread.io
    email: developers@tread.io
  description: >-
    This is the Version 1 implementation.


    When in doubt we default to the practices outlined
    [here](https://www.vinaysahni.com/best-practices-for-a-pragmatic-restful-api#advanced-queries)
  license:
    name: Private
    url: https://tread.io
servers:
  - description: production
    url: https://api.tread-horizon.com
security:
  - bearerAuth: []
tags:
  - name: Projects
  - name: Orders
  - name: Loads
  - name: Jobs
  - name: JobAssignments
  - name: ApprovalAssignments
  - name: Equipment
  - name: FuelSurcharges
  - name: Materials
  - name: Accounts
  - name: Tickets
  - name: Users
  - name: Sites
  - name: Companies
  - name: Departments
  - name: Rates
  - name: Services
  - name: EquipmentType
  - name: FileAttachments
  - name: MaterialType
  - name: LineItemType
  - name: DriverStateEvent
  - name: Authentication
  - name: IamRoles
  - name: Typeaheads
  - name: Integrations
  - name: Reflection
  - name: LoadCycles
  - name: AddOns
  - name: ServiceClass
  - name: Invoices
  - name: JobSummaries
  - name: LoadSummaries
  - name: CompanyShares
  - name: UserDevicePermission
  - name: Drivers
  - name: Settlements
  - name: LocationHistories
  - name: Telematics
  - name: OmniReports
  - name: DriverDays
  - name: Agave
  - name: AddOnCharges
  - name: ResourceUsageLogs
  - name: ResourceScopes
  - name: TravelledDistances
  - name: MaterialRates
  - name: CompanyDayJobStats
  - name: KMLFiles
  - name: AutoAddOnAssignments
  - name: SiteRateSchedules
  - name: TwilioIntegrations
  - name: Foremen
  - name: AccountExternalTruckIdentifier
  - name: GeofenceTriggers
  - name: Labels
  - name: Compliance
  - name: ComplianceDocuments
paths:
  /v1/companies/{company-id}/orders/dispatch_numbers/faceted_search:
    parameters:
      - schema:
          type: string
          format: uuid
        name: company-id
        in: path
        required: true
        description: Company ID
      - $ref: '#/components/parameters/Accept-Language'
    get:
      tags:
        - Orders
        - Typeaheads
      summary: Search Dispatch Numbers based on the current Dispatch results
      description: >-
        Searches `DispatchNumbers` in a typeahead style but instead of all
        `DispatchNumbers` for a `Company` this returns all `DispatchNumbers`
        that are associated to the dispatch list, where the dispatch list is
        defined by the `filter` and `search` inputs that belong to a `Company`.
      operationId: get-v1-companies-company-id-orders-dispatch_numbers-faceted_search
      parameters:
        - $ref: '#/components/parameters/filter-job-company_ids'
        - $ref: '#/components/parameters/filter-job-customer_account_ids'
        - $ref: '#/components/parameters/filter-dispatch_number_ids'
        - $ref: '#/components/parameters/filter-job-driver_ids'
        - $ref: '#/components/parameters/filter-job-dropoff_site_ids'
        - $ref: '#/components/parameters/filter-job-end_date'
        - $ref: '#/components/parameters/filter-job-equipment_ids'
        - $ref: '#/components/parameters/filter-job-external_ids'
        - $ref: '#/components/parameters/filter-job-material_ids'
        - $ref: '#/components/parameters/filter-job-pickup_site_ids'
        - $ref: '#/components/parameters/filter-job-project_ids'
        - $ref: '#/components/parameters/filter-job-service_ids'
        - $ref: '#/components/parameters/filter-job-site_types'
        - $ref: '#/components/parameters/filter-job-start_date'
        - $ref: '#/components/parameters/filter-job-states'
        - $ref: '#/components/parameters/filter-job-vendor_account_ids'
        - $ref: '#/components/parameters/page-after'
        - $ref: '#/components/parameters/page-before'
        - $ref: '#/components/parameters/page-limit'
        - $ref: '#/components/parameters/facet-search-query'
      responses:
        '200':
          description: OK
          headers:
            Link:
              schema:
                type: string
              description: Contains prev and next links for pagination
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/DispatchNumber-Read-Typeahead'
        '401':
          $ref: '#/components/responses/UnauthenticatedError'
        '404':
          $ref: '#/components/responses/Error'
        '406':
          $ref: '#/components/responses/Error'
        '422':
          $ref: '#/components/responses/ModelError'
components:
  parameters:
    Accept-Language:
      name: Accept-Language
      in: header
      schema:
        type: string
        default: en
        example: en
      description: >-
        The Accept-Language request HTTP header indicates the natural language
        and locale that the client prefers. 
    filter-job-company_ids:
      name: filter[job][company_ids]
      in: query
      required: false
      schema:
        type: array
      description: The associated Company IDs for the Job
    filter-job-customer_account_ids:
      name: filter[job][customer_account_ids]
      in: query
      required: false
      schema:
        type: array
      description: The associated Customer Account IDs for the Job
    filter-dispatch_number_ids:
      name: filter[dispatch_number_ids]
      in: query
      required: false
      schema:
        type: array
      description: The associated DispatchNumber IDs
    filter-job-driver_ids:
      name: filter[job][driver_ids]
      in: query
      required: false
      schema:
        type: array
      description: The assigned Driver IDs for the Job
    filter-job-dropoff_site_ids:
      name: filter[job][dropoff_site_ids]
      in: query
      required: false
      schema:
        type: array
      description: The associated Dropoff Site IDs for the Job
    filter-job-end_date:
      name: filter[job][end_date]
      in: query
      required: false
      schema:
        type: string
      description: End date range for Job.job_start_at
    filter-job-equipment_ids:
      name: filter[job][equipment_ids]
      in: query
      required: false
      schema:
        type: array
      description: The associated Equipment IDs for the Job
    filter-job-external_ids:
      name: filter[job][external_ids]
      in: query
      required: false
      schema:
        type: array
      description: The associated External Project IDs for the Job
    filter-job-material_ids:
      name: filter[job][material_ids]
      in: query
      required: false
      schema:
        type: array
      description: The associated Material IDs for the Job
    filter-job-pickup_site_ids:
      name: filter[job][pickup_site_ids]
      in: query
      required: false
      schema:
        type: array
      description: The associated Pickup Site IDs for the Job
    filter-job-project_ids:
      name: filter[job][project_ids]
      in: query
      required: false
      schema:
        type: array
      description: The associated Project IDs for the Job
    filter-job-service_ids:
      name: filter[job][service_ids]
      in: query
      required: false
      schema:
        type: array
      description: The associated Service IDs for the Job
    filter-job-site_types:
      name: filter[job][site_types]
      in: query
      required: false
      schema:
        type: array
      description: >-
        SiteType enum filters for the Job (see SiteType enum for the list of
        values)
    filter-job-start_date:
      name: filter[job][start_date]
      in: query
      required: false
      schema:
        type: string
      description: Start date range for Job.job_start_at
    filter-job-states:
      name: filter[job][states]
      in: query
      required: false
      schema:
        type: array
      description: Job states
    filter-job-vendor_account_ids:
      name: filter[job][vendor_account_ids]
      in: query
      required: false
      schema:
        type: array
      description: The associated Vendor Account IDs for the Job
    page-after:
      name: page[after]
      in: query
      required: false
      schema:
        type: string
      description: The cursor to start paginating after
    page-before:
      name: page[before]
      in: query
      required: false
      schema:
        type: string
      description: The cursor to stop paginating at
    page-limit:
      name: page[limit]
      in: query
      schema:
        type: integer
        format: int32
        default: 25
        maximum: 100
      description: The maximum number of paginated results to return
    facet-search-query:
      name: facet[search][query]
      in: query
      required: false
      schema:
        type: string
      description: The typeahead search query. Matches on the models's `name` field
  schemas:
    DispatchNumber-Read-Typeahead:
      title: DispatchNumber-Read-Typeahead
      x-stoplight:
        id: qcetdkxho2g9s
      allOf:
        - $ref: '#/components/schemas/Identifier'
        - type: object
          required:
            - name
          properties:
            name:
              type: string
              x-stoplight:
                id: hjd7j5qltq7i0
    Identifier:
      title: Identifier
      x-stoplight:
        id: gnd39lue5v7ol
      type: object
      required:
        - id
      properties:
        id:
          type: string
          x-stoplight:
            id: 2e38hjk4zd58m
          format: uuid
      additionalProperties: false
    UnauthenticatedError-Response:
      title: UnauthenticatedError-Response
      x-stoplight:
        id: o477eph7ttbzt
      type: object
      required:
        - error
      properties:
        error:
          $ref: '#/components/schemas/UnauthenticatedError'
      additionalProperties: false
    Error-Response:
      title: Error-Response
      x-stoplight:
        id: 52cydhphee3qe
      type: object
      required:
        - error
      properties:
        error:
          $ref: '#/components/schemas/Error'
      additionalProperties: false
    ModelError-Response:
      title: ModelError-Response
      x-stoplight:
        id: payf9ndh3l6np
      type: object
      required:
        - error
      properties:
        error:
          $ref: '#/components/schemas/ModelError'
      additionalProperties: false
    UnauthenticatedError:
      title: UnauthenticatedError
      x-stoplight:
        id: 202o69l0fs40h
      allOf:
        - $ref: '#/components/schemas/Error'
        - type: object
          x-stoplight:
            id: tg10dt7s0l6bw
          properties:
            error_type:
              type: string
              x-stoplight:
                id: wvq8c0qsym4hz
          required:
            - error_type
    Error:
      title: Error
      x-stoplight:
        id: 3g57kkik3l464
      type: object
      description: An Error.
      required:
        - code
      properties:
        code:
          type: string
          x-stoplight:
            id: 7o9x1t8v0bgfo
      additionalProperties: false
    ModelError:
      title: ModelError
      x-stoplight:
        id: nhp6714o4j1qt
      description: A Model-specific error
      allOf:
        - $ref: '#/components/schemas/Error'
        - type: object
          required:
            - errors
          properties:
            errors:
              type: array
              x-stoplight:
                id: m4ul9vcq2deh6
              items:
                $ref: '#/components/schemas/ModelError-Item'
    ModelError-Item:
      title: ModelError-Item
      x-stoplight:
        id: b93chwval2t8d
      type: object
      required:
        - model
        - field
        - message
      properties:
        model:
          type: string
          x-stoplight:
            id: 30myfyjkno8ao
          description: The Model associated with this Error
        field:
          type: string
          x-stoplight:
            id: 8gl4ed3uxhdws
          description: The field associated with this Error
        message:
          type: string
          x-stoplight:
            id: bmgbrtmw17qsj
          description: The Error message
      additionalProperties: false
  responses:
    UnauthenticatedError:
      description: Example response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UnauthenticatedError-Response'
            type: object
    Error:
      description: Error response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error-Response'
            type: object
    ModelError:
      description: ''
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ModelError-Response'
            type: object
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````