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

# Get Work Order List

> Retrieve a paginated list of work orders with related tasks, payments, attachments, and tags. `from_date` and `to_date` are required query parameters.



## OpenAPI

````yaml GET /work-orders/
openapi: 3.0.1
info:
  title: OpenAPI Datatruck
  description: >-
    To be able to use Datatruck OpenAPI you should create tokens from your
    dashboard. Go to your dashboard and create token with appropriate scopes and
    expiration. Expiration and scopes are optional as well as description for
    your token, but remember name is required.
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://{company}.datatruck.io/api/v1/openapi/
security: []
paths:
  /work-orders/:
    get:
      summary: Get Work Order List
      description: >-
        Retrieve a paginated list of work orders with related tasks, payments,
        attachments, and tags. `from_date` and `to_date` are required query
        parameters.
      operationId: getWorkOrders
      parameters:
        - name: from_date
          in: query
          required: true
          schema:
            type: string
            format: date
            example: '2025-01-01'
          description: 'Start date filter (inclusive). Format: YYYY-MM-DD.'
        - name: to_date
          in: query
          required: true
          schema:
            type: string
            format: date
            example: '2025-01-31'
          description: >-
            End date filter (inclusive). Format: YYYY-MM-DD. Must be after
            from_date.
        - name: page
          in: query
          required: false
          schema:
            type: integer
            example: 1
          description: Page number for paginated results.
        - name: page_size
          in: query
          required: false
          schema:
            type: integer
            example: 10
            maximum: 25
          description: Number of results per page (max 25, default 10).
        - name: ordering
          in: query
          required: false
          schema:
            type: string
            example: '-created_datetime'
          description: ORM field path to order by. Prefix with `-` for descending.
        - name: filter
          in: query
          required: false
          schema:
            type: string
            example: '[{"column":"status","value":"Pending","contains":"is"}]'
          description: >-
            JSON-encoded array of filter objects. Each object has `column`,
            `value`, and `contains` (operator). Supported operators: `is`,
            `is_not`, `is_in`, `is_not_in`, `contains`, `before`, `after`,
            `greater_than`, `less_than`, `between`, `between_datetime`,
            `isnull`, `today`, `exclude`, `exclude_in`.
      responses:
        '200':
          description: List of work orders retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListWorkOrderResponse'
        '400':
          description: Invalid request parameters
