> ## 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.

# Retrieve Tickets that belong to the current Company

> Retrieve `Tickets` for a `Company`

Filter usage:
* to filter a from date: `filter[from_date]`
* to filter a to date: `filter[to_date]`



## OpenAPI

````yaml /api-reference/openapi.json get /v1/tickets
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/tickets:
    parameters:
      - $ref: '#/components/parameters/Accept-Language'
    get:
      tags:
        - Tickets
      summary: Retrieve Tickets that belong to the current Company
      description: |-
        Retrieve `Tickets` for a `Company`

        Filter usage:
        * to filter a from date: `filter[from_date]`
        * to filter a to date: `filter[to_date]`
      operationId: get-v1-tickets
      parameters:
        - $ref: '#/components/parameters/page-limit'
        - $ref: '#/components/parameters/page-after'
        - $ref: '#/components/parameters/page-before'
        - schema:
            type: string
          in: query
          name: filter[from_date]
          description: Start range of ticket.created_at
        - schema:
            type: string
          in: query
          name: filter[to_date]
          description: End range of ticket.created_at
        - schema:
            type: boolean
          in: query
          name: filter[flagged]
          description: Filter to only flagged or un-flagged Tickets
      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
                    x-stoplight:
                      id: tria7go8pqqi9
                    items:
                      $ref: '#/components/schemas/Ticket-Read'
        '401':
          $ref: '#/components/responses/UnauthenticatedError'
        '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. 
    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
    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
  schemas:
    Ticket-Read:
      title: Ticket-Read
      x-stoplight:
        id: jb9fdewaxmw1t
      allOf:
        - $ref: '#/components/schemas/Ticket-Read-Nested'
        - $ref: '#/components/schemas/Timestamps'
        - type: object
          required:
            - quantity
            - unit_of_measure
            - job_id
            - order_id
            - image_url
            - image_mime_type
            - preview_mime_type
            - ocr_ticket_number
            - ocr_net_quantity_ton
            - ocr_processed
            - load_id
            - source
            - state
            - flagged
            - missing_info
            - printed_at
            - ocr_ticket_number_confidence
            - ocr_net_quantity_ton_confidence
            - ocr_service_date
            - ocr_service_date_raw_str
            - ai_processed
          properties:
            quantity:
              type: string
              x-stoplight:
                id: hc9oz0vfm68u0
              nullable: true
            unit_of_measure:
              $ref: '#/components/schemas/OrderUnitOfMeasure'
            job_id:
              type: string
              x-stoplight:
                id: 037deqk7slvf4
              format: uuid
              nullable: true
            order_id:
              type: string
              x-stoplight:
                id: 111deqk7slvf4
              format: uuid
              nullable: true
            material:
              $ref: '#/components/schemas/Material-Read-Nested'
            image_url:
              type: string
              x-stoplight:
                id: zls4nx0al0t9h
              format: uri
              nullable: true
            image_mime_type:
              type: string
              x-stoplight:
                id: ozhkitwvj5b7q
              description: This will be the type of attachment.
              nullable: true
            preview_mime_type:
              type: string
              x-stoplight:
                id: abckitwvj5b7z
              description: This will be the type of attachment.
              nullable: true
            ocr_ticket_number:
              type: string
              x-stoplight:
                id: 6cc7czi0fiykn
              nullable: true
            ocr_net_quantity_ton:
              type: string
              x-stoplight:
                id: ohhdzp74uxp1t
              nullable: true
            ocr_processed:
              type: boolean
              x-stoplight:
                id: ny2zxmboh8uty
            load_id:
              type: string
              x-stoplight:
                id: bstva0m37b0dk
              format: uuid
              nullable: true
            source:
              $ref: '#/components/schemas/TicketSource'
            state:
              $ref: '#/components/schemas/TicketState'
            state_events:
              type: array
              x-stoplight:
                id: tvnn7axceeubc
              items:
                $ref: '#/components/schemas/TicketStateEvent'
            flagged:
              type: boolean
              x-stoplight:
                id: oujkhiehefkc3
              readOnly: true
            service_date:
              type: string
              x-stoplight:
                id: s46b12vbuanfd
              format: date-time
              nullable: true
            friendly_job_id:
              type: string
              x-stoplight:
                id: ob6wwko7nk9l3
              nullable: true
            customer_name:
              type: string
              x-stoplight:
                id: yt5ohhg087jw2
              nullable: true
            project_name:
              type: string
              x-stoplight:
                id: lctkgf7pnyiby
              nullable: true
            dispatch_number_name:
              type: string
              x-stoplight:
                id: q1r2s3t4u5v6w
              nullable: true
              description: Dispatch number name from the order
            equipment_name:
              type: string
              x-stoplight:
                id: jx5lmwhemf2g8
              nullable: true
            driver_name:
              type: string
              x-stoplight:
                id: 8iplagfsmzgbw
              nullable: true
            vendor_name:
              type: string
              x-stoplight:
                id: 5tsnul2i0tfr5
              nullable: true
            material_name:
              type: string
              x-stoplight:
                id: fq50fysabdxve
              nullable: true
            pickup_site_name:
              type: string
              x-stoplight:
                id: jay8jobgw4zy8
              nullable: true
            dropoff_site_name:
              type: string
              x-stoplight:
                id: rudn8s9j3ocyr
              nullable: true
            missing_info:
              type: boolean
              x-stoplight:
                id: 4rjs6i5z14ik5
              description: |
                A `Ticket` is missing info when any of the following are true:
                1. is has no `job_id`.
                2. it has no `quantity`
                3. it has no `ticket_number`
                4. it has no `image`
            printed_at:
              type: string
              x-stoplight:
                id: 5f95ni9l51rtg
              format: date-time
              description: >-
                This is the time when the ticket was printed. This is different
                from created_at
              nullable: true
            ocr_ticket_number_confidence:
              type: string
              x-stoplight:
                id: 82rfndbofuoxv
              example: '"1.0", "90.5", null'
              description: Percentage confidence score
              nullable: true
            ocr_net_quantity_ton_confidence:
              type: string
              x-stoplight:
                id: 56f10gbenjxk3
              example: '"1.0", "90.5", null'
              description: Percentage confidence score
              nullable: true
            ocr_service_date:
              type: string
              x-stoplight:
                id: gzgvplenry5ue
              format: date-time
              nullable: true
            ocr_service_date_raw_str:
              type: string
              x-stoplight:
                id: his0q7sb4sw3t
              nullable: true
            ai_processed:
              type: boolean
              x-stoplight:
                id: kpmmww5xayiou
            external_truck_id:
              type: string
              x-stoplight:
                id: l6g3zmooi9sd6
              nullable: true
            external_vendor_name:
              type: string
              x-stoplight:
                id: zapwl7aisd0u7
              nullable: true
            external_material_material_name:
              type: string
              x-stoplight:
                id: zwl5ubv4mhsbl
              nullable: true
            external_net_weight:
              type: string
              x-stoplight:
                id: ge7l0pjxzwqon
              nullable: true
            external_net_weight_unit:
              type: string
              x-stoplight:
                id: 4u5hcn505wkfr
              nullable: true
            external_ticket_number:
              type: string
              x-stoplight:
                id: 6xg5q9dj0bukx
              nullable: true
    Ticket-Read-Nested:
      title: Ticket-Read-Nested
      x-stoplight:
        id: sxhhxkcgkj6ep
      allOf:
        - $ref: '#/components/schemas/Identifier'
        - type: object
          x-stoplight:
            id: u7esfoogq8q49
          required:
            - ticket_number
            - preview_url
          properties:
            ticket_number:
              type: string
              x-stoplight:
                id: kzx5yw8vvwbra
              nullable: true
            preview_url:
              type: string
              x-stoplight:
                id: h1do11irp24bw
              format: uri
              nullable: true
    Timestamps:
      title: Timestamps
      x-stoplight:
        id: t82ecgfu0oj00
      type: object
      required:
        - created_at
        - updated_at
      properties:
        created_at:
          type: string
          x-stoplight:
            id: gjj950jpq0ga9
          format: date-time
          description: ISO8601 timestamp with local timezone
        updated_at:
          type: string
          x-stoplight:
            id: bwcuyfwc7aj0e
          format: date-time
          description: ISO8601 timestamp with local timezone
      additionalProperties: false
    OrderUnitOfMeasure:
      title: OrderUnitOfMeasure
      x-stoplight:
        id: kahcgn7w8swdv
      enum:
        - Load
        - Tonne
        - Ton
        - Yard
        - Meter
        - Foot
        - Liter
        - Hour
        - Bushel
        - Gallon
        - CubicMeter
        - Mile
        - Kilometer
        - Barrel
        - Bag
        - Pallet
      example: Load
    Material-Read-Nested:
      title: Material-Read-Nested
      x-stoplight:
        id: 5hvekq1lnr9ku
      type: object
      required:
        - id
        - name
        - external_id
      properties:
        id:
          type: string
          x-stoplight:
            id: c6nool5iljv3l
          format: uuid
        name:
          type: string
          x-stoplight:
            id: bsd3m2c74jis8
        external_id:
          type: string
          description: Material external_id
          x-stoplight:
            id: ab0l0yvuz5u6d
          nullable: true
      additionalProperties: false
    TicketSource:
      title: TicketSource
      x-stoplight:
        id: z52hto616mgx1
      enum:
        - driver_app
        - web
        - api_integration
        - agent
      example: driver_app
      default: driver_app
      readOnly: true
    TicketState:
      title: TicketState
      x-stoplight:
        id: q01ztz4xuvcc5
      enum:
        - new
        - pending
        - approved
        - voided
      readOnly: true
    TicketStateEvent:
      title: TicketStateEvent
      x-stoplight:
        id: 1b2ulz2srbdfc
      enum:
        - approve
        - void
    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
    Identifier:
      title: Identifier
      x-stoplight:
        id: gnd39lue5v7ol
      type: object
      required:
        - id
      properties:
        id:
          type: string
          x-stoplight:
            id: 2e38hjk4zd58m
          format: uuid
      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

````