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

# Approve a Settlement as a Company

> Approve a `Settlement` by ID as a `Company`



## OpenAPI

````yaml /api-reference/openapi.json put /v1/companies/{company-id}/settlements/{settlement-id}/approve
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}/settlements/{settlement-id}/approve:
    parameters:
      - schema:
          type: string
        name: settlement-id
        in: path
        required: true
        description: Settlement ID
      - schema:
          type: string
          format: uuid
        name: company-id
        in: path
        required: true
        description: Company ID
      - $ref: '#/components/parameters/Accept-Language'
    put:
      tags:
        - Settlements
      summary: Approve a Settlement as a Company
      description: Approve a `Settlement` by ID as a `Company`
      operationId: put-v1-companies-company-id-settlements-settlement-id-approve
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties: {}
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: '#/components/schemas/Settlement-Read'
        '400':
          $ref: '#/components/responses/Error'
        '401':
          $ref: '#/components/responses/UnauthenticatedError'
        '403':
          $ref: '#/components/responses/Error'
        '404':
          $ref: '#/components/responses/Error'
        '406':
          $ref: '#/components/responses/Error'
        '409':
          $ref: '#/components/responses/StateError'
        '415':
          $ref: '#/components/responses/Error'
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. 
  schemas:
    Settlement-Read:
      title: Settlement-Read
      x-stoplight:
        id: v7tgu5dpw0yx6
      allOf:
        - $ref: '#/components/schemas/Identifier'
        - $ref: '#/components/schemas/Timestamps'
        - type: object
          required:
            - adjustments_total_amount
            - data
            - exported_at
            - include_loads_in_pdf
            - jobs_count
            - state
            - total_amount
            - settlement_id
            - ar_settlement_id
            - ap_settlement_id
            - settlement_line_item_type
            - settlement_line_item_groupings
            - add_on_charges_total_amount
            - invoices_total_amount
            - state_events
            - editable
            - void_reason
            - rebillable
            - rebill_total_amount
            - rebill_add_on_charges_total_amount
            - rebill_invoices_total_amount
            - voided_at
            - approved
            - approvable
            - unapprovable
            - billing_approved_at
            - delivered_quantities
            - invoices_tax_total_amount
            - rebill_invoices_tax_total_amount
          properties:
            adjustments_total_amount:
              type: string
              x-stoplight:
                id: ewne9idc4jme5
            data:
              $ref: '#/components/schemas/Settlement-Data'
            exported_at:
              type: string
              x-stoplight:
                id: 96czpadmujxyh
              format: date-time
              nullable: true
            jobs_count:
              type: integer
              x-stoplight:
                id: 1eyszir4rj04s
            state:
              $ref: '#/components/schemas/SettlementState'
            total_amount:
              type: string
              x-stoplight:
                id: 5gkc63khvm43b
            customer_account:
              $ref: '#/components/schemas/Account-Read-Nested'
            vendor_account:
              $ref: '#/components/schemas/Account-Read-Nested'
            driver:
              $ref: '#/components/schemas/Driver-Read-Nested'
            settlement_id:
              type: string
              x-stoplight:
                id: o6sa87h84mg4b
            ar_settlement_id:
              type: string
              x-stoplight:
                id: k8m2n5p7q3r1s
              description: Accounts Receivable settlement identifier (e.g., AR-123)
            ap_settlement_id:
              type: string
              x-stoplight:
                id: t4u6v8w0x2y4z
              description: Accounts Payable settlement identifier (e.g., AP-123)
            settlement_line_item_type:
              $ref: '#/components/schemas/SettlementLineItemType'
            settlement_line_item_groupings:
              type: array
              x-stoplight:
                id: 5a0weyv4qlxnk
              items:
                $ref: '#/components/schemas/SettlementLineItemGrouping'
            add_on_charges_total_amount:
              type: string
              x-stoplight:
                id: lb7d33qab3qj1
              description: >-
                This is the sum of all the `Settlement`'s `AddOnCharges`'
                `total_amount`
            invoices_total_amount:
              type: string
              x-stoplight:
                id: 0hb1d9olmgqgd
              description: >-
                This is the sum of all the `Invoices`'s `total_amount` that this
                `Settlement` aggregates.
            state_events:
              type: array
              x-stoplight:
                id: v364iig0ejiow
              items:
                $ref: '#/components/schemas/SettlementStateEvent'
            editable:
              type: boolean
              x-stoplight:
                id: nohmp55lokifo
            last_settlement_email_delivery:
              $ref: '#/components/schemas/SettlementEmailDelivery-Read'
            void_reason:
              type: string
              x-stoplight:
                id: f5yrr6bc18x2c
              nullable: true
            rebillable:
              type: boolean
              x-stoplight:
                id: wzj7dvmwvvfip
            original_settlement:
              $ref: '#/components/schemas/Settlement-Read-Nested'
            rebill_total_amount:
              type: string
              x-stoplight:
                id: 33hwveuov29mz
              nullable: true
            rebill_add_on_charges_total_amount:
              type: string
              x-stoplight:
                id: 3jxungxzuzdpo
              nullable: true
            rebill_invoices_total_amount:
              type: string
              x-stoplight:
                id: j22k4f0fr1oiq
              nullable: true
            voided_at:
              type: string
              x-stoplight:
                id: qnq1ub9i4nwl5
              format: date-time
              nullable: true
            approved:
              type: boolean
              x-stoplight:
                id: bhcdc0mszq249
            approvable:
              type: boolean
              x-stoplight:
                id: 6iq2bu84k7ztn
            unapprovable:
              type: boolean
              x-stoplight:
                id: 93uxkqtkkm3rj
            billing_approved_at:
              type: string
              x-stoplight:
                id: moxy969odp41e
              format: date-time
              nullable: true
            delivered_quantities:
              type: array
              x-stoplight:
                id: l6cuz25bmm9z4
              items:
                $ref: '#/components/schemas/DeliveredQuantity-Read'
            include_loads_in_pdf:
              type: boolean
              description: Controls whether load details are included in settlement PDFs
            agave_settlement_export:
              $ref: '#/components/schemas/AgaveSettlementExport-Read-Nested'
            invoices_tax_total_amount:
              type: string
              nullable: true
              description: Sum of tax_total_amount from all invoices in this settlement
            rebill_invoices_tax_total_amount:
              type: string
              nullable: true
              description: Sum of tax_total_amount from all invoices for rebill settlements
      x-internal: true
    Identifier:
      title: Identifier
      x-stoplight:
        id: gnd39lue5v7ol
      type: object
      required:
        - id
      properties:
        id:
          type: string
          x-stoplight:
            id: 2e38hjk4zd58m
          format: uuid
      additionalProperties: false
    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
    Settlement-Data:
      title: Settlement-Data
      x-stoplight:
        id: ev9ysl8wkgqou
      type: object
      properties:
        friendly_order_ids:
          type: array
          x-stoplight:
            id: bhu3ljgdpexd4
          items:
            x-stoplight:
              id: dw71zmxlco4dl
            type: string
        quantities_per_uom:
          type: array
          x-stoplight:
            id: o6clrualzppm4
          items:
            x-stoplight:
              id: m7rll6vs1wws3
            type: string
      x-internal: true
      additionalProperties: false
    SettlementState:
      title: SettlementState
      x-stoplight:
        id: fszy9g5471ubx
      enum:
        - pending
        - approved
        - paid
        - customer_pending
        - customer_approved
        - customer_paid
        - voided
      example: pending
      default: pending
    Account-Read-Nested:
      title: Account-Read-Nested
      x-stoplight:
        id: zo8r3gsz1tm5h
      allOf:
        - $ref: '#/components/schemas/Identifier'
        - $ref: '#/components/schemas/Discardable'
        - type: object
          x-stoplight:
            id: gl7hua7pv8xka
          required:
            - name
            - account_types
            - external_id
            - accounting_id
            - company
            - schedule_on
          properties:
            name:
              type: string
              x-stoplight:
                id: a7g065w5byfcf
            account_types:
              type: array
              x-stoplight:
                id: a0e9c3lpr1wad
              items:
                $ref: '#/components/schemas/AccountType'
            external_id:
              type: string
              x-stoplight:
                id: yfrec4y0a90cb
              nullable: true
            accounting_id:
              type: string
              x-stoplight:
                id: yfsec5y0a91cb
              nullable: true
            company:
              type: object
              x-stoplight:
                id: 9loqtu14mvlnq
              required:
                - id
              properties:
                id:
                  type: string
                  x-stoplight:
                    id: udjkdjrz08pzr
                  format: uuid
            billing_address:
              $ref: '#/components/schemas/Address-Read-Nested'
            schedule_on:
              type: boolean
              x-stoplight:
                id: 0g9kx77zym4ok
            connected_company:
              $ref: '#/components/schemas/Company-Read-Nested'
            billing_contact:
              $ref: '#/components/schemas/Contact-Read-Nested'
    Driver-Read-Nested:
      title: Driver-Read-Nested
      x-stoplight:
        id: lcevfprple1sa
      allOf:
        - $ref: '#/components/schemas/Driver-Read-Typeahead'
        - type: object
          x-stoplight:
            id: 19sn21xqtmd0w
          required:
            - email
          properties:
            email:
              type: string
              x-stoplight:
                id: ekvo9chmdhjkp
              nullable: true
    SettlementLineItemType:
      title: SettlementLineItemType
      x-stoplight:
        id: kr3n8ngq9cl8d
      enum:
        - order
        - job
        - load
      example: order
      default: load
    SettlementLineItemGrouping:
      title: SettlementLineItemGrouping
      x-stoplight:
        id: 5pcss2yqvsbrb
      enum:
        - material
        - equipment_type
        - service
      example: material
    SettlementStateEvent:
      title: SettlementStateEvent
      x-stoplight:
        id: 1a9ulz2srbdfc
      enum:
        - approve
        - customer_pay
        - pay
        - send_settlement
        - unapprove
        - undo_pay
        - void
    SettlementEmailDelivery-Read:
      title: SettlementEmailDelivery-Read
      x-stoplight:
        id: pdqy2qteoe1nf
      x-internal: true
      allOf:
        - $ref: '#/components/schemas/Identifier'
        - type: object
          required:
            - email
            - sender_user
            - settlement_id
            - state
          properties:
            email:
              type: string
              x-stoplight:
                id: tnhxje2guszp3
              format: email
            sender_user:
              $ref: '#/components/schemas/User-Read-Minimal'
            settlement_id:
              type: string
              x-stoplight:
                id: 6aod263sq8xxk
              format: uuid
            state:
              $ref: '#/components/schemas/SettlementEmailDeliveryState'
        - $ref: '#/components/schemas/Timestamps'
    Settlement-Read-Nested:
      title: Settlement-Read-Nested
      x-stoplight:
        id: b0g75f7r9nprp
      allOf:
        - $ref: '#/components/schemas/Identifier'
        - type: object
          x-stoplight:
            id: 8dtolmjnu2anj
          required:
            - settlement_id
          properties:
            settlement_id:
              type: string
              x-stoplight:
                id: ma5w6k43cajtr
            ar_settlement_id:
              type: string
              description: Accounts Receivable settlement identifier (e.g., AR-123)
            ap_settlement_id:
              type: string
              description: Accounts Payable settlement identifier (e.g., AP-123)
    DeliveredQuantity-Read:
      title: DeliveredQuantity-Read
      x-stoplight:
        id: trwwil0vsjrtn
      type: object
      required:
        - delivered
        - unit_of_measure
        - material_name
        - total
        - ticketed
      properties:
        delivered:
          type: string
          x-stoplight:
            id: xqo11su8z94my
        unit_of_measure:
          $ref: '#/components/schemas/NullableOrderUnitOfMeasure'
        material_name:
          type: string
          x-stoplight:
            id: h7jmwwi6jx02h
          nullable: true
        total:
          type: string
          x-stoplight:
            id: 8ghxe07yz102y
        ticketed:
          type: boolean
          nullable: true
          x-stoplight:
            id: hxg8e07yz102y
      additionalProperties: false
    AgaveSettlementExport-Read-Nested:
      title: AgaveSettlementExport-Read-Nested
      x-stoplight:
        id: w5x7y9z1a3b5c
      allOf:
        - $ref: '#/components/schemas/Identifier'
        - type: object
          required:
            - state
          properties:
            state:
              $ref: '#/components/schemas/AgaveExportState'
            agave_invoice_id:
              type: string
              x-stoplight:
                id: d7e9f1g3h5i7j
              nullable: true
              description: The invoice ID returned from Agave API
            exported_at:
              type: string
              x-stoplight:
                id: k9l1m3n5o7p9q
              format: date-time
              nullable: true
              description: Timestamp when the settlement was successfully exported
            last_error:
              type: string
              x-stoplight:
                id: r1s3t5u7v9w1x
              nullable: true
              description: Error message from the last failed export attempt
            exported_by:
              x-stoplight:
                id: m7n9p1q3r5s7t
              nullable: true
              description: The principal who initiated the export
              allOf:
                - $ref: '#/components/schemas/Principal-Read-Nested'
    Error-Response:
      title: Error-Response
      x-stoplight:
        id: 52cydhphee3qe
      type: object
      required:
        - error
      properties:
        error:
          $ref: '#/components/schemas/Error'
      additionalProperties: false
    UnauthenticatedError-Response:
      title: UnauthenticatedError-Response
      x-stoplight:
        id: o477eph7ttbzt
      type: object
      required:
        - error
      properties:
        error:
          $ref: '#/components/schemas/UnauthenticatedError'
      additionalProperties: false
    StateError-Response:
      title: StateError-Response
      x-stoplight:
        id: i0wsk2gmnaqup
      type: object
      required:
        - error
      properties:
        error:
          $ref: '#/components/schemas/StateError'
      additionalProperties: false
    Discardable:
      title: Discardable
      x-stoplight:
        id: 46axlb8u5wjay
      type: object
      required:
        - discarded_at
      properties:
        discarded_at:
          type: string
          x-stoplight:
            id: cy8t6fecoyxbo
          format: date-time
          nullable: true
      additionalProperties: false
    AccountType:
      title: AccountType
      x-stoplight:
        id: i4vfmd4rwrq8p
      enum:
        - customer
        - vendor
      example: customer
    Address-Read-Nested:
      title: Address-Read-Nested
      x-stoplight:
        id: cvym2dzuo375q
      allOf:
        - $ref: '#/components/schemas/Identifier'
        - $ref: '#/components/schemas/Address-Read'
    Company-Read-Nested:
      title: Company-Read-Nested
      x-stoplight:
        id: cb2kn77qmf1l7
      description: Compact Company model for nested reads.
      allOf:
        - $ref: '#/components/schemas/Identifier'
          x-stoplight:
            id: jwsufva4znm91
        - $ref: '#/components/schemas/TreadId'
        - type: object
          properties:
            legal_name:
              type: string
              x-stoplight:
                id: yc10t8hieecwk
              description: The Company's name. Must be globally unique.
            company_type:
              $ref: '#/components/schemas/CompanyType'
          required:
            - legal_name
            - company_type
    Contact-Read-Nested:
      title: Contact-Read-Nested
      x-stoplight:
        id: 3u6d8qhsz5ehn
      allOf:
        - $ref: '#/components/schemas/Identifier'
        - type: object
          required:
            - name
            - email
            - phone
          properties:
            name:
              type: string
              x-stoplight:
                id: sd80y9pbgvkok
              nullable: true
            email:
              type: string
              x-stoplight:
                id: 883fmt34pdeaj
              nullable: true
            phone:
              type: string
              x-stoplight:
                id: wdtqyju4t4u06
              example: '+18885551234'
              nullable: true
      description: ''
    Driver-Read-Typeahead:
      allOf:
        - $ref: '#/components/schemas/Identifier'
        - type: object
          x-stoplight:
            id: 5vacab4kzhkj4
          required:
            - first_name
            - last_name
            - schedule_on
            - phone
            - managed
            - company
          properties:
            first_name:
              type: string
              x-stoplight:
                id: 4gb9hhpizab3h
              description: First name
            last_name:
              type: string
              x-stoplight:
                id: my6q150nen1kb
              description: Last name
            company:
              $ref: '#/components/schemas/Company-Read-Nested'
            company_share:
              $ref: '#/components/schemas/CompanyShare-Read-User-Nested'
            equipment:
              $ref: '#/components/schemas/Equipment-Read-Nested'
            default_equipment:
              $ref: '#/components/schemas/Equipment-Read-Nested'
            schedule_on:
              type: boolean
              x-stoplight:
                id: 7dq6dvne8bqcr
            company_day_driver_stat:
              $ref: '#/components/schemas/CompanyDayDriverStat-Read'
            phone:
              type: string
              x-stoplight:
                id: y4l44re1zfaa9
              description: User's E.164 formatted phone number
              nullable: true
            managed:
              type: boolean
              x-stoplight:
                id: k8m3xq0sz6wt4
            labels:
              type: array
              items:
                $ref: '#/components/schemas/Label-Read-Nested'
              description: Labels assigned to this driver
        - $ref: '#/components/schemas/GpsStatusable'
      title: Driver-Read-Typeahead
    User-Read-Minimal:
      title: User-Read-Minimal
      x-stoplight:
        id: c25yzr29pbh5t
      allOf:
        - $ref: '#/components/schemas/User-Read-Typeahead'
        - $ref: '#/components/schemas/Discardable'
        - x-stoplight:
            id: qmk2e9npvoxcs
          type: object
          required:
            - company
          properties:
            company:
              $ref: '#/components/schemas/Company-Read-Nested'
    SettlementEmailDeliveryState:
      title: SettlementEmailDeliveryState
      x-stoplight:
        id: k8jfsdsjtz731
      enum:
        - initiated
        - delivered
        - failed
      default: initiated
    NullableOrderUnitOfMeasure:
      title: NullableOrderUnitOfMeasure
      x-stoplight:
        id: rtlna368z495u
      allOf:
        - $ref: '#/components/schemas/OrderUnitOfMeasure'
      type: string
      nullable: true
    AgaveExportState:
      title: AgaveExportState
      x-stoplight:
        id: r9k3m5p7s1t3v
      type: string
      enum:
        - not_exported
        - pending
        - exported
        - failed
      description: The current state of the Agave export
    Principal-Read-Nested:
      title: Principal-Read-Nested
      x-stoplight:
        id: oyruvwz2a9ddh
      allOf:
        - type: object
          required:
            - type
          properties:
            type:
              x-stoplight:
                id: up9qg59l8x5s0
              enum:
                - User
                - Company
                - M2MClient
                - Impersonation
        - x-stoplight:
            id: lz1m1s1btit0u
          anyOf:
            - $ref: '#/components/schemas/Company-Read-Nested'
            - $ref: '#/components/schemas/M2MClient-Read-Nested'
            - $ref: '#/components/schemas/User-Read-Minimal'
            - $ref: '#/components/schemas/Impersonation-Read-Minimal'
    Error:
      title: Error
      x-stoplight:
        id: 3g57kkik3l464
      type: object
      description: An Error.
      required:
        - code
      properties:
        code:
          type: string
          x-stoplight:
            id: 7o9x1t8v0bgfo
      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
    StateError:
      title: StateError
      x-stoplight:
        id: zgcsl4t8bsn3c
      allOf:
        - $ref: '#/components/schemas/Error'
        - type: object
          x-stoplight:
            id: ntvt2atfotcge
          required:
            - errors
          properties:
            errors:
              type: array
              x-stoplight:
                id: noi1jg6o8psl7
              items:
                $ref: '#/components/schemas/StateError-Item'
    Address-Read:
      title: Address-Read
      x-stoplight:
        id: v1mcd2qgns2tf
      type: object
      required:
        - thoroughfare
        - premise
        - locality
        - administrative_area
        - postal_code
        - country
        - lat
        - lon
        - place_id
      properties:
        thoroughfare:
          type: string
          x-stoplight:
            id: 8wrr7qkc9ilqn
        premise:
          type: string
          x-stoplight:
            id: z4jth408out1q
          nullable: true
        locality:
          type: string
          x-stoplight:
            id: kfby6wqpgvxbz
        administrative_area:
          type: string
          x-stoplight:
            id: c9bkrloxf4t8d
        postal_code:
          type: string
          x-stoplight:
            id: 7zq51k1mof3o3
        country:
          type: string
          x-stoplight:
            id: iydw9q619ya01
          pattern: ^[A-Z]{2}
          example: US
          minLength: 2
          maxLength: 2
        lat:
          type: string
          x-stoplight:
            id: kqu1qtf9rivh1
          description: |-
            latitude of the `Address`. 

            Must be a stringified number between -90 and 90 inclusive.

            Required if `lon` is present.
          nullable: true
        lon:
          type: string
          x-stoplight:
            id: oly2yabkzpk9g
          description: |-
            longitude of the `Address`. 

            Must be a stringified number between -180 and 180 inclusive.

            Required if `lat` is present.
          nullable: true
        place_id:
          type: string
          x-stoplight:
            id: im1fdq7qqxdij
          description: NextBillion placeID
          nullable: true
      additionalProperties: false
    TreadId:
      title: TreadId
      x-stoplight:
        id: 43k4t5tl359m4
      type: object
      required:
        - tread_id
      properties:
        tread_id:
          type: string
          x-stoplight:
            id: zi3ld7djflw6f
          pattern: ^[0-9A-F]{6}$
          minLength: 6
          maxLength: 6
          example: ABC123
          description: Tread ID
      additionalProperties: false
    CompanyType:
      title: CompanyType
      x-stoplight:
        id: dkzo7gjbtb1b3
      enum:
        - broker
        - contractor
        - hauler
        - owner_operator
        - producer
        - super
      example: hauler
      description: Company Type
    CompanyShare-Read-User-Nested:
      title: CompanyShare-Read-User-Nested
      x-stoplight:
        id: 8czythac5qhgz
      allOf:
        - $ref: '#/components/schemas/CompanyShare-Read-Nested'
        - type: object
          properties:
            default_equipment:
              $ref: '#/components/schemas/Equipment-Read-Default-Nested'
    Equipment-Read-Nested:
      title: Equipment-Read-Nested
      x-stoplight:
        id: 7ezenec7ycv5l
      allOf:
        - $ref: '#/components/schemas/Equipment-Read-Typeahead'
        - type: object
          required:
            - license_number
            - zone
            - accounting_id
            - equipment_id
          properties:
            license_number:
              type: string
              x-stoplight:
                id: hw1ooa17wsadq
              nullable: true
            zone:
              type: string
              x-stoplight:
                id: 81hr4p8yp8btv
              nullable: true
            accounting_id:
              type: string
              x-stoplight:
                id: ere9qhs4cuwhi
              nullable: true
            equipment_id:
              type: string
              x-stoplight:
                id: gt7r3iqzx2w0u
    CompanyDayDriverStat-Read:
      title: CompanyDayDriverStat-Read
      x-stoplight:
        id: 3grxlvq5qo470
      allOf:
        - $ref: '#/components/schemas/Identifier'
        - $ref: '#/components/schemas/Timestamps'
        - type: object
          x-stoplight:
            id: e0k1y5lyccj7x
          properties:
            day:
              type: string
              x-stoplight:
                id: tq2kbgspesbyq
              format: date
            jobs_count:
              type: integer
              x-stoplight:
                id: lq3o1iorx79vx
      description: CompanyDayDriverStat
    Label-Read-Nested:
      title: Label-Read-Nested
      x-stoplight:
        id: lbl1readnest01
      allOf:
        - $ref: '#/components/schemas/Identifier'
        - type: object
          properties:
            name:
              type: string
              x-stoplight:
                id: lbl1nestnm0001
              description: Label name
            color:
              type: string
              x-stoplight:
                id: lbl1nestcol001
              description: Hex color code for the label
              pattern: ^#[0-9A-Fa-f]{6}$
          required:
            - name
            - color
    GpsStatusable:
      title: GpsStatusable
      x-stoplight:
        id: o6oprcupw6ep7
      type: object
      required:
        - gps_status
      properties:
        gps_status:
          $ref: '#/components/schemas/GpsStatus'
      additionalProperties: false
    User-Read-Typeahead:
      title: User-Read-Typeahead
      x-stoplight:
        id: ttbbss5b5k66f
      allOf:
        - $ref: '#/components/schemas/Identifier'
        - type: object
          required:
            - first_name
            - last_name
          properties:
            first_name:
              type: string
              description: First name
              x-stoplight:
                id: gwo999rcdahmg
            last_name:
              type: string
              description: Last name
              x-stoplight:
                id: l9omnnsq644bh
      description: ''
    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
    M2MClient-Read-Nested:
      title: M2MClient-Read-Nested
      x-stoplight:
        id: hf6su2qgixxmz
      allOf:
        - $ref: '#/components/schemas/Identifier'
        - type: object
          required:
            - company
          properties:
            company:
              $ref: '#/components/schemas/Company-Read-Nested'
    Impersonation-Read-Minimal:
      title: Impersonation-Read-Minimal
      x-stoplight:
        id: 1h5th7jnqtxix
      type: object
      required:
        - impersonator
        - impersonated
      properties:
        impersonator:
          $ref: '#/components/schemas/User-Read-Minimal'
        impersonated:
          $ref: '#/components/schemas/User-Read-Minimal'
    StateError-Item:
      title: StateError-Item
      x-stoplight:
        id: dgw2jdmi7ozjj
      allOf:
        - $ref: '#/components/schemas/ModelError-Item'
        - type: object
          x-stoplight:
            id: jrgi7oapao3e5
          required:
            - state
            - event
          properties:
            state:
              type: string
              x-stoplight:
                id: mah8jye43io32
              description: The current state value of the field on this Model
            event:
              type: string
              x-stoplight:
                id: dtgu62ni9ofuh
              description: The failed state event called on the Model
    CompanyShare-Read-Nested:
      title: CompanyShare-Read-Nested
      x-stoplight:
        id: makajouqsb7jq
      allOf:
        - $ref: '#/components/schemas/Identifier'
        - type: object
          x-stoplight:
            id: s6h0nfzt2fjry
          required:
            - external_id
            - ticket_match_id
            - sender_company
            - dispatchable
            - schedule_on
            - rate_override
            - expires_at
          properties:
            external_id:
              type: string
              x-stoplight:
                id: c9ls3nrhbih3v
              nullable: true
            ticket_match_id:
              type: string
              x-stoplight:
                id: a1cd3nrhbih3v
              nullable: true
            sender_company:
              $ref: '#/components/schemas/Company-Read-Nested'
            dispatchable:
              type: boolean
              x-stoplight:
                id: kd884ihz6qi6w
            schedule_on:
              type: boolean
              x-stoplight:
                id: kd884ihz61234
            rate_override:
              type: boolean
              x-stoplight:
                id: mq4osazzielxo
            expires_at:
              type: string
              x-stoplight:
                id: aaa111jpq0ga9
              format: date-time
              description: ISO8601 timestamp with local timezone
              nullable: true
    Equipment-Read-Default-Nested:
      title: Equipment-Read-Default-Nested
      x-stoplight:
        id: kojte9y4g6t9v
      allOf:
        - $ref: '#/components/schemas/Identifier'
        - type: object
          required:
            - name
            - external_id
            - equipment_type
            - equipment_id
          properties:
            name:
              type: string
              description: Equipment name
            external_id:
              type: string
              nullable: true
            equipment_type:
              $ref: '#/components/schemas/EquipmentType-Read-Nested'
            company_share:
              $ref: '#/components/schemas/CompanyShare-Read-Nested'
            equipment_id:
              type: string
              x-stoplight:
                id: v25n5jka8apv0
    Equipment-Read-Typeahead:
      title: Equipment-Read-Typeahead
      x-stoplight:
        id: sv94osohm5xhg
      allOf:
        - $ref: '#/components/schemas/Identifier'
        - type: object
          required:
            - name
            - equipment_type
            - external_id
            - equipment_id
          properties:
            name:
              type: string
              description: Equipment name
            equipment_type:
              $ref: '#/components/schemas/EquipmentType-Read-Nested'
            external_id:
              type: string
              x-stoplight:
                id: jrkz95htilck3
              nullable: true
            company_share:
              $ref: '#/components/schemas/CompanyShare-Read-Nested'
            equipment_id:
              type: string
              x-stoplight:
                id: fkr9fkdtl996f
    GpsStatus:
      title: GpsStatus
      x-stoplight:
        id: 3b02180lfd6ve
      description: GPS Ping status for a record
      type: object
      required:
        - status
        - last_ping_at
      properties:
        status:
          x-stoplight:
            id: 7f6aqydupq3ac
          enum:
            - online
            - offline
            - idle
            - no_signal
        last_ping_at:
          type: string
          x-stoplight:
            id: 1ikh7blmxdqcz
          format: date-time
          nullable: true
      additionalProperties: false
    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
    EquipmentType-Read-Nested:
      title: EquipmentType-Read-Nested
      x-stoplight:
        id: em46i5kysysdh
      type: object
      required:
        - id
        - name
        - system
        - external_id
        - accounting_id
      properties:
        id:
          type: string
          x-stoplight:
            id: 835oy22o6h24z
          format: uuid
        name:
          type: string
          x-stoplight:
            id: tnszefd7lypln
        system:
          type: boolean
          x-stoplight:
            id: vimoqz5e8x6gx
        external_id:
          type: string
          x-stoplight:
            id: ttaijg77qmbgk
          nullable: true
        accounting_id:
          type: string
          x-stoplight:
            id: s4rscgptv68x3
          nullable: true
      additionalProperties: false
  responses:
    Error:
      description: Error response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error-Response'
            type: object
    UnauthenticatedError:
      description: Example response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UnauthenticatedError-Response'
            type: object
    StateError:
      description: Example response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/StateError-Response'
            type: object
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````