Skip to main content
POST
/
work-orders
/
create
Create Work Order
curl --request POST \
  --url https://{company}.datatruck.io/api/v1/openapi/work-orders/create/ \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "status": "Pending",
  "type_work_order": "Repair",
  "payment_type": "Credit Card",
  "invoice_id": "INV-98765",
  "scheduled_on_date": "2025-03-10T08:00:00Z",
  "assigned_to": "John Doe",
  "odometer": 120000,
  "vendor": "ABC Auto Repair",
  "truck": "Truck-45",
  "trailer": "Trailer-22",
  "fee_total_price": "50.00",
  "tax_total_price": "25.00",
  "total_price": "500.00",
  "location": "Los Angeles, CA",
  "vendor_phone": "+1-555-1234",
  "vendor_email": "[email protected]",
  "procedure_name": "TRK Accident Damage / Repair",
  "notes": [
    "<string>"
  ],
  "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"
    }
  ],
  "compensation": [
    {
      "driver": "Driver Name",
      "customer": "Customer Name"
    }
  ],
  "tags": [
    "<string>"
  ]
}
'
{
  "id": 12345
}

Authorizations

Authorization
string
header
required

Body

application/json
status
string
required

Current status of the work order

Example:

"Pending"

type_work_order
string
required

Type of work order

Example:

"Repair"

payment_type
string
required

Payment method used

Example:

"Credit Card"

invoice_id
string
required

Associated invoice ID

Example:

"INV-98765"

scheduled_on_date
string<date-time>
required

Scheduled date and time for the work order

Example:

"2025-03-10T08:00:00Z"

assigned_to
string
required

Person assigned to the work order

Example:

"John Doe"

odometer
integer
required

Vehicle odometer reading

Example:

120000

vendor
string
required

Vendor responsible for the work order

Example:

"ABC Auto Repair"

truck
string | null
Example:

"Truck-45"

trailer
string | null
Example:

"Trailer-22"

fee_total_price
string<decimal>

Total fees for the work order

Example:

"50.00"

tax_total_price
string<decimal>

Total tax for the work order

Example:

"25.00"

total_price
string<decimal>

Total price of the work order

Example:

"500.00"

location
string | null

Location where the work order is being performed

Example:

"Los Angeles, CA"

vendor_phone
string | null

Vendor phone number

Example:

"+1-555-1234"

vendor_email
string | null

Vendor email address

procedure_name
string | null

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"}

Example:

"TRK Accident Damage / Repair"

notes
string[]

Additional notes related to the work order

work_order_tasks
object[]

List of tasks related to the work order

compensation
object[]

Compensation details for the work order

tags
string[]

Tags associated with the work order

Response

Work order created successfully

id
integer

Unique work order ID

Example:

12345