Skip to main content
GET
/
orders
/
List Orders
curl --request GET \
  --url https://{company}.datatruck.io/api/v1/openapi/orders/ \
  --header 'Authorization: <api-key>'
{
  "count": 150,
  "next": "<string>",
  "previous": "<string>",
  "results": [
    {
      "id": 12345,
      "status": "In Progress",
      "created_datetime": "2025-02-06T12:00:00Z",
      "tags": [
        {
          "name": "Urgent"
        }
      ],
      "stops": [
        {
          "id": 123,
          "order": 123,
          "stop_type": "pickup",
          "location": {
            "id": 123,
            "company": "<string>",
            "address1": "<string>",
            "address2": "<string>",
            "city": "<string>",
            "state": "<string>",
            "zip_code": "<string>",
            "contact_name": "<string>",
            "place_name": "<string>",
            "latitude": 33.749,
            "longitude": -84.388,
            "is_active": true
          },
          "reference_id": "REF-001",
          "proof_of_delivery": "<string>",
          "ready_time_start_date": "2023-11-07T05:31:56Z",
          "ready_time_end_date": "2023-11-07T05:31:56Z",
          "note": "<string>"
        }
      ],
      "equipment_type": "Refrigerated",
      "equipment_type_child": [
        "Chilled Storage"
      ],
      "estimated_mile": "1200.50",
      "estimated_time": 10,
      "eta_detail": {
        "on_time": true,
        "eta_datetime": "2023-11-07T05:31:56Z"
      },
      "trip": {
        "id": 123,
        "status": "assigned",
        "trip_id": "TR-002489-01",
        "mile": "574.31",
        "empty_mile": "0.00",
        "total_load_pay": "148.17",
        "carrier__name": "<string>",
        "driver__full_name": "<string>",
        "team_driver__full_name": "<string>",
        "truck__unit_number": "<string>",
        "pickup": {
          "id": 123,
          "company": "<string>",
          "address1": "<string>",
          "address2": "<string>",
          "city": "<string>",
          "state": "<string>",
          "zip_code": "<string>",
          "contact_name": "<string>",
          "place_name": "<string>",
          "latitude": 33.749,
          "longitude": -84.388,
          "is_active": true
        },
        "delivery": {
          "id": 123,
          "company": "<string>",
          "address1": "<string>",
          "address2": "<string>",
          "city": "<string>",
          "state": "<string>",
          "zip_code": "<string>",
          "contact_name": "<string>",
          "place_name": "<string>",
          "latitude": 33.749,
          "longitude": -84.388,
          "is_active": true
        },
        "settlement": {
          "settlement__status": "<string>",
          "settlement__settlement_number": "<string>",
          "settlement__is_sent": true
        }
      },
      "batch_orders": {
        "invoice_number": "<string>",
        "is_sent": true,
        "batch": {
          "batch_number": "<string>",
          "status": "<string>"
        }
      },
      "assigned_driver_n_truck": {
        "driver_full_name": "<string>",
        "truck_unit_number": "<string>"
      },
      "assigned_carrier": "<string>",
      "is_flagged": false,
      "documents": [
        {
          "file_type": "rate_confirmation",
          "file_link": "https://storage.example.com/docs/rc-12345.pdf",
          "uploaded_at": "2025-02-06T12:00:00Z",
          "uploaded_by": "John Doe"
        }
      ],
      "load_id": "LD-987654",
      "shipment_id": "SHIP-123456",
      "load_pay": "5000.00",
      "total_miles": "1500.75",
      "created_by__full_name": "John Doe",
      "total_other_pay": "200.00",
      "total_pay": "5200.00",
      "per_mile_revenue": "3.25",
      "dispatcher__full_name": "Alice Johnson",
      "customer__company_name": "ABC Logistics",
      "mc_number__company_name": "XYZ Carriers",
      "office__office_name": "Dallas Office",
      "pickup_appointment_time": "2025-02-06T08:30:00Z",
      "delivery_appointment_time": "2025-02-07T15:00:00Z",
      "pickup_time": "2025-02-06T09:00:00Z",
      "delivery_time": "2025-02-07T16:30:00Z",
      "transportation_mode": "Truckload",
      "driver_requirements": [
        "<string>"
      ],
      "additional_equipments": [
        "<string>"
      ],
      "freight_requirements": [
        "<string>"
      ],
      "freight_requirements_min_temperature": "2.0",
      "freight_requirements_max_temperature": "8.0",
      "flagging_reason": null
    }
  ]
}

API Url

https://{company_name}.datatruck.io/api/v1/openapi/orders/
Here, please put your company name in the url. Ex: if it is CompanyX company, then url should be
https://companyx.datatruck.io/api/v1/openapi/orders/

Sample request

curl --request GET \
--url https://{company_name}.datatruck.io/api/v1/openapi/orders/ \
--header "Authorization: Token cc92174571ac12f386e5657b187d39bb210f3270a837730125ed4029a44fsdfasd" \
--header "Content-Type: application/json"

Sample response

