curl --request PATCH \
--url https://api.tread-horizon.com/v1/orders/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"load_at": "2023-11-07T05:31:56Z",
"notes": "<string>",
"order_notes": "<string>",
"quantity": 123,
"truck_count": 100,
"truck_delay": 123,
"unit_of_measure": "Load",
"load_unit_of_measure": "Load",
"equipment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"material_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"service_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"waypoints": [
{
"type": "pickup",
"site_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"contact": {
"name": "<string>",
"email": "<string>",
"phone": "+18885551234"
},
"ordinality": 123,
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"_destroy": 123
}
],
"customer_rate_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"vendor_rate_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"phase": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"_destroy": 123,
"name": "<string>",
"code": "<string>",
"primary": true
},
"sales_contact": {
"name": "<string>",
"email": "<string>",
"phone": "+18885551234",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"_destroy": 123
},
"foreman_contact": {
"name": "<string>",
"email": "<string>",
"phone": "+18885551234",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"_destroy": 123
},
"foreman_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"collaborator_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"salesperson_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"supervisor_contact": {
"name": "<string>",
"email": "<string>",
"phone": "+18885551234",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"_destroy": 123
},
"collaborator_contact": {
"name": "<string>",
"email": "<string>",
"phone": "+18885551234",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"_destroy": 123
},
"department_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"po_job_number": "<string>",
"zone": "<string>",
"external_id": "<string>",
"service_class_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"hauler_rate_type": "RatePerHour",
"job_notes": "<string>",
"job_time": 123,
"units_per_hour": 123,
"job_quantity": 123,
"dispatch_number": {
"name": "<string>",
"_destroy": 123
},
"customer_rate_value": 123,
"customer_rate_type": "RatePerHour",
"vendor_rate_value": 123,
"vendor_rate_type": "RatePerHour",
"trucks_per_delay": 2,
"driver_rate_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"driver_rate_value": 123,
"driver_rate_type": "RatePerHour",
"requester_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"phases": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"_destroy": 123,
"name": "<string>",
"code": "<string>",
"primary": true
}
],
"equipment_type_gross_capacity": 123,
"pickup_onsite_minutes": 123,
"dropoff_onsite_minutes": 123,
"pickup_to_dropoff_time_minutes": 123,
"pickup_to_dropoff_distance_meters": 123,
"expected_total_loads": 123,
"loads_per_truck": 13,
"recurring_loads": true,
"material_rate_site_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"material_rate_unit_of_measure": "Load",
"material_rate_sell_price": 123,
"material_rate_buy_price": 123,
"material_rate_itemized": true,
"geofence_delay_seconds": 123,
"job_unit_of_measure": "Load",
"equipment_type_gross_capacity_unit_of_measure": "Load",
"equipment_type_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"internal_notes": "<string>",
"job_start_at": "2023-11-07T05:31:56Z",
"cycle_time_minutes": 123,
"charge_to_account": "<string>",
"chase_missing_tickets": true,
"tax_rate": 123,
"tax_freight": false,
"tax_material": false,
"tax_add_ons": false
}
'import requests
url = "https://api.tread-horizon.com/v1/orders/{id}"
payload = {
"load_at": "2023-11-07T05:31:56Z",
"notes": "<string>",
"order_notes": "<string>",
"quantity": 123,
"truck_count": 100,
"truck_delay": 123,
"unit_of_measure": "Load",
"load_unit_of_measure": "Load",
"equipment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"material_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"service_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"waypoints": [
{
"type": "pickup",
"site_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"contact": {
"name": "<string>",
"email": "<string>",
"phone": "+18885551234"
},
"ordinality": 123,
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"_destroy": 123
}
],
"customer_rate_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"vendor_rate_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"phase": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"_destroy": 123,
"name": "<string>",
"code": "<string>",
"primary": True
},
"sales_contact": {
"name": "<string>",
"email": "<string>",
"phone": "+18885551234",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"_destroy": 123
},
"foreman_contact": {
"name": "<string>",
"email": "<string>",
"phone": "+18885551234",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"_destroy": 123
},
"foreman_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"collaborator_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"salesperson_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"supervisor_contact": {
"name": "<string>",
"email": "<string>",
"phone": "+18885551234",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"_destroy": 123
},
"collaborator_contact": {
"name": "<string>",
"email": "<string>",
"phone": "+18885551234",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"_destroy": 123
},
"department_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"po_job_number": "<string>",
"zone": "<string>",
"external_id": "<string>",
"service_class_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"hauler_rate_type": "RatePerHour",
"job_notes": "<string>",
"job_time": 123,
"units_per_hour": 123,
"job_quantity": 123,
"dispatch_number": {
"name": "<string>",
"_destroy": 123
},
"customer_rate_value": 123,
"customer_rate_type": "RatePerHour",
"vendor_rate_value": 123,
"vendor_rate_type": "RatePerHour",
"trucks_per_delay": 2,
"driver_rate_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"driver_rate_value": 123,
"driver_rate_type": "RatePerHour",
"requester_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"phases": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"_destroy": 123,
"name": "<string>",
"code": "<string>",
"primary": True
}
],
"equipment_type_gross_capacity": 123,
"pickup_onsite_minutes": 123,
"dropoff_onsite_minutes": 123,
"pickup_to_dropoff_time_minutes": 123,
"pickup_to_dropoff_distance_meters": 123,
"expected_total_loads": 123,
"loads_per_truck": 13,
"recurring_loads": True,
"material_rate_site_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"material_rate_unit_of_measure": "Load",
"material_rate_sell_price": 123,
"material_rate_buy_price": 123,
"material_rate_itemized": True,
"geofence_delay_seconds": 123,
"job_unit_of_measure": "Load",
"equipment_type_gross_capacity_unit_of_measure": "Load",
"equipment_type_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"internal_notes": "<string>",
"job_start_at": "2023-11-07T05:31:56Z",
"cycle_time_minutes": 123,
"charge_to_account": "<string>",
"chase_missing_tickets": True,
"tax_rate": 123,
"tax_freight": False,
"tax_material": False,
"tax_add_ons": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
load_at: '2023-11-07T05:31:56Z',
notes: '<string>',
order_notes: '<string>',
quantity: 123,
truck_count: 100,
truck_delay: 123,
unit_of_measure: 'Load',
load_unit_of_measure: 'Load',
equipment_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
material_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
service_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
project_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
waypoints: [
{
type: 'pickup',
site_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
contact: {name: '<string>', email: '<string>', phone: '+18885551234'},
ordinality: 123,
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
_destroy: 123
}
],
customer_rate_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
vendor_rate_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
phase: {
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
_destroy: 123,
name: '<string>',
code: '<string>',
primary: true
},
sales_contact: {
name: '<string>',
email: '<string>',
phone: '+18885551234',
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
_destroy: 123
},
foreman_contact: {
name: '<string>',
email: '<string>',
phone: '+18885551234',
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
_destroy: 123
},
foreman_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
collaborator_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
salesperson_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
supervisor_contact: {
name: '<string>',
email: '<string>',
phone: '+18885551234',
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
_destroy: 123
},
collaborator_contact: {
name: '<string>',
email: '<string>',
phone: '+18885551234',
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
_destroy: 123
},
department_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
name: '<string>',
po_job_number: '<string>',
zone: '<string>',
external_id: '<string>',
service_class_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
hauler_rate_type: 'RatePerHour',
job_notes: '<string>',
job_time: 123,
units_per_hour: 123,
job_quantity: 123,
dispatch_number: {name: '<string>', _destroy: 123},
customer_rate_value: 123,
customer_rate_type: 'RatePerHour',
vendor_rate_value: 123,
vendor_rate_type: 'RatePerHour',
trucks_per_delay: 2,
driver_rate_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
driver_rate_value: 123,
driver_rate_type: 'RatePerHour',
requester_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
phases: [
{
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
_destroy: 123,
name: '<string>',
code: '<string>',
primary: true
}
],
equipment_type_gross_capacity: 123,
pickup_onsite_minutes: 123,
dropoff_onsite_minutes: 123,
pickup_to_dropoff_time_minutes: 123,
pickup_to_dropoff_distance_meters: 123,
expected_total_loads: 123,
loads_per_truck: 13,
recurring_loads: true,
material_rate_site_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
material_rate_unit_of_measure: 'Load',
material_rate_sell_price: 123,
material_rate_buy_price: 123,
material_rate_itemized: true,
geofence_delay_seconds: 123,
job_unit_of_measure: 'Load',
equipment_type_gross_capacity_unit_of_measure: 'Load',
equipment_type_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
internal_notes: '<string>',
job_start_at: '2023-11-07T05:31:56Z',
cycle_time_minutes: 123,
charge_to_account: '<string>',
chase_missing_tickets: true,
tax_rate: 123,
tax_freight: false,
tax_material: false,
tax_add_ons: false
})
};
fetch('https://api.tread-horizon.com/v1/orders/{id}', 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://api.tread-horizon.com/v1/orders/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'load_at' => '2023-11-07T05:31:56Z',
'notes' => '<string>',
'order_notes' => '<string>',
'quantity' => 123,
'truck_count' => 100,
'truck_delay' => 123,
'unit_of_measure' => 'Load',
'load_unit_of_measure' => 'Load',
'equipment_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'material_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'service_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'project_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'waypoints' => [
[
'type' => 'pickup',
'site_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'contact' => [
'name' => '<string>',
'email' => '<string>',
'phone' => '+18885551234'
],
'ordinality' => 123,
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'_destroy' => 123
]
],
'customer_rate_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'vendor_rate_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'phase' => [
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'_destroy' => 123,
'name' => '<string>',
'code' => '<string>',
'primary' => true
],
'sales_contact' => [
'name' => '<string>',
'email' => '<string>',
'phone' => '+18885551234',
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'_destroy' => 123
],
'foreman_contact' => [
'name' => '<string>',
'email' => '<string>',
'phone' => '+18885551234',
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'_destroy' => 123
],
'foreman_ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'collaborator_ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'salesperson_ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'supervisor_contact' => [
'name' => '<string>',
'email' => '<string>',
'phone' => '+18885551234',
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'_destroy' => 123
],
'collaborator_contact' => [
'name' => '<string>',
'email' => '<string>',
'phone' => '+18885551234',
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'_destroy' => 123
],
'department_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'name' => '<string>',
'po_job_number' => '<string>',
'zone' => '<string>',
'external_id' => '<string>',
'service_class_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'hauler_rate_type' => 'RatePerHour',
'job_notes' => '<string>',
'job_time' => 123,
'units_per_hour' => 123,
'job_quantity' => 123,
'dispatch_number' => [
'name' => '<string>',
'_destroy' => 123
],
'customer_rate_value' => 123,
'customer_rate_type' => 'RatePerHour',
'vendor_rate_value' => 123,
'vendor_rate_type' => 'RatePerHour',
'trucks_per_delay' => 2,
'driver_rate_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'driver_rate_value' => 123,
'driver_rate_type' => 'RatePerHour',
'requester_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'phases' => [
[
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'_destroy' => 123,
'name' => '<string>',
'code' => '<string>',
'primary' => true
]
],
'equipment_type_gross_capacity' => 123,
'pickup_onsite_minutes' => 123,
'dropoff_onsite_minutes' => 123,
'pickup_to_dropoff_time_minutes' => 123,
'pickup_to_dropoff_distance_meters' => 123,
'expected_total_loads' => 123,
'loads_per_truck' => 13,
'recurring_loads' => true,
'material_rate_site_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'material_rate_unit_of_measure' => 'Load',
'material_rate_sell_price' => 123,
'material_rate_buy_price' => 123,
'material_rate_itemized' => true,
'geofence_delay_seconds' => 123,
'job_unit_of_measure' => 'Load',
'equipment_type_gross_capacity_unit_of_measure' => 'Load',
'equipment_type_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'internal_notes' => '<string>',
'job_start_at' => '2023-11-07T05:31:56Z',
'cycle_time_minutes' => 123,
'charge_to_account' => '<string>',
'chase_missing_tickets' => true,
'tax_rate' => 123,
'tax_freight' => false,
'tax_material' => false,
'tax_add_ons' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.tread-horizon.com/v1/orders/{id}"
payload := strings.NewReader("{\n \"load_at\": \"2023-11-07T05:31:56Z\",\n \"notes\": \"<string>\",\n \"order_notes\": \"<string>\",\n \"quantity\": 123,\n \"truck_count\": 100,\n \"truck_delay\": 123,\n \"unit_of_measure\": \"Load\",\n \"load_unit_of_measure\": \"Load\",\n \"equipment_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"material_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"service_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"project_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"waypoints\": [\n {\n \"type\": \"pickup\",\n \"site_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"contact\": {\n \"name\": \"<string>\",\n \"email\": \"<string>\",\n \"phone\": \"+18885551234\"\n },\n \"ordinality\": 123,\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"_destroy\": 123\n }\n ],\n \"customer_rate_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"vendor_rate_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"phase\": {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"_destroy\": 123,\n \"name\": \"<string>\",\n \"code\": \"<string>\",\n \"primary\": true\n },\n \"sales_contact\": {\n \"name\": \"<string>\",\n \"email\": \"<string>\",\n \"phone\": \"+18885551234\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"_destroy\": 123\n },\n \"foreman_contact\": {\n \"name\": \"<string>\",\n \"email\": \"<string>\",\n \"phone\": \"+18885551234\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"_destroy\": 123\n },\n \"foreman_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"collaborator_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"salesperson_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"supervisor_contact\": {\n \"name\": \"<string>\",\n \"email\": \"<string>\",\n \"phone\": \"+18885551234\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"_destroy\": 123\n },\n \"collaborator_contact\": {\n \"name\": \"<string>\",\n \"email\": \"<string>\",\n \"phone\": \"+18885551234\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"_destroy\": 123\n },\n \"department_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"po_job_number\": \"<string>\",\n \"zone\": \"<string>\",\n \"external_id\": \"<string>\",\n \"service_class_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"hauler_rate_type\": \"RatePerHour\",\n \"job_notes\": \"<string>\",\n \"job_time\": 123,\n \"units_per_hour\": 123,\n \"job_quantity\": 123,\n \"dispatch_number\": {\n \"name\": \"<string>\",\n \"_destroy\": 123\n },\n \"customer_rate_value\": 123,\n \"customer_rate_type\": \"RatePerHour\",\n \"vendor_rate_value\": 123,\n \"vendor_rate_type\": \"RatePerHour\",\n \"trucks_per_delay\": 2,\n \"driver_rate_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"driver_rate_value\": 123,\n \"driver_rate_type\": \"RatePerHour\",\n \"requester_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"phases\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"_destroy\": 123,\n \"name\": \"<string>\",\n \"code\": \"<string>\",\n \"primary\": true\n }\n ],\n \"equipment_type_gross_capacity\": 123,\n \"pickup_onsite_minutes\": 123,\n \"dropoff_onsite_minutes\": 123,\n \"pickup_to_dropoff_time_minutes\": 123,\n \"pickup_to_dropoff_distance_meters\": 123,\n \"expected_total_loads\": 123,\n \"loads_per_truck\": 13,\n \"recurring_loads\": true,\n \"material_rate_site_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"material_rate_unit_of_measure\": \"Load\",\n \"material_rate_sell_price\": 123,\n \"material_rate_buy_price\": 123,\n \"material_rate_itemized\": true,\n \"geofence_delay_seconds\": 123,\n \"job_unit_of_measure\": \"Load\",\n \"equipment_type_gross_capacity_unit_of_measure\": \"Load\",\n \"equipment_type_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"internal_notes\": \"<string>\",\n \"job_start_at\": \"2023-11-07T05:31:56Z\",\n \"cycle_time_minutes\": 123,\n \"charge_to_account\": \"<string>\",\n \"chase_missing_tickets\": true,\n \"tax_rate\": 123,\n \"tax_freight\": false,\n \"tax_material\": false,\n \"tax_add_ons\": false\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.tread-horizon.com/v1/orders/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"load_at\": \"2023-11-07T05:31:56Z\",\n \"notes\": \"<string>\",\n \"order_notes\": \"<string>\",\n \"quantity\": 123,\n \"truck_count\": 100,\n \"truck_delay\": 123,\n \"unit_of_measure\": \"Load\",\n \"load_unit_of_measure\": \"Load\",\n \"equipment_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"material_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"service_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"project_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"waypoints\": [\n {\n \"type\": \"pickup\",\n \"site_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"contact\": {\n \"name\": \"<string>\",\n \"email\": \"<string>\",\n \"phone\": \"+18885551234\"\n },\n \"ordinality\": 123,\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"_destroy\": 123\n }\n ],\n \"customer_rate_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"vendor_rate_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"phase\": {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"_destroy\": 123,\n \"name\": \"<string>\",\n \"code\": \"<string>\",\n \"primary\": true\n },\n \"sales_contact\": {\n \"name\": \"<string>\",\n \"email\": \"<string>\",\n \"phone\": \"+18885551234\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"_destroy\": 123\n },\n \"foreman_contact\": {\n \"name\": \"<string>\",\n \"email\": \"<string>\",\n \"phone\": \"+18885551234\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"_destroy\": 123\n },\n \"foreman_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"collaborator_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"salesperson_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"supervisor_contact\": {\n \"name\": \"<string>\",\n \"email\": \"<string>\",\n \"phone\": \"+18885551234\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"_destroy\": 123\n },\n \"collaborator_contact\": {\n \"name\": \"<string>\",\n \"email\": \"<string>\",\n \"phone\": \"+18885551234\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"_destroy\": 123\n },\n \"department_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"po_job_number\": \"<string>\",\n \"zone\": \"<string>\",\n \"external_id\": \"<string>\",\n \"service_class_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"hauler_rate_type\": \"RatePerHour\",\n \"job_notes\": \"<string>\",\n \"job_time\": 123,\n \"units_per_hour\": 123,\n \"job_quantity\": 123,\n \"dispatch_number\": {\n \"name\": \"<string>\",\n \"_destroy\": 123\n },\n \"customer_rate_value\": 123,\n \"customer_rate_type\": \"RatePerHour\",\n \"vendor_rate_value\": 123,\n \"vendor_rate_type\": \"RatePerHour\",\n \"trucks_per_delay\": 2,\n \"driver_rate_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"driver_rate_value\": 123,\n \"driver_rate_type\": \"RatePerHour\",\n \"requester_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"phases\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"_destroy\": 123,\n \"name\": \"<string>\",\n \"code\": \"<string>\",\n \"primary\": true\n }\n ],\n \"equipment_type_gross_capacity\": 123,\n \"pickup_onsite_minutes\": 123,\n \"dropoff_onsite_minutes\": 123,\n \"pickup_to_dropoff_time_minutes\": 123,\n \"pickup_to_dropoff_distance_meters\": 123,\n \"expected_total_loads\": 123,\n \"loads_per_truck\": 13,\n \"recurring_loads\": true,\n \"material_rate_site_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"material_rate_unit_of_measure\": \"Load\",\n \"material_rate_sell_price\": 123,\n \"material_rate_buy_price\": 123,\n \"material_rate_itemized\": true,\n \"geofence_delay_seconds\": 123,\n \"job_unit_of_measure\": \"Load\",\n \"equipment_type_gross_capacity_unit_of_measure\": \"Load\",\n \"equipment_type_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"internal_notes\": \"<string>\",\n \"job_start_at\": \"2023-11-07T05:31:56Z\",\n \"cycle_time_minutes\": 123,\n \"charge_to_account\": \"<string>\",\n \"chase_missing_tickets\": true,\n \"tax_rate\": 123,\n \"tax_freight\": false,\n \"tax_material\": false,\n \"tax_add_ons\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tread-horizon.com/v1/orders/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"load_at\": \"2023-11-07T05:31:56Z\",\n \"notes\": \"<string>\",\n \"order_notes\": \"<string>\",\n \"quantity\": 123,\n \"truck_count\": 100,\n \"truck_delay\": 123,\n \"unit_of_measure\": \"Load\",\n \"load_unit_of_measure\": \"Load\",\n \"equipment_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"material_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"service_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"project_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"waypoints\": [\n {\n \"type\": \"pickup\",\n \"site_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"contact\": {\n \"name\": \"<string>\",\n \"email\": \"<string>\",\n \"phone\": \"+18885551234\"\n },\n \"ordinality\": 123,\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"_destroy\": 123\n }\n ],\n \"customer_rate_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"vendor_rate_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"phase\": {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"_destroy\": 123,\n \"name\": \"<string>\",\n \"code\": \"<string>\",\n \"primary\": true\n },\n \"sales_contact\": {\n \"name\": \"<string>\",\n \"email\": \"<string>\",\n \"phone\": \"+18885551234\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"_destroy\": 123\n },\n \"foreman_contact\": {\n \"name\": \"<string>\",\n \"email\": \"<string>\",\n \"phone\": \"+18885551234\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"_destroy\": 123\n },\n \"foreman_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"collaborator_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"salesperson_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"supervisor_contact\": {\n \"name\": \"<string>\",\n \"email\": \"<string>\",\n \"phone\": \"+18885551234\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"_destroy\": 123\n },\n \"collaborator_contact\": {\n \"name\": \"<string>\",\n \"email\": \"<string>\",\n \"phone\": \"+18885551234\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"_destroy\": 123\n },\n \"department_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"po_job_number\": \"<string>\",\n \"zone\": \"<string>\",\n \"external_id\": \"<string>\",\n \"service_class_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"hauler_rate_type\": \"RatePerHour\",\n \"job_notes\": \"<string>\",\n \"job_time\": 123,\n \"units_per_hour\": 123,\n \"job_quantity\": 123,\n \"dispatch_number\": {\n \"name\": \"<string>\",\n \"_destroy\": 123\n },\n \"customer_rate_value\": 123,\n \"customer_rate_type\": \"RatePerHour\",\n \"vendor_rate_value\": 123,\n \"vendor_rate_type\": \"RatePerHour\",\n \"trucks_per_delay\": 2,\n \"driver_rate_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"driver_rate_value\": 123,\n \"driver_rate_type\": \"RatePerHour\",\n \"requester_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"phases\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"_destroy\": 123,\n \"name\": \"<string>\",\n \"code\": \"<string>\",\n \"primary\": true\n }\n ],\n \"equipment_type_gross_capacity\": 123,\n \"pickup_onsite_minutes\": 123,\n \"dropoff_onsite_minutes\": 123,\n \"pickup_to_dropoff_time_minutes\": 123,\n \"pickup_to_dropoff_distance_meters\": 123,\n \"expected_total_loads\": 123,\n \"loads_per_truck\": 13,\n \"recurring_loads\": true,\n \"material_rate_site_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"material_rate_unit_of_measure\": \"Load\",\n \"material_rate_sell_price\": 123,\n \"material_rate_buy_price\": 123,\n \"material_rate_itemized\": true,\n \"geofence_delay_seconds\": 123,\n \"job_unit_of_measure\": \"Load\",\n \"equipment_type_gross_capacity_unit_of_measure\": \"Load\",\n \"equipment_type_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"internal_notes\": \"<string>\",\n \"job_start_at\": \"2023-11-07T05:31:56Z\",\n \"cycle_time_minutes\": 123,\n \"charge_to_account\": \"<string>\",\n \"chase_missing_tickets\": true,\n \"tax_rate\": 123,\n \"tax_freight\": false,\n \"tax_material\": false,\n \"tax_add_ons\": false\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"account": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"discarded_at": "2023-11-07T05:31:56Z",
"name": "<string>",
"account_types": [
"customer"
],
"external_id": "<string>",
"accounting_id": "<string>",
"company": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"schedule_on": true,
"billing_address": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"thoroughfare": "<string>",
"premise": "<string>",
"locality": "<string>",
"administrative_area": "<string>",
"postal_code": "<string>",
"country": "US",
"lat": "<string>",
"lon": "<string>",
"place_id": "<string>"
},
"connected_company": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tread_id": "ABC123",
"legal_name": "<string>",
"company_type": "hauler"
},
"billing_contact": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"email": "<string>",
"phone": "+18885551234"
}
},
"job_time": 123,
"equipment_type": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"system": true,
"external_id": "<string>",
"accounting_id": "<string>"
},
"name": "<string>",
"po_job_number": "<string>",
"zone": "<string>",
"notes": "<string>",
"charge_to_account": "<string>",
"state": "created",
"editable": true,
"geofence_delay_seconds": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"load_at": "2023-11-07T05:31:56Z",
"truck_count": 123,
"truck_delay": 123,
"unit_of_measure": "Load",
"load_unit_of_measure": "Load",
"service": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"quantity": "<string>",
"waypoints": [
{
"type": "pickup",
"ordinality": 123,
"site": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"lat": "<string>",
"lon": "<string>",
"full_address": "<string>",
"routable": true,
"discarded_at": "2023-11-07T05:31:56Z",
"address": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"thoroughfare": "<string>",
"premise": "<string>",
"locality": "<string>",
"administrative_area": "<string>",
"postal_code": "<string>",
"country": "US",
"lat": "<string>",
"lon": "<string>",
"place_id": "<string>"
},
"next_billion_geofence": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"geofence": {
"name": "<string>",
"type": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"geojson": {
"type": "<string>",
"coordinates": [
[
[
"<unknown>"
]
]
]
},
"circle_center": {
"lat": 123,
"lon": 123
},
"circle_radius": 123
},
"moving_geofence": false
}
},
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"contact": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"email": "<string>",
"phone": "+18885551234"
}
}
],
"company": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tread_id": "ABC123",
"legal_name": "<string>",
"company_type": "hauler"
},
"copyable": true,
"load_cycle_avg": 123,
"action_required": true,
"foremen": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"first_name": "<string>",
"last_name": "<string>",
"phone": "<string>",
"email": "<string>",
"company": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tread_id": "ABC123",
"legal_name": "<string>",
"company_type": "hauler"
},
"discarded_at": "2023-11-07T05:31:56Z",
"company_share": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"external_id": "<string>",
"ticket_match_id": "<string>",
"sender_company": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tread_id": "ABC123",
"legal_name": "<string>",
"company_type": "hauler"
},
"dispatchable": true,
"schedule_on": true,
"rate_override": true,
"expires_at": "2023-11-07T05:31:56Z"
}
}
],
"collaborators": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"first_name": "<string>",
"last_name": "<string>",
"discarded_at": "2023-11-07T05:31:56Z",
"email": "<string>",
"phone": "<string>",
"external_id": "<string>",
"schedule_on": true
}
],
"salespeople": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"first_name": "<string>",
"last_name": "<string>",
"discarded_at": "2023-11-07T05:31:56Z",
"email": "<string>",
"phone": "<string>",
"external_id": "<string>",
"schedule_on": true
}
],
"external_id": "<string>",
"hauler_rate_type": "RatePerHour",
"job_notes": "<string>",
"units_per_hour": 123,
"job_quantity": "<string>",
"sending_accounts": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"discarded_at": "2023-11-07T05:31:56Z",
"name": "<string>",
"account_types": [
"customer"
],
"external_id": "<string>",
"accounting_id": "<string>",
"company": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"schedule_on": true,
"billing_address": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"thoroughfare": "<string>",
"premise": "<string>",
"locality": "<string>",
"administrative_area": "<string>",
"postal_code": "<string>",
"country": "US",
"lat": "<string>",
"lon": "<string>",
"place_id": "<string>"
},
"connected_company": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tread_id": "ABC123",
"legal_name": "<string>",
"company_type": "hauler"
},
"billing_contact": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"email": "<string>",
"phone": "+18885551234"
}
}
],
"job_start_at": "2023-11-07T05:31:56Z",
"trucks_per_delay": 123,
"loads_pickup_time_minutes_avg": 123,
"loads_dropoff_time_minutes_avg": 123,
"phases": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"code": "<string>",
"primary": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
],
"equipment_type_gross_capacity": "<string>",
"pickup_onsite_minutes": 123,
"dropoff_onsite_minutes": 123,
"pickup_to_dropoff_time_minutes": 123,
"pickup_to_dropoff_distance_meters": "<string>",
"expected_total_loads": 123,
"cycle_time_minutes": 123,
"loads_per_truck": 123,
"state_events": [],
"recurring_loads": true,
"material_rate_unit_of_measure": "Load",
"material_rate_sell_price": "<string>",
"material_rate_buy_price": "<string>",
"material_rate_itemized": true,
"order_id": "<string>",
"dispatch_number": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"default_digital_ticket_view": false,
"project": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"external_id": "<string>",
"po_job_number": "<string>",
"internal_notes": "<string>",
"job_notes": "<string>",
"notes": "<string>",
"order_notes": "<string>"
},
"material": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"external_id": "<string>"
},
"equipment": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"equipment_type": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"system": true,
"external_id": "<string>",
"accounting_id": "<string>"
},
"external_id": "<string>",
"equipment_id": "<string>",
"license_number": "<string>",
"zone": "<string>",
"accounting_id": "<string>",
"company_share": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"external_id": "<string>",
"ticket_match_id": "<string>",
"sender_company": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tread_id": "ABC123",
"legal_name": "<string>",
"company_type": "hauler"
},
"dispatchable": true,
"schedule_on": true,
"rate_override": true,
"expires_at": "2023-11-07T05:31:56Z"
}
},
"customer_rate": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"type": "RatePerHour",
"time_rate": 123
},
"vendor_rate": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"type": "RatePerHour",
"time_rate": 123
},
"phase": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"code": "<string>",
"primary": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
},
"sales_contact": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"email": "<string>",
"phone": "+18885551234"
},
"foreman_contact": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"email": "<string>",
"phone": "+18885551234"
},
"supervisor_contact": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"email": "<string>",
"phone": "+18885551234"
},
"collaborator_contact": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"email": "<string>",
"phone": "+18885551234"
},
"department": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"service_class": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"customer_rate_value": "<string>",
"customer_rate_type": "RatePerHour",
"vendor_rate_value": "<string>",
"vendor_rate_type": "RatePerHour",
"driver_rate": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"type": "RatePerHour",
"time_rate": 123
},
"driver_rate_value": "<string>",
"driver_rate_type": "RatePerHour",
"requester": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"first_name": "<string>",
"last_name": "<string>",
"discarded_at": "2023-11-07T05:31:56Z",
"email": "<string>",
"phone": "<string>",
"external_id": "<string>",
"schedule_on": true
},
"order_summary": {
"accepted_jobs_count": 123,
"assigned_jobs_count": 123,
"delivered_loads_count": 123,
"jobs_count": 123,
"loads_count": 123,
"sent_jobs_count": 123,
"started_jobs_count": 123,
"file_attachments_count": 123,
"delivered_quantities": [
{
"delivered": "<string>",
"unit_of_measure": "Load",
"material_name": "<string>",
"total": "<string>",
"ticketed": true
}
],
"actionable_jobs_count": 123,
"approved_loads_count": 123,
"approved_payables": 1,
"total_payables": 1,
"approved_receivables": 1,
"total_receivables": 1,
"calculated_loads_count": 123,
"material_gross_delivered_quantity": "<string>",
"material_gross_ticketed_delivered_quantity": "<string>",
"material_gross_unit_of_measure": "Load",
"material_gross_requested_quantity": "<string>",
"total_tickets_count": 123,
"total_tickets_quantity": "<string>",
"first_load_unloaded_at": "2023-11-07T05:31:56Z",
"first_ticket_at": "2023-11-07T05:31:56Z",
"travelled_distance_meters": "<string>",
"estimated_delivered_quantity": "<string>",
"estimated_delivered_unit_of_measure": "Load"
},
"material_rate_site": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"lat": "<string>",
"lon": "<string>",
"full_address": "<string>",
"routable": true,
"discarded_at": "2023-11-07T05:31:56Z",
"address": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"thoroughfare": "<string>",
"premise": "<string>",
"locality": "<string>",
"administrative_area": "<string>",
"postal_code": "<string>",
"country": "US",
"lat": "<string>",
"lon": "<string>",
"place_id": "<string>"
},
"next_billion_geofence": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"geofence": {
"name": "<string>",
"type": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"geojson": {
"type": "<string>",
"coordinates": [
[
[
"<unknown>"
]
]
]
},
"circle_center": {
"lat": 123,
"lon": 123
},
"circle_radius": 123
},
"moving_geofence": false
}
},
"reject_reason": "<string>",
"rejected_by": "<string>",
"rejected_at": "2023-11-07T05:31:56Z",
"equipment_type_gross_capacity_unit_of_measure": "Load",
"tax_rate": "<string>",
"tax_freight": false,
"tax_material": false,
"tax_add_ons": false
}
}{
"error": {
"code": "<string>"
}
}{
"error": {
"code": "<string>",
"error_type": "<string>"
}
}{
"error": {
"code": "<string>"
}
}{
"error": {
"code": "<string>"
}
}{
"error": {
"code": "<string>"
}
}{
"error": {
"code": "<string>"
}
}{
"error": {
"code": "<string>",
"errors": [
{
"model": "<string>",
"field": "<string>",
"message": "<string>"
}
]
}
}Update an Order
Update Order by ID
This endpoint requires the edit_order permission or the edit_order_pre_accept permission, which only allows editing if the Order is in created, pending_request or rejected state
curl --request PATCH \
--url https://api.tread-horizon.com/v1/orders/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"load_at": "2023-11-07T05:31:56Z",
"notes": "<string>",
"order_notes": "<string>",
"quantity": 123,
"truck_count": 100,
"truck_delay": 123,
"unit_of_measure": "Load",
"load_unit_of_measure": "Load",
"equipment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"material_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"service_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"waypoints": [
{
"type": "pickup",
"site_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"contact": {
"name": "<string>",
"email": "<string>",
"phone": "+18885551234"
},
"ordinality": 123,
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"_destroy": 123
}
],
"customer_rate_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"vendor_rate_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"phase": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"_destroy": 123,
"name": "<string>",
"code": "<string>",
"primary": true
},
"sales_contact": {
"name": "<string>",
"email": "<string>",
"phone": "+18885551234",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"_destroy": 123
},
"foreman_contact": {
"name": "<string>",
"email": "<string>",
"phone": "+18885551234",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"_destroy": 123
},
"foreman_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"collaborator_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"salesperson_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"supervisor_contact": {
"name": "<string>",
"email": "<string>",
"phone": "+18885551234",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"_destroy": 123
},
"collaborator_contact": {
"name": "<string>",
"email": "<string>",
"phone": "+18885551234",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"_destroy": 123
},
"department_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"po_job_number": "<string>",
"zone": "<string>",
"external_id": "<string>",
"service_class_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"hauler_rate_type": "RatePerHour",
"job_notes": "<string>",
"job_time": 123,
"units_per_hour": 123,
"job_quantity": 123,
"dispatch_number": {
"name": "<string>",
"_destroy": 123
},
"customer_rate_value": 123,
"customer_rate_type": "RatePerHour",
"vendor_rate_value": 123,
"vendor_rate_type": "RatePerHour",
"trucks_per_delay": 2,
"driver_rate_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"driver_rate_value": 123,
"driver_rate_type": "RatePerHour",
"requester_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"phases": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"_destroy": 123,
"name": "<string>",
"code": "<string>",
"primary": true
}
],
"equipment_type_gross_capacity": 123,
"pickup_onsite_minutes": 123,
"dropoff_onsite_minutes": 123,
"pickup_to_dropoff_time_minutes": 123,
"pickup_to_dropoff_distance_meters": 123,
"expected_total_loads": 123,
"loads_per_truck": 13,
"recurring_loads": true,
"material_rate_site_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"material_rate_unit_of_measure": "Load",
"material_rate_sell_price": 123,
"material_rate_buy_price": 123,
"material_rate_itemized": true,
"geofence_delay_seconds": 123,
"job_unit_of_measure": "Load",
"equipment_type_gross_capacity_unit_of_measure": "Load",
"equipment_type_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"internal_notes": "<string>",
"job_start_at": "2023-11-07T05:31:56Z",
"cycle_time_minutes": 123,
"charge_to_account": "<string>",
"chase_missing_tickets": true,
"tax_rate": 123,
"tax_freight": false,
"tax_material": false,
"tax_add_ons": false
}
'import requests
url = "https://api.tread-horizon.com/v1/orders/{id}"
payload = {
"load_at": "2023-11-07T05:31:56Z",
"notes": "<string>",
"order_notes": "<string>",
"quantity": 123,
"truck_count": 100,
"truck_delay": 123,
"unit_of_measure": "Load",
"load_unit_of_measure": "Load",
"equipment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"material_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"service_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"waypoints": [
{
"type": "pickup",
"site_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"contact": {
"name": "<string>",
"email": "<string>",
"phone": "+18885551234"
},
"ordinality": 123,
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"_destroy": 123
}
],
"customer_rate_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"vendor_rate_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"phase": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"_destroy": 123,
"name": "<string>",
"code": "<string>",
"primary": True
},
"sales_contact": {
"name": "<string>",
"email": "<string>",
"phone": "+18885551234",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"_destroy": 123
},
"foreman_contact": {
"name": "<string>",
"email": "<string>",
"phone": "+18885551234",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"_destroy": 123
},
"foreman_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"collaborator_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"salesperson_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"supervisor_contact": {
"name": "<string>",
"email": "<string>",
"phone": "+18885551234",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"_destroy": 123
},
"collaborator_contact": {
"name": "<string>",
"email": "<string>",
"phone": "+18885551234",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"_destroy": 123
},
"department_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"po_job_number": "<string>",
"zone": "<string>",
"external_id": "<string>",
"service_class_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"hauler_rate_type": "RatePerHour",
"job_notes": "<string>",
"job_time": 123,
"units_per_hour": 123,
"job_quantity": 123,
"dispatch_number": {
"name": "<string>",
"_destroy": 123
},
"customer_rate_value": 123,
"customer_rate_type": "RatePerHour",
"vendor_rate_value": 123,
"vendor_rate_type": "RatePerHour",
"trucks_per_delay": 2,
"driver_rate_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"driver_rate_value": 123,
"driver_rate_type": "RatePerHour",
"requester_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"phases": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"_destroy": 123,
"name": "<string>",
"code": "<string>",
"primary": True
}
],
"equipment_type_gross_capacity": 123,
"pickup_onsite_minutes": 123,
"dropoff_onsite_minutes": 123,
"pickup_to_dropoff_time_minutes": 123,
"pickup_to_dropoff_distance_meters": 123,
"expected_total_loads": 123,
"loads_per_truck": 13,
"recurring_loads": True,
"material_rate_site_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"material_rate_unit_of_measure": "Load",
"material_rate_sell_price": 123,
"material_rate_buy_price": 123,
"material_rate_itemized": True,
"geofence_delay_seconds": 123,
"job_unit_of_measure": "Load",
"equipment_type_gross_capacity_unit_of_measure": "Load",
"equipment_type_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"internal_notes": "<string>",
"job_start_at": "2023-11-07T05:31:56Z",
"cycle_time_minutes": 123,
"charge_to_account": "<string>",
"chase_missing_tickets": True,
"tax_rate": 123,
"tax_freight": False,
"tax_material": False,
"tax_add_ons": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
load_at: '2023-11-07T05:31:56Z',
notes: '<string>',
order_notes: '<string>',
quantity: 123,
truck_count: 100,
truck_delay: 123,
unit_of_measure: 'Load',
load_unit_of_measure: 'Load',
equipment_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
material_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
service_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
project_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
waypoints: [
{
type: 'pickup',
site_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
contact: {name: '<string>', email: '<string>', phone: '+18885551234'},
ordinality: 123,
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
_destroy: 123
}
],
customer_rate_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
vendor_rate_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
phase: {
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
_destroy: 123,
name: '<string>',
code: '<string>',
primary: true
},
sales_contact: {
name: '<string>',
email: '<string>',
phone: '+18885551234',
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
_destroy: 123
},
foreman_contact: {
name: '<string>',
email: '<string>',
phone: '+18885551234',
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
_destroy: 123
},
foreman_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
collaborator_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
salesperson_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
supervisor_contact: {
name: '<string>',
email: '<string>',
phone: '+18885551234',
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
_destroy: 123
},
collaborator_contact: {
name: '<string>',
email: '<string>',
phone: '+18885551234',
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
_destroy: 123
},
department_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
name: '<string>',
po_job_number: '<string>',
zone: '<string>',
external_id: '<string>',
service_class_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
hauler_rate_type: 'RatePerHour',
job_notes: '<string>',
job_time: 123,
units_per_hour: 123,
job_quantity: 123,
dispatch_number: {name: '<string>', _destroy: 123},
customer_rate_value: 123,
customer_rate_type: 'RatePerHour',
vendor_rate_value: 123,
vendor_rate_type: 'RatePerHour',
trucks_per_delay: 2,
driver_rate_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
driver_rate_value: 123,
driver_rate_type: 'RatePerHour',
requester_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
phases: [
{
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
_destroy: 123,
name: '<string>',
code: '<string>',
primary: true
}
],
equipment_type_gross_capacity: 123,
pickup_onsite_minutes: 123,
dropoff_onsite_minutes: 123,
pickup_to_dropoff_time_minutes: 123,
pickup_to_dropoff_distance_meters: 123,
expected_total_loads: 123,
loads_per_truck: 13,
recurring_loads: true,
material_rate_site_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
material_rate_unit_of_measure: 'Load',
material_rate_sell_price: 123,
material_rate_buy_price: 123,
material_rate_itemized: true,
geofence_delay_seconds: 123,
job_unit_of_measure: 'Load',
equipment_type_gross_capacity_unit_of_measure: 'Load',
equipment_type_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
internal_notes: '<string>',
job_start_at: '2023-11-07T05:31:56Z',
cycle_time_minutes: 123,
charge_to_account: '<string>',
chase_missing_tickets: true,
tax_rate: 123,
tax_freight: false,
tax_material: false,
tax_add_ons: false
})
};
fetch('https://api.tread-horizon.com/v1/orders/{id}', 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://api.tread-horizon.com/v1/orders/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'load_at' => '2023-11-07T05:31:56Z',
'notes' => '<string>',
'order_notes' => '<string>',
'quantity' => 123,
'truck_count' => 100,
'truck_delay' => 123,
'unit_of_measure' => 'Load',
'load_unit_of_measure' => 'Load',
'equipment_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'material_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'service_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'project_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'waypoints' => [
[
'type' => 'pickup',
'site_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'contact' => [
'name' => '<string>',
'email' => '<string>',
'phone' => '+18885551234'
],
'ordinality' => 123,
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'_destroy' => 123
]
],
'customer_rate_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'vendor_rate_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'phase' => [
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'_destroy' => 123,
'name' => '<string>',
'code' => '<string>',
'primary' => true
],
'sales_contact' => [
'name' => '<string>',
'email' => '<string>',
'phone' => '+18885551234',
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'_destroy' => 123
],
'foreman_contact' => [
'name' => '<string>',
'email' => '<string>',
'phone' => '+18885551234',
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'_destroy' => 123
],
'foreman_ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'collaborator_ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'salesperson_ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'supervisor_contact' => [
'name' => '<string>',
'email' => '<string>',
'phone' => '+18885551234',
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'_destroy' => 123
],
'collaborator_contact' => [
'name' => '<string>',
'email' => '<string>',
'phone' => '+18885551234',
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'_destroy' => 123
],
'department_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'name' => '<string>',
'po_job_number' => '<string>',
'zone' => '<string>',
'external_id' => '<string>',
'service_class_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'hauler_rate_type' => 'RatePerHour',
'job_notes' => '<string>',
'job_time' => 123,
'units_per_hour' => 123,
'job_quantity' => 123,
'dispatch_number' => [
'name' => '<string>',
'_destroy' => 123
],
'customer_rate_value' => 123,
'customer_rate_type' => 'RatePerHour',
'vendor_rate_value' => 123,
'vendor_rate_type' => 'RatePerHour',
'trucks_per_delay' => 2,
'driver_rate_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'driver_rate_value' => 123,
'driver_rate_type' => 'RatePerHour',
'requester_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'phases' => [
[
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'_destroy' => 123,
'name' => '<string>',
'code' => '<string>',
'primary' => true
]
],
'equipment_type_gross_capacity' => 123,
'pickup_onsite_minutes' => 123,
'dropoff_onsite_minutes' => 123,
'pickup_to_dropoff_time_minutes' => 123,
'pickup_to_dropoff_distance_meters' => 123,
'expected_total_loads' => 123,
'loads_per_truck' => 13,
'recurring_loads' => true,
'material_rate_site_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'material_rate_unit_of_measure' => 'Load',
'material_rate_sell_price' => 123,
'material_rate_buy_price' => 123,
'material_rate_itemized' => true,
'geofence_delay_seconds' => 123,
'job_unit_of_measure' => 'Load',
'equipment_type_gross_capacity_unit_of_measure' => 'Load',
'equipment_type_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'internal_notes' => '<string>',
'job_start_at' => '2023-11-07T05:31:56Z',
'cycle_time_minutes' => 123,
'charge_to_account' => '<string>',
'chase_missing_tickets' => true,
'tax_rate' => 123,
'tax_freight' => false,
'tax_material' => false,
'tax_add_ons' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.tread-horizon.com/v1/orders/{id}"
payload := strings.NewReader("{\n \"load_at\": \"2023-11-07T05:31:56Z\",\n \"notes\": \"<string>\",\n \"order_notes\": \"<string>\",\n \"quantity\": 123,\n \"truck_count\": 100,\n \"truck_delay\": 123,\n \"unit_of_measure\": \"Load\",\n \"load_unit_of_measure\": \"Load\",\n \"equipment_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"material_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"service_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"project_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"waypoints\": [\n {\n \"type\": \"pickup\",\n \"site_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"contact\": {\n \"name\": \"<string>\",\n \"email\": \"<string>\",\n \"phone\": \"+18885551234\"\n },\n \"ordinality\": 123,\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"_destroy\": 123\n }\n ],\n \"customer_rate_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"vendor_rate_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"phase\": {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"_destroy\": 123,\n \"name\": \"<string>\",\n \"code\": \"<string>\",\n \"primary\": true\n },\n \"sales_contact\": {\n \"name\": \"<string>\",\n \"email\": \"<string>\",\n \"phone\": \"+18885551234\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"_destroy\": 123\n },\n \"foreman_contact\": {\n \"name\": \"<string>\",\n \"email\": \"<string>\",\n \"phone\": \"+18885551234\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"_destroy\": 123\n },\n \"foreman_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"collaborator_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"salesperson_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"supervisor_contact\": {\n \"name\": \"<string>\",\n \"email\": \"<string>\",\n \"phone\": \"+18885551234\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"_destroy\": 123\n },\n \"collaborator_contact\": {\n \"name\": \"<string>\",\n \"email\": \"<string>\",\n \"phone\": \"+18885551234\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"_destroy\": 123\n },\n \"department_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"po_job_number\": \"<string>\",\n \"zone\": \"<string>\",\n \"external_id\": \"<string>\",\n \"service_class_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"hauler_rate_type\": \"RatePerHour\",\n \"job_notes\": \"<string>\",\n \"job_time\": 123,\n \"units_per_hour\": 123,\n \"job_quantity\": 123,\n \"dispatch_number\": {\n \"name\": \"<string>\",\n \"_destroy\": 123\n },\n \"customer_rate_value\": 123,\n \"customer_rate_type\": \"RatePerHour\",\n \"vendor_rate_value\": 123,\n \"vendor_rate_type\": \"RatePerHour\",\n \"trucks_per_delay\": 2,\n \"driver_rate_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"driver_rate_value\": 123,\n \"driver_rate_type\": \"RatePerHour\",\n \"requester_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"phases\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"_destroy\": 123,\n \"name\": \"<string>\",\n \"code\": \"<string>\",\n \"primary\": true\n }\n ],\n \"equipment_type_gross_capacity\": 123,\n \"pickup_onsite_minutes\": 123,\n \"dropoff_onsite_minutes\": 123,\n \"pickup_to_dropoff_time_minutes\": 123,\n \"pickup_to_dropoff_distance_meters\": 123,\n \"expected_total_loads\": 123,\n \"loads_per_truck\": 13,\n \"recurring_loads\": true,\n \"material_rate_site_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"material_rate_unit_of_measure\": \"Load\",\n \"material_rate_sell_price\": 123,\n \"material_rate_buy_price\": 123,\n \"material_rate_itemized\": true,\n \"geofence_delay_seconds\": 123,\n \"job_unit_of_measure\": \"Load\",\n \"equipment_type_gross_capacity_unit_of_measure\": \"Load\",\n \"equipment_type_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"internal_notes\": \"<string>\",\n \"job_start_at\": \"2023-11-07T05:31:56Z\",\n \"cycle_time_minutes\": 123,\n \"charge_to_account\": \"<string>\",\n \"chase_missing_tickets\": true,\n \"tax_rate\": 123,\n \"tax_freight\": false,\n \"tax_material\": false,\n \"tax_add_ons\": false\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.tread-horizon.com/v1/orders/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"load_at\": \"2023-11-07T05:31:56Z\",\n \"notes\": \"<string>\",\n \"order_notes\": \"<string>\",\n \"quantity\": 123,\n \"truck_count\": 100,\n \"truck_delay\": 123,\n \"unit_of_measure\": \"Load\",\n \"load_unit_of_measure\": \"Load\",\n \"equipment_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"material_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"service_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"project_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"waypoints\": [\n {\n \"type\": \"pickup\",\n \"site_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"contact\": {\n \"name\": \"<string>\",\n \"email\": \"<string>\",\n \"phone\": \"+18885551234\"\n },\n \"ordinality\": 123,\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"_destroy\": 123\n }\n ],\n \"customer_rate_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"vendor_rate_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"phase\": {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"_destroy\": 123,\n \"name\": \"<string>\",\n \"code\": \"<string>\",\n \"primary\": true\n },\n \"sales_contact\": {\n \"name\": \"<string>\",\n \"email\": \"<string>\",\n \"phone\": \"+18885551234\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"_destroy\": 123\n },\n \"foreman_contact\": {\n \"name\": \"<string>\",\n \"email\": \"<string>\",\n \"phone\": \"+18885551234\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"_destroy\": 123\n },\n \"foreman_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"collaborator_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"salesperson_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"supervisor_contact\": {\n \"name\": \"<string>\",\n \"email\": \"<string>\",\n \"phone\": \"+18885551234\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"_destroy\": 123\n },\n \"collaborator_contact\": {\n \"name\": \"<string>\",\n \"email\": \"<string>\",\n \"phone\": \"+18885551234\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"_destroy\": 123\n },\n \"department_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"po_job_number\": \"<string>\",\n \"zone\": \"<string>\",\n \"external_id\": \"<string>\",\n \"service_class_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"hauler_rate_type\": \"RatePerHour\",\n \"job_notes\": \"<string>\",\n \"job_time\": 123,\n \"units_per_hour\": 123,\n \"job_quantity\": 123,\n \"dispatch_number\": {\n \"name\": \"<string>\",\n \"_destroy\": 123\n },\n \"customer_rate_value\": 123,\n \"customer_rate_type\": \"RatePerHour\",\n \"vendor_rate_value\": 123,\n \"vendor_rate_type\": \"RatePerHour\",\n \"trucks_per_delay\": 2,\n \"driver_rate_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"driver_rate_value\": 123,\n \"driver_rate_type\": \"RatePerHour\",\n \"requester_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"phases\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"_destroy\": 123,\n \"name\": \"<string>\",\n \"code\": \"<string>\",\n \"primary\": true\n }\n ],\n \"equipment_type_gross_capacity\": 123,\n \"pickup_onsite_minutes\": 123,\n \"dropoff_onsite_minutes\": 123,\n \"pickup_to_dropoff_time_minutes\": 123,\n \"pickup_to_dropoff_distance_meters\": 123,\n \"expected_total_loads\": 123,\n \"loads_per_truck\": 13,\n \"recurring_loads\": true,\n \"material_rate_site_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"material_rate_unit_of_measure\": \"Load\",\n \"material_rate_sell_price\": 123,\n \"material_rate_buy_price\": 123,\n \"material_rate_itemized\": true,\n \"geofence_delay_seconds\": 123,\n \"job_unit_of_measure\": \"Load\",\n \"equipment_type_gross_capacity_unit_of_measure\": \"Load\",\n \"equipment_type_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"internal_notes\": \"<string>\",\n \"job_start_at\": \"2023-11-07T05:31:56Z\",\n \"cycle_time_minutes\": 123,\n \"charge_to_account\": \"<string>\",\n \"chase_missing_tickets\": true,\n \"tax_rate\": 123,\n \"tax_freight\": false,\n \"tax_material\": false,\n \"tax_add_ons\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tread-horizon.com/v1/orders/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"load_at\": \"2023-11-07T05:31:56Z\",\n \"notes\": \"<string>\",\n \"order_notes\": \"<string>\",\n \"quantity\": 123,\n \"truck_count\": 100,\n \"truck_delay\": 123,\n \"unit_of_measure\": \"Load\",\n \"load_unit_of_measure\": \"Load\",\n \"equipment_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"material_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"service_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"project_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"waypoints\": [\n {\n \"type\": \"pickup\",\n \"site_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"contact\": {\n \"name\": \"<string>\",\n \"email\": \"<string>\",\n \"phone\": \"+18885551234\"\n },\n \"ordinality\": 123,\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"_destroy\": 123\n }\n ],\n \"customer_rate_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"vendor_rate_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"phase\": {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"_destroy\": 123,\n \"name\": \"<string>\",\n \"code\": \"<string>\",\n \"primary\": true\n },\n \"sales_contact\": {\n \"name\": \"<string>\",\n \"email\": \"<string>\",\n \"phone\": \"+18885551234\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"_destroy\": 123\n },\n \"foreman_contact\": {\n \"name\": \"<string>\",\n \"email\": \"<string>\",\n \"phone\": \"+18885551234\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"_destroy\": 123\n },\n \"foreman_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"collaborator_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"salesperson_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"supervisor_contact\": {\n \"name\": \"<string>\",\n \"email\": \"<string>\",\n \"phone\": \"+18885551234\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"_destroy\": 123\n },\n \"collaborator_contact\": {\n \"name\": \"<string>\",\n \"email\": \"<string>\",\n \"phone\": \"+18885551234\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"_destroy\": 123\n },\n \"department_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"po_job_number\": \"<string>\",\n \"zone\": \"<string>\",\n \"external_id\": \"<string>\",\n \"service_class_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"hauler_rate_type\": \"RatePerHour\",\n \"job_notes\": \"<string>\",\n \"job_time\": 123,\n \"units_per_hour\": 123,\n \"job_quantity\": 123,\n \"dispatch_number\": {\n \"name\": \"<string>\",\n \"_destroy\": 123\n },\n \"customer_rate_value\": 123,\n \"customer_rate_type\": \"RatePerHour\",\n \"vendor_rate_value\": 123,\n \"vendor_rate_type\": \"RatePerHour\",\n \"trucks_per_delay\": 2,\n \"driver_rate_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"driver_rate_value\": 123,\n \"driver_rate_type\": \"RatePerHour\",\n \"requester_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"phases\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"_destroy\": 123,\n \"name\": \"<string>\",\n \"code\": \"<string>\",\n \"primary\": true\n }\n ],\n \"equipment_type_gross_capacity\": 123,\n \"pickup_onsite_minutes\": 123,\n \"dropoff_onsite_minutes\": 123,\n \"pickup_to_dropoff_time_minutes\": 123,\n \"pickup_to_dropoff_distance_meters\": 123,\n \"expected_total_loads\": 123,\n \"loads_per_truck\": 13,\n \"recurring_loads\": true,\n \"material_rate_site_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"material_rate_unit_of_measure\": \"Load\",\n \"material_rate_sell_price\": 123,\n \"material_rate_buy_price\": 123,\n \"material_rate_itemized\": true,\n \"geofence_delay_seconds\": 123,\n \"job_unit_of_measure\": \"Load\",\n \"equipment_type_gross_capacity_unit_of_measure\": \"Load\",\n \"equipment_type_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"internal_notes\": \"<string>\",\n \"job_start_at\": \"2023-11-07T05:31:56Z\",\n \"cycle_time_minutes\": 123,\n \"charge_to_account\": \"<string>\",\n \"chase_missing_tickets\": true,\n \"tax_rate\": 123,\n \"tax_freight\": false,\n \"tax_material\": false,\n \"tax_add_ons\": false\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"account": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"discarded_at": "2023-11-07T05:31:56Z",
"name": "<string>",
"account_types": [
"customer"
],
"external_id": "<string>",
"accounting_id": "<string>",
"company": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"schedule_on": true,
"billing_address": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"thoroughfare": "<string>",
"premise": "<string>",
"locality": "<string>",
"administrative_area": "<string>",
"postal_code": "<string>",
"country": "US",
"lat": "<string>",
"lon": "<string>",
"place_id": "<string>"
},
"connected_company": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tread_id": "ABC123",
"legal_name": "<string>",
"company_type": "hauler"
},
"billing_contact": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"email": "<string>",
"phone": "+18885551234"
}
},
"job_time": 123,
"equipment_type": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"system": true,
"external_id": "<string>",
"accounting_id": "<string>"
},
"name": "<string>",
"po_job_number": "<string>",
"zone": "<string>",
"notes": "<string>",
"charge_to_account": "<string>",
"state": "created",
"editable": true,
"geofence_delay_seconds": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"load_at": "2023-11-07T05:31:56Z",
"truck_count": 123,
"truck_delay": 123,
"unit_of_measure": "Load",
"load_unit_of_measure": "Load",
"service": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"quantity": "<string>",
"waypoints": [
{
"type": "pickup",
"ordinality": 123,
"site": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"lat": "<string>",
"lon": "<string>",
"full_address": "<string>",
"routable": true,
"discarded_at": "2023-11-07T05:31:56Z",
"address": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"thoroughfare": "<string>",
"premise": "<string>",
"locality": "<string>",
"administrative_area": "<string>",
"postal_code": "<string>",
"country": "US",
"lat": "<string>",
"lon": "<string>",
"place_id": "<string>"
},
"next_billion_geofence": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"geofence": {
"name": "<string>",
"type": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"geojson": {
"type": "<string>",
"coordinates": [
[
[
"<unknown>"
]
]
]
},
"circle_center": {
"lat": 123,
"lon": 123
},
"circle_radius": 123
},
"moving_geofence": false
}
},
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"contact": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"email": "<string>",
"phone": "+18885551234"
}
}
],
"company": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tread_id": "ABC123",
"legal_name": "<string>",
"company_type": "hauler"
},
"copyable": true,
"load_cycle_avg": 123,
"action_required": true,
"foremen": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"first_name": "<string>",
"last_name": "<string>",
"phone": "<string>",
"email": "<string>",
"company": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tread_id": "ABC123",
"legal_name": "<string>",
"company_type": "hauler"
},
"discarded_at": "2023-11-07T05:31:56Z",
"company_share": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"external_id": "<string>",
"ticket_match_id": "<string>",
"sender_company": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tread_id": "ABC123",
"legal_name": "<string>",
"company_type": "hauler"
},
"dispatchable": true,
"schedule_on": true,
"rate_override": true,
"expires_at": "2023-11-07T05:31:56Z"
}
}
],
"collaborators": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"first_name": "<string>",
"last_name": "<string>",
"discarded_at": "2023-11-07T05:31:56Z",
"email": "<string>",
"phone": "<string>",
"external_id": "<string>",
"schedule_on": true
}
],
"salespeople": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"first_name": "<string>",
"last_name": "<string>",
"discarded_at": "2023-11-07T05:31:56Z",
"email": "<string>",
"phone": "<string>",
"external_id": "<string>",
"schedule_on": true
}
],
"external_id": "<string>",
"hauler_rate_type": "RatePerHour",
"job_notes": "<string>",
"units_per_hour": 123,
"job_quantity": "<string>",
"sending_accounts": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"discarded_at": "2023-11-07T05:31:56Z",
"name": "<string>",
"account_types": [
"customer"
],
"external_id": "<string>",
"accounting_id": "<string>",
"company": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"schedule_on": true,
"billing_address": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"thoroughfare": "<string>",
"premise": "<string>",
"locality": "<string>",
"administrative_area": "<string>",
"postal_code": "<string>",
"country": "US",
"lat": "<string>",
"lon": "<string>",
"place_id": "<string>"
},
"connected_company": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tread_id": "ABC123",
"legal_name": "<string>",
"company_type": "hauler"
},
"billing_contact": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"email": "<string>",
"phone": "+18885551234"
}
}
],
"job_start_at": "2023-11-07T05:31:56Z",
"trucks_per_delay": 123,
"loads_pickup_time_minutes_avg": 123,
"loads_dropoff_time_minutes_avg": 123,
"phases": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"code": "<string>",
"primary": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
],
"equipment_type_gross_capacity": "<string>",
"pickup_onsite_minutes": 123,
"dropoff_onsite_minutes": 123,
"pickup_to_dropoff_time_minutes": 123,
"pickup_to_dropoff_distance_meters": "<string>",
"expected_total_loads": 123,
"cycle_time_minutes": 123,
"loads_per_truck": 123,
"state_events": [],
"recurring_loads": true,
"material_rate_unit_of_measure": "Load",
"material_rate_sell_price": "<string>",
"material_rate_buy_price": "<string>",
"material_rate_itemized": true,
"order_id": "<string>",
"dispatch_number": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"default_digital_ticket_view": false,
"project": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"external_id": "<string>",
"po_job_number": "<string>",
"internal_notes": "<string>",
"job_notes": "<string>",
"notes": "<string>",
"order_notes": "<string>"
},
"material": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"external_id": "<string>"
},
"equipment": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"equipment_type": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"system": true,
"external_id": "<string>",
"accounting_id": "<string>"
},
"external_id": "<string>",
"equipment_id": "<string>",
"license_number": "<string>",
"zone": "<string>",
"accounting_id": "<string>",
"company_share": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"external_id": "<string>",
"ticket_match_id": "<string>",
"sender_company": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tread_id": "ABC123",
"legal_name": "<string>",
"company_type": "hauler"
},
"dispatchable": true,
"schedule_on": true,
"rate_override": true,
"expires_at": "2023-11-07T05:31:56Z"
}
},
"customer_rate": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"type": "RatePerHour",
"time_rate": 123
},
"vendor_rate": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"type": "RatePerHour",
"time_rate": 123
},
"phase": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"code": "<string>",
"primary": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
},
"sales_contact": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"email": "<string>",
"phone": "+18885551234"
},
"foreman_contact": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"email": "<string>",
"phone": "+18885551234"
},
"supervisor_contact": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"email": "<string>",
"phone": "+18885551234"
},
"collaborator_contact": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"email": "<string>",
"phone": "+18885551234"
},
"department": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"service_class": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"customer_rate_value": "<string>",
"customer_rate_type": "RatePerHour",
"vendor_rate_value": "<string>",
"vendor_rate_type": "RatePerHour",
"driver_rate": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"type": "RatePerHour",
"time_rate": 123
},
"driver_rate_value": "<string>",
"driver_rate_type": "RatePerHour",
"requester": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"first_name": "<string>",
"last_name": "<string>",
"discarded_at": "2023-11-07T05:31:56Z",
"email": "<string>",
"phone": "<string>",
"external_id": "<string>",
"schedule_on": true
},
"order_summary": {
"accepted_jobs_count": 123,
"assigned_jobs_count": 123,
"delivered_loads_count": 123,
"jobs_count": 123,
"loads_count": 123,
"sent_jobs_count": 123,
"started_jobs_count": 123,
"file_attachments_count": 123,
"delivered_quantities": [
{
"delivered": "<string>",
"unit_of_measure": "Load",
"material_name": "<string>",
"total": "<string>",
"ticketed": true
}
],
"actionable_jobs_count": 123,
"approved_loads_count": 123,
"approved_payables": 1,
"total_payables": 1,
"approved_receivables": 1,
"total_receivables": 1,
"calculated_loads_count": 123,
"material_gross_delivered_quantity": "<string>",
"material_gross_ticketed_delivered_quantity": "<string>",
"material_gross_unit_of_measure": "Load",
"material_gross_requested_quantity": "<string>",
"total_tickets_count": 123,
"total_tickets_quantity": "<string>",
"first_load_unloaded_at": "2023-11-07T05:31:56Z",
"first_ticket_at": "2023-11-07T05:31:56Z",
"travelled_distance_meters": "<string>",
"estimated_delivered_quantity": "<string>",
"estimated_delivered_unit_of_measure": "Load"
},
"material_rate_site": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"lat": "<string>",
"lon": "<string>",
"full_address": "<string>",
"routable": true,
"discarded_at": "2023-11-07T05:31:56Z",
"address": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"thoroughfare": "<string>",
"premise": "<string>",
"locality": "<string>",
"administrative_area": "<string>",
"postal_code": "<string>",
"country": "US",
"lat": "<string>",
"lon": "<string>",
"place_id": "<string>"
},
"next_billion_geofence": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"geofence": {
"name": "<string>",
"type": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"geojson": {
"type": "<string>",
"coordinates": [
[
[
"<unknown>"
]
]
]
},
"circle_center": {
"lat": 123,
"lon": 123
},
"circle_radius": 123
},
"moving_geofence": false
}
},
"reject_reason": "<string>",
"rejected_by": "<string>",
"rejected_at": "2023-11-07T05:31:56Z",
"equipment_type_gross_capacity_unit_of_measure": "Load",
"tax_rate": "<string>",
"tax_freight": false,
"tax_material": false,
"tax_add_ons": false
}
}{
"error": {
"code": "<string>"
}
}{
"error": {
"code": "<string>",
"error_type": "<string>"
}
}{
"error": {
"code": "<string>"
}
}{
"error": {
"code": "<string>"
}
}{
"error": {
"code": "<string>"
}
}{
"error": {
"code": "<string>"
}
}{
"error": {
"code": "<string>",
"errors": [
{
"model": "<string>",
"field": "<string>",
"message": "<string>"
}
]
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
The Accept-Language request HTTP header indicates the natural language and locale that the client prefers.
"en"
Path Parameters
Order ID
Body
Notes:
phasehas been deprecated in favor ofphaseswhere"primary" == true- Only one associated Phase can be the primary
Load Start Date & Time.
1 <= x <= 200Load, Tonne, Ton, Yard, Meter, Foot, Liter, Hour, Bushel, Gallon, CubicMeter, Mile, Kilometer, Barrel, Bag, Pallet "Load"
Load, Tonne, Ton, Yard, Meter, Foot, Liter, Hour, Bushel, Gallon, CubicMeter, Mile, Kilometer, Barrel, Bag, Pallet "Load"
project_id can only be changed to a Project with the same account_id as the Order
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
RatePerHour, RatePerDay, RatePerLoad, RatePerTon, RatePerTonne, RatePerYard, RatePerBushel, RateCommission, RateFlatCommission, RateFlatRate "RatePerHour"
Show child attributes
Show child attributes
RatePerHour, RatePerDay, RatePerLoad, RatePerTon, RatePerTonne, RatePerYard, RatePerBushel, RateCommission, RateFlatCommission, RateFlatRate "RatePerHour"
RatePerHour, RatePerDay, RatePerLoad, RatePerTon, RatePerTonne, RatePerYard, RatePerBushel, RateCommission, RateFlatCommission, RateFlatRate "RatePerHour"
x >= 1RatePerHour, RatePerDay, RatePerLoad, RatePerTon, RatePerTonne, RatePerYard, RatePerBushel, RateCommission, RateFlatCommission, RateFlatRate "RatePerHour"
Show child attributes
Show child attributes
When a value is omitted, the system will set loads_per_truck to 1 when the job_unit_of_measure is Load else it is set to job_quantity.
1 <= x <= 25truck, load, unit Load, Tonne, Ton, Yard, Meter, Foot, Liter, Hour, Bushel, Gallon, CubicMeter, Mile, Kilometer, Barrel, Bag, Pallet "Load"
Load, Tonne, Ton, Yard, Meter, Foot, Liter, Hour, Bushel, Gallon, CubicMeter, Mile, Kilometer, Barrel, Bag, Pallet "Load"
Load, Tonne, Ton, Yard, Meter, Foot, Liter, Hour, Bushel, Gallon, CubicMeter, Mile, Kilometer, Barrel, Bag, Pallet "Load"
Enable ticket chasing for jobs in this order
Tax rate percentage (up to 4 decimal places)
Whether freight line items and FSC are taxable
Whether material line items are taxable
Whether add-on charges are taxable (dual-confirm with add_on.taxable)
Response
OK
Notes:
phasehas been deprecated in favor ofphaseswhere"primary" == true
Show child attributes
Show child attributes