components:
  schemas:
    ListWorkOrderResponse:
      type: object
      properties:
        count:
          type: integer
          example: 50
          description: Total number of work orders
        next:
          type: string
          nullable: true
          example: /work-orders/?page=2
          description: URL to the next page of results
        previous:
          type: string
          nullable: true
          example: null
          description: URL to the previous page of results
        results:
          type: array
          items:
            $ref: '#/components/schemas/WorkOrder'
    WorkOrder:
      type: object
      required:
        - id
        - number
        - reference_number
        - status
        - vendor
        - assigned_to
        - attachments
      properties:
        id:
          type: integer
          example: 1001
          description: Work order ID
        number:
          type: string
          example: WO-2025-001
          description: Work order number
        reference_number:
          type: string
          example: REF-12345
          description: External reference number for the work order.
        status:
          type: string
          example: Pending
          description: Current status of the work order
        vendor:
          type: string
          example: ABC Auto Repair
          description: Vendor assigned to the work order
        assigned_to:
          type: string
          example: John Doe
          description: Person responsible for the work order
        mc_number:
          type: string
          nullable: true
          example: MC-123456
          description: Motor Carrier number
        truck:
          type: string
          nullable: true
          example: Truck-45
          description: Truck associated with the work order
        trailer:
          type: string
          nullable: true
          example: Trailer-22
          description: Trailer associated with the work order
        approved_by:
          type: string
          nullable: true
          example: Jane Smith
          description: Person who approved the work order
        custom_payment_method:
          type: string
          nullable: true
          example: Wire Transfer
          description: Custom payment method used
        total_price:
          type: string
          format: decimal
          example: '1200.50'
          description: Total price for the work order
        paid_amount:
          type: string
          format: decimal
          example: '500.00'
          description: Total amount paid
        balance:
          type: string
          format: decimal
          example: '700.50'
          description: Remaining balance
        work_order_tasks:
          type: array
          items:
            $ref: '#/components/schemas/WorkOrderTask'
        tags:
          type: array
          items:
            $ref: '#/components/schemas/WorkOrderTag'
        work_order_payments:
          type: array
          items:
            $ref: '#/components/schemas/WorkOrderPayment'
        attachments:
          type: array
          description: Files attached to the work order.
          items:
            $ref: '#/components/schemas/WorkOrderAttachment'
        scheduled_on_date:
          type: string
          format: date-time
          example: '2025-03-10T08:00:00Z'
          description: Scheduled date and time for the work order
        procedure_name:
          type: string
          nullable: true
          example: TRK Accident Damage / Repair
          description: >-
            Procedure name list: {"name": "TRK Accident Damage / Repair"},
            {"name": "TRK Complex Repair"}, {"name": "TRK Air System Leakage"},
            {"name": "TRK Brake Issue"}, {"name": "TRK ABS failure"}, {"name":
            "TRK Body Damage"}, {"name": "TRK 5th Wheel Repair"}, {"name": "TRK
            Alignment/Balancing"}, {"name": "TRK Tire Repair / Replacement"},
            {"name": "TRK TIre Rim Repair / Replacement"}, {"name": "TRK Tire
            Hub Repair / Replacement/Oil refill"}, {"name": "TRK Check Engine
            Light"}, {"name": "TRK Stop Engine Light"}, {"name": "TRK Starter
            failure"}, {"name": "TRK Oil Leakage"}, {"name": "TRK Coolant
            Leakage"}, {"name": "TRK Fuel Leakage"}, {"name": "TRK Electrical
            Issues"}, {"name": "TRK Lights repair"}, {"name": "TRK Def system
            issue"}, {"name": "TRK Exhaust system issue"}, {"name": "TRK
            Suspension issue"}, {"name": "TRK Windshield"}, {"name": "TRK Side
            Windows repair/replacement"}, {"name": "TRK Wiper blades
            replacement"}, {"name": "TRK Inner appliances Issues"}, {"name":
            "TRK Inverter failure"}, {"name": "TRK Air conditioner service"},
            {"name": "TRK Wash"}, {"name": "TRK TOW"}, {"name": "TRK Other
            Repair"}, {"name": "TRL Accident Damage / Repair"}, {"name": "TRL
            Complex Repair"}, {"name": "TRL Air System Leakage"}, {"name": "TRL
            Brake Issue"}, {"name": "TRL ABS failure"}, {"name": "TRL Body
            Damage"}, {"name": "TRL 5th Wheel Repair"}, {"name": "TRL
            Alignment/Balancing"}, {"name": "TRL Tire Repair / Replacement"},
            {"name": "TRL TIre Rim Repair / Replacement"}, {"name": "TRL Tire
            Hub Repair / Replacement/Oil refill"}, {"name": "TRL Check Engine
            Light"}, {"name": "TRL Stop Engine Light"}, {"name": "TRL Starter
            failure"}, {"name": "TRL Oil Leakage"}, {"name": "TRL Coolant
            Leakage"}, {"name": "TRL Fuel Leakage"}, {"name": "TRL Electrical
            Issues"}, {"name": "TRL Lights repair"}, {"name": "TRL Def system
            issue"}, {"name": "TRL Exhaust system issue"}, {"name": "TRL
            Suspension issue"}, {"name": "TRL Windshield"}, {"name": "TRL Side
            Windows repair/replacement"}, {"name": "TRL Wiper blades
            replacement"}, {"name": "TRL Inner appliances Issues"}, {"name":
            "TRL Inverter failure"}, {"name": "TRL Air conditioner service"},
            {"name": "TRL Wash"}, {"name": "TRL TOW"}, {"name": "TRL Other
            Repair"}
    WorkOrderTask:
      type: object
      properties:
        id:
          type: integer
          example: 1
        number:
          type: string
          nullable: true
          example: TASK-1001
        custom_task:
          type: string
          nullable: true
          example: Brake replacement
        parts_price:
          type: string
          format: decimal
          example: '200.00'
        parts_quantity:
          type: integer
          example: 2
        total_parts_price:
          type: string
          format: decimal
          example: '400.00'
        labor_price:
          type: string
          format: decimal
          example: '100.00'
        labor_hours:
          type: integer
          example: 2
        total_labor_price:
          type: string
          format: decimal
          example: '200.00'
        total_price:
          type: string
          format: decimal
          example: '600.00'
    WorkOrderTag:
      type: object
      properties:
        id:
          type: integer
          example: 10
        name:
          type: string
          example: Urgent
    WorkOrderPayment:
      type: object
      properties:
        id:
          type: integer
          example: 5
        amount:
          type: string
          format: decimal
          example: '500.00'
        note:
          type: string
          nullable: true
          example: Partial payment received
        payment_date:
          type: string
          format: date
          nullable: true
          example: '2025-03-10'
    WorkOrderAttachment:
      type: object
      properties:
        id:
          type: integer
          example: 1
        name:
          type: string
          example: Invoice scan
        document:
          type: object
          properties:
            id:
              type: integer
            created_datetime:
              type: string
              format: date-time
            file:
              type: string
              format: uri
              example: https://storage.example.com/docs/scan.pdf
            format:
              type: string
              example: pdf
            name:
              type: string
              example: scan.pdf
          required:
            - id
            - created_datetime
            - file
            - format
            - name
      required:
        - id
        - name
        - document

````