{
    "count": 150,
    "next": "https://companyx.datatruck.io/api/v1/openapi/orders/?page=2",
    "previous": null,
    "results": [
        {
            "id": 2489,
            "load_id": "T-111QT34XS",
            "shipment_id": "DT-002489",
            "status": "dispatched",
            "load_pay": "148.17",
            "total_miles": "574.31",
            "created_datetime": "2023-10-11T13:42:54.456045Z",
            "created_by__full_name": "Super Admin",
            "total_other_pay": "122.00",
            "total_pay": "270.17",
            "per_mile_revenue": "0.26",
            "tags": [{"name": "AUTOBOT"}],
            "dispatcher__full_name": "Alice Johnson",
            "customer__company_name": "ABC Logistics",
            "mc_number__company_name": "Updated Test Mc Number",
            "office__office_name": null,
            "pickup_appointment_time": "2023-10-08T20:00:00Z",
            "delivery_appointment_time": "2023-10-11T23:14:00Z",
            "pickup_time": "2023-10-08T20:00:00Z",
            "delivery_time": "2023-10-11T23:14:00Z",
            "stops": [
                {
                    "id": 101,
                    "order": 2489,
                    "stop_type": "pickup",
                    "location": {
                        "id": 1348,
                        "company": "DWA9",
                        "address1": "3711 142nd Ave E, Sumner, WA 98390, USA",
                        "city": "Sumner",
                        "state": "Washington",
                        "zip_code": "98390",
                        "latitude": 47.203,
                        "longitude": -122.229,
                        "is_active": true
                    },
                    "reference_id": "REF-001",
                    "proof_of_delivery": null
                }
            ],
            "is_flagged": false,
            "flagging_reason": null,
            "documents": [
                {
                    "file_type": "rate_confirmation",
                    "file_link": "https://storage.example.com/docs/rc-2489.pdf",
                    "uploaded_by": "Super Admin",
                    "uploaded_at": "2023-10-11T13:50:00Z"
                }
            ],
            "trip": {
                "id": 1913,
                "status": "assigned",
                "trip_id": "TR-002489-01",
                "mile": "574.31",
                "empty_mile": "0.00",
                "total_load_pay": "148.17",
                "carrier__name": null,
                "driver__full_name": "John Smith",
                "team_driver__full_name": null,
                "truck__unit_number": "2105",
                "pickup": {
                    "id": 1348,
                    "company": "DWA9",
                    "address1": "3711 142nd Ave E",
                    "city": "Sumner",
                    "state": "Washington",
                    "zip_code": "98390",
                    "latitude": 47.203,
                    "longitude": -122.229,
                    "is_active": true
                },
                "delivery": null,
                "settlement": null
            },
            "batch_orders": null,
            "eta_detail": {"on_time": true, "eta_datetime": null}
        }
    ]
}

Filtering

Pass a JSON-encoded array to the filter query parameter. Each object in the array has three keys:
KeyDescription
columnORM field path (e.g. status, load_pay, delivery_time)
valueThe filter value
containsOperator (see table below)

Supported operators

OperatorDescriptionExample value
isExact match"booked"
is_notExclude exact match"cancelled"
is_inMatch any in list["booked","dispatched"]
is_not_inExclude all in list["cancelled"]
containsCase-insensitive substring"logistics"
beforeLess than or equal"2024-07-10T23:59:59Z"
afterGreater than or equal"2024-06-26T00:00:00Z"
greater_thanGreater than or equal (numeric)"1000"
less_thanLess than or equal (numeric)"5000"
betweenNumeric range (comma-separated)"1000,5000"
between_datetimeDatetime range (comma-separated ISO)"2024-06-26T00:00:00Z,2024-07-10T23:59:59Z"
isnullIs null check"true" or "false"
todayMatches today’s date(any value)
excludeExclude exact match"booked"
exclude_inExclude all in list["booked","dispatched"]

Examples

Filter by status:
?filter=[{"column":"status","value":"booked","contains":"is"}]
Filter by delivery datetime range:
?filter=[{"column":"delivery_time","value":"2024-06-26T00:00:00.000Z,2024-07-10T23:59:59.000Z","contains":"between_datetime"}]
Filter after a date:
?filter=[{"column":"delivery_time","value":"2024-06-26T00:00:00.000Z","contains":"after"}]
Combine multiple filters:
?filter=[{"column":"status","value":"booked","contains":"is"},{"column":"load_pay","value":"1000,5000","contains":"between"}]

Ordering

Use the ordering query parameter with an ORM field path. Prefix with - for descending order.
?ordering=-created_datetime
?ordering=load_pay

Authorizations

Authorization
string
header
required

Query Parameters

page
integer

Page number for paginated results.

Example:

1

page_size
integer

Number of results per page (max 25, default 10).

Required range: x <= 25
Example:

10

ordering
string

ORM field path to order by. Prefix with - for descending order (e.g. -created_datetime, load_pay, status).

Example:

"-created_datetime"

filter
string

JSON-encoded array of filter objects. Each object has column (ORM field path), 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. Example: [{"column":"status","value":"booked","contains":"is"},{"column":"load_pay","value":"1000,5000","contains":"between"}]

Example:

"[{\"column\":\"status\",\"value\":\"booked\",\"contains\":\"is\"}]"

Response

Paginated list of orders.

count
integer
required

Total number of orders.

Example:

150

next
string | null
required

URL to the next page of results.

previous
string | null
required

URL to the previous page of results.

results
object[]
required

List of orders.