curl --request GET \
--url https://{company}.datatruck.io/api/v1/openapi/work-orders/ \
--header 'Authorization: <api-key>'import requests
url = "https://{company}.datatruck.io/api/v1/openapi/work-orders/"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://{company}.datatruck.io/api/v1/openapi/work-orders/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{company}.datatruck.io/api/v1/openapi/work-orders/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{company}.datatruck.io/api/v1/openapi/work-orders/"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{company}.datatruck.io/api/v1/openapi/work-orders/")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{company}.datatruck.io/api/v1/openapi/work-orders/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"count": 50,
"next": "/work-orders/?page=2",
"previous": null,
"results": [
{
"id": 1001,
"number": "WO-2025-001",
"reference_number": "REF-12345",
"status": "Pending",
"vendor": "ABC Auto Repair",
"assigned_to": "John Doe",
"attachments": [
{
"id": 1,
"name": "Invoice scan",
"document": {
"id": 123,
"created_datetime": "2023-11-07T05:31:56Z",
"file": "https://storage.example.com/docs/scan.pdf",
"format": "pdf",
"name": "scan.pdf"
}
}
],
"mc_number": "MC-123456",
"truck": "Truck-45",
"trailer": "Trailer-22",
"approved_by": "Jane Smith",
"custom_payment_method": "Wire Transfer",
"total_price": "1200.50",
"paid_amount": "500.00",
"balance": "700.50",
"work_order_tasks": [
{
"id": 1,
"number": "TASK-1001",
"custom_task": "Brake replacement",
"parts_price": "200.00",
"parts_quantity": 2,
"total_parts_price": "400.00",
"labor_price": "100.00",
"labor_hours": 2,
"total_labor_price": "200.00",
"total_price": "600.00"
}
],
"tags": [
{
"id": 10,
"name": "Urgent"
}
],
"work_order_payments": [
{
"id": 5,
"amount": "500.00",
"note": "Partial payment received",
"payment_date": "2025-03-10"
}
],
"scheduled_on_date": "2025-03-10T08:00:00Z",
"procedure_name": "TRK Accident Damage / Repair"
}
]
}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.
curl --request GET \
--url https://{company}.datatruck.io/api/v1/openapi/work-orders/ \
--header 'Authorization: <api-key>'import requests
url = "https://{company}.datatruck.io/api/v1/openapi/work-orders/"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://{company}.datatruck.io/api/v1/openapi/work-orders/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{company}.datatruck.io/api/v1/openapi/work-orders/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{company}.datatruck.io/api/v1/openapi/work-orders/"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{company}.datatruck.io/api/v1/openapi/work-orders/")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{company}.datatruck.io/api/v1/openapi/work-orders/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"count": 50,
"next": "/work-orders/?page=2",
"previous": null,
"results": [
{
"id": 1001,
"number": "WO-2025-001",
"reference_number": "REF-12345",
"status": "Pending",
"vendor": "ABC Auto Repair",
"assigned_to": "John Doe",
"attachments": [
{
"id": 1,
"name": "Invoice scan",
"document": {
"id": 123,
"created_datetime": "2023-11-07T05:31:56Z",
"file": "https://storage.example.com/docs/scan.pdf",
"format": "pdf",
"name": "scan.pdf"
}
}
],
"mc_number": "MC-123456",
"truck": "Truck-45",
"trailer": "Trailer-22",
"approved_by": "Jane Smith",
"custom_payment_method": "Wire Transfer",
"total_price": "1200.50",
"paid_amount": "500.00",
"balance": "700.50",
"work_order_tasks": [
{
"id": 1,
"number": "TASK-1001",
"custom_task": "Brake replacement",
"parts_price": "200.00",
"parts_quantity": 2,
"total_parts_price": "400.00",
"labor_price": "100.00",
"labor_hours": 2,
"total_labor_price": "200.00",
"total_price": "600.00"
}
],
"tags": [
{
"id": 10,
"name": "Urgent"
}
],
"work_order_payments": [
{
"id": 5,
"amount": "500.00",
"note": "Partial payment received",
"payment_date": "2025-03-10"
}
],
"scheduled_on_date": "2025-03-10T08:00:00Z",
"procedure_name": "TRK Accident Damage / Repair"
}
]
}Authorizations
Send your API key with the Token prefix: Authorization: Token <api-key>.
Query Parameters
Start date filter (inclusive). Format: YYYY-MM-DD.
"2025-01-01"
End date filter (inclusive). Format: YYYY-MM-DD. Must be after from_date.
"2025-01-31"
Page number for paginated results.
x >= 11
Results per page. Default: 10. Use a positive integer, or all for every result on one page. No maximum.
x >= 110
ORM field path to order by. Prefix with - for descending.
"-created_datetime"
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.
"[{\"column\":\"status\",\"value\":\"Pending\",\"contains\":\"is\"}]"