curl --request POST \
--url https://{company}.datatruck.io/api/v1/openapi/orders/create/ \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"load_id": "LD-987654",
"load_pay": "5000.00",
"customer": "ABC Logistics",
"mc_number": "Armitage",
"weight": "2000kg",
"goods": "Furniture",
"rate_confirmation": "base64_encoded_string",
"stops": [
{
"company_name": "Pickup Company",
"address": "123 Pickup Street",
"zip_code": "10001",
"enter_time": "2025-02-06T08:30:00Z",
"exit_time": "2025-02-06T09:30:00Z",
"reference_id": "REF-001",
"stop_type": "pickup"
},
{
"company_name": "Delivery Company",
"address": "456 Delivery Avenue",
"zip_code": "20002",
"enter_time": "2025-02-07T14:00:00Z",
"exit_time": "2025-02-07T15:00:00Z",
"reference_id": "REF-002",
"stop_type": "delivery"
}
]
}
'import requests
url = "https://{company}.datatruck.io/api/v1/openapi/orders/create/"
payload = {
"load_id": "LD-987654",
"load_pay": "5000.00",
"customer": "ABC Logistics",
"mc_number": "Armitage",
"weight": "2000kg",
"goods": "Furniture",
"rate_confirmation": "base64_encoded_string",
"stops": [
{
"company_name": "Pickup Company",
"address": "123 Pickup Street",
"zip_code": "10001",
"enter_time": "2025-02-06T08:30:00Z",
"exit_time": "2025-02-06T09:30:00Z",
"reference_id": "REF-001",
"stop_type": "pickup"
},
{
"company_name": "Delivery Company",
"address": "456 Delivery Avenue",
"zip_code": "20002",
"enter_time": "2025-02-07T14:00:00Z",
"exit_time": "2025-02-07T15:00:00Z",
"reference_id": "REF-002",
"stop_type": "delivery"
}
]
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
load_id: 'LD-987654',
load_pay: '5000.00',
customer: 'ABC Logistics',
mc_number: 'Armitage',
weight: '2000kg',
goods: 'Furniture',
rate_confirmation: 'base64_encoded_string',
stops: [
{
company_name: 'Pickup Company',
address: '123 Pickup Street',
zip_code: '10001',
enter_time: '2025-02-06T08:30:00Z',
exit_time: '2025-02-06T09:30:00Z',
reference_id: 'REF-001',
stop_type: 'pickup'
},
{
company_name: 'Delivery Company',
address: '456 Delivery Avenue',
zip_code: '20002',
enter_time: '2025-02-07T14:00:00Z',
exit_time: '2025-02-07T15:00:00Z',
reference_id: 'REF-002',
stop_type: 'delivery'
}
]
})
};
fetch('https://{company}.datatruck.io/api/v1/openapi/orders/create/', 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/orders/create/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'load_id' => 'LD-987654',
'load_pay' => '5000.00',
'customer' => 'ABC Logistics',
'mc_number' => 'Armitage',
'weight' => '2000kg',
'goods' => 'Furniture',
'rate_confirmation' => 'base64_encoded_string',
'stops' => [
[
'company_name' => 'Pickup Company',
'address' => '123 Pickup Street',
'zip_code' => '10001',
'enter_time' => '2025-02-06T08:30:00Z',
'exit_time' => '2025-02-06T09:30:00Z',
'reference_id' => 'REF-001',
'stop_type' => 'pickup'
],
[
'company_name' => 'Delivery Company',
'address' => '456 Delivery Avenue',
'zip_code' => '20002',
'enter_time' => '2025-02-07T14:00:00Z',
'exit_time' => '2025-02-07T15:00:00Z',
'reference_id' => 'REF-002',
'stop_type' => 'delivery'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://{company}.datatruck.io/api/v1/openapi/orders/create/"
payload := strings.NewReader("{\n \"load_id\": \"LD-987654\",\n \"load_pay\": \"5000.00\",\n \"customer\": \"ABC Logistics\",\n \"mc_number\": \"Armitage\",\n \"weight\": \"2000kg\",\n \"goods\": \"Furniture\",\n \"rate_confirmation\": \"base64_encoded_string\",\n \"stops\": [\n {\n \"company_name\": \"Pickup Company\",\n \"address\": \"123 Pickup Street\",\n \"zip_code\": \"10001\",\n \"enter_time\": \"2025-02-06T08:30:00Z\",\n \"exit_time\": \"2025-02-06T09:30:00Z\",\n \"reference_id\": \"REF-001\",\n \"stop_type\": \"pickup\"\n },\n {\n \"company_name\": \"Delivery Company\",\n \"address\": \"456 Delivery Avenue\",\n \"zip_code\": \"20002\",\n \"enter_time\": \"2025-02-07T14:00:00Z\",\n \"exit_time\": \"2025-02-07T15:00:00Z\",\n \"reference_id\": \"REF-002\",\n \"stop_type\": \"delivery\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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.post("https://{company}.datatruck.io/api/v1/openapi/orders/create/")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"load_id\": \"LD-987654\",\n \"load_pay\": \"5000.00\",\n \"customer\": \"ABC Logistics\",\n \"mc_number\": \"Armitage\",\n \"weight\": \"2000kg\",\n \"goods\": \"Furniture\",\n \"rate_confirmation\": \"base64_encoded_string\",\n \"stops\": [\n {\n \"company_name\": \"Pickup Company\",\n \"address\": \"123 Pickup Street\",\n \"zip_code\": \"10001\",\n \"enter_time\": \"2025-02-06T08:30:00Z\",\n \"exit_time\": \"2025-02-06T09:30:00Z\",\n \"reference_id\": \"REF-001\",\n \"stop_type\": \"pickup\"\n },\n {\n \"company_name\": \"Delivery Company\",\n \"address\": \"456 Delivery Avenue\",\n \"zip_code\": \"20002\",\n \"enter_time\": \"2025-02-07T14:00:00Z\",\n \"exit_time\": \"2025-02-07T15:00:00Z\",\n \"reference_id\": \"REF-002\",\n \"stop_type\": \"delivery\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{company}.datatruck.io/api/v1/openapi/orders/create/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"load_id\": \"LD-987654\",\n \"load_pay\": \"5000.00\",\n \"customer\": \"ABC Logistics\",\n \"mc_number\": \"Armitage\",\n \"weight\": \"2000kg\",\n \"goods\": \"Furniture\",\n \"rate_confirmation\": \"base64_encoded_string\",\n \"stops\": [\n {\n \"company_name\": \"Pickup Company\",\n \"address\": \"123 Pickup Street\",\n \"zip_code\": \"10001\",\n \"enter_time\": \"2025-02-06T08:30:00Z\",\n \"exit_time\": \"2025-02-06T09:30:00Z\",\n \"reference_id\": \"REF-001\",\n \"stop_type\": \"pickup\"\n },\n {\n \"company_name\": \"Delivery Company\",\n \"address\": \"456 Delivery Avenue\",\n \"zip_code\": \"20002\",\n \"enter_time\": \"2025-02-07T14:00:00Z\",\n \"exit_time\": \"2025-02-07T15:00:00Z\",\n \"reference_id\": \"REF-002\",\n \"stop_type\": \"delivery\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": 12345,
"shipment_id": "SHIP-987654",
"customer": "ABC Logistics",
"status": "In Progress",
"mc_number": "Armitage",
"load_id": "LD-987654",
"references_id": "REF-123456",
"load_pay": "5000.00",
"total_miles": "1500.75",
"tags": [
{
"name": "Urgent"
}
],
"per_mile_revenue": "3.25",
"special_instruction": "Handle with care"
}{
"error": 123,
"message": "<string>"
}Create Load
This endpoint allows users to create a new load in the Datatruck Transportation Management System (TMS).
curl --request POST \
--url https://{company}.datatruck.io/api/v1/openapi/orders/create/ \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"load_id": "LD-987654",
"load_pay": "5000.00",
"customer": "ABC Logistics",
"mc_number": "Armitage",
"weight": "2000kg",
"goods": "Furniture",
"rate_confirmation": "base64_encoded_string",
"stops": [
{
"company_name": "Pickup Company",
"address": "123 Pickup Street",
"zip_code": "10001",
"enter_time": "2025-02-06T08:30:00Z",
"exit_time": "2025-02-06T09:30:00Z",
"reference_id": "REF-001",
"stop_type": "pickup"
},
{
"company_name": "Delivery Company",
"address": "456 Delivery Avenue",
"zip_code": "20002",
"enter_time": "2025-02-07T14:00:00Z",
"exit_time": "2025-02-07T15:00:00Z",
"reference_id": "REF-002",
"stop_type": "delivery"
}
]
}
'import requests
url = "https://{company}.datatruck.io/api/v1/openapi/orders/create/"
payload = {
"load_id": "LD-987654",
"load_pay": "5000.00",
"customer": "ABC Logistics",
"mc_number": "Armitage",
"weight": "2000kg",
"goods": "Furniture",
"rate_confirmation": "base64_encoded_string",
"stops": [
{
"company_name": "Pickup Company",
"address": "123 Pickup Street",
"zip_code": "10001",
"enter_time": "2025-02-06T08:30:00Z",
"exit_time": "2025-02-06T09:30:00Z",
"reference_id": "REF-001",
"stop_type": "pickup"
},
{
"company_name": "Delivery Company",
"address": "456 Delivery Avenue",
"zip_code": "20002",
"enter_time": "2025-02-07T14:00:00Z",
"exit_time": "2025-02-07T15:00:00Z",
"reference_id": "REF-002",
"stop_type": "delivery"
}
]
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
load_id: 'LD-987654',
load_pay: '5000.00',
customer: 'ABC Logistics',
mc_number: 'Armitage',
weight: '2000kg',
goods: 'Furniture',
rate_confirmation: 'base64_encoded_string',
stops: [
{
company_name: 'Pickup Company',
address: '123 Pickup Street',
zip_code: '10001',
enter_time: '2025-02-06T08:30:00Z',
exit_time: '2025-02-06T09:30:00Z',
reference_id: 'REF-001',
stop_type: 'pickup'
},
{
company_name: 'Delivery Company',
address: '456 Delivery Avenue',
zip_code: '20002',
enter_time: '2025-02-07T14:00:00Z',
exit_time: '2025-02-07T15:00:00Z',
reference_id: 'REF-002',
stop_type: 'delivery'
}
]
})
};
fetch('https://{company}.datatruck.io/api/v1/openapi/orders/create/', 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/orders/create/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'load_id' => 'LD-987654',
'load_pay' => '5000.00',
'customer' => 'ABC Logistics',
'mc_number' => 'Armitage',
'weight' => '2000kg',
'goods' => 'Furniture',
'rate_confirmation' => 'base64_encoded_string',
'stops' => [
[
'company_name' => 'Pickup Company',
'address' => '123 Pickup Street',
'zip_code' => '10001',
'enter_time' => '2025-02-06T08:30:00Z',
'exit_time' => '2025-02-06T09:30:00Z',
'reference_id' => 'REF-001',
'stop_type' => 'pickup'
],
[
'company_name' => 'Delivery Company',
'address' => '456 Delivery Avenue',
'zip_code' => '20002',
'enter_time' => '2025-02-07T14:00:00Z',
'exit_time' => '2025-02-07T15:00:00Z',
'reference_id' => 'REF-002',
'stop_type' => 'delivery'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://{company}.datatruck.io/api/v1/openapi/orders/create/"
payload := strings.NewReader("{\n \"load_id\": \"LD-987654\",\n \"load_pay\": \"5000.00\",\n \"customer\": \"ABC Logistics\",\n \"mc_number\": \"Armitage\",\n \"weight\": \"2000kg\",\n \"goods\": \"Furniture\",\n \"rate_confirmation\": \"base64_encoded_string\",\n \"stops\": [\n {\n \"company_name\": \"Pickup Company\",\n \"address\": \"123 Pickup Street\",\n \"zip_code\": \"10001\",\n \"enter_time\": \"2025-02-06T08:30:00Z\",\n \"exit_time\": \"2025-02-06T09:30:00Z\",\n \"reference_id\": \"REF-001\",\n \"stop_type\": \"pickup\"\n },\n {\n \"company_name\": \"Delivery Company\",\n \"address\": \"456 Delivery Avenue\",\n \"zip_code\": \"20002\",\n \"enter_time\": \"2025-02-07T14:00:00Z\",\n \"exit_time\": \"2025-02-07T15:00:00Z\",\n \"reference_id\": \"REF-002\",\n \"stop_type\": \"delivery\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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.post("https://{company}.datatruck.io/api/v1/openapi/orders/create/")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"load_id\": \"LD-987654\",\n \"load_pay\": \"5000.00\",\n \"customer\": \"ABC Logistics\",\n \"mc_number\": \"Armitage\",\n \"weight\": \"2000kg\",\n \"goods\": \"Furniture\",\n \"rate_confirmation\": \"base64_encoded_string\",\n \"stops\": [\n {\n \"company_name\": \"Pickup Company\",\n \"address\": \"123 Pickup Street\",\n \"zip_code\": \"10001\",\n \"enter_time\": \"2025-02-06T08:30:00Z\",\n \"exit_time\": \"2025-02-06T09:30:00Z\",\n \"reference_id\": \"REF-001\",\n \"stop_type\": \"pickup\"\n },\n {\n \"company_name\": \"Delivery Company\",\n \"address\": \"456 Delivery Avenue\",\n \"zip_code\": \"20002\",\n \"enter_time\": \"2025-02-07T14:00:00Z\",\n \"exit_time\": \"2025-02-07T15:00:00Z\",\n \"reference_id\": \"REF-002\",\n \"stop_type\": \"delivery\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{company}.datatruck.io/api/v1/openapi/orders/create/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"load_id\": \"LD-987654\",\n \"load_pay\": \"5000.00\",\n \"customer\": \"ABC Logistics\",\n \"mc_number\": \"Armitage\",\n \"weight\": \"2000kg\",\n \"goods\": \"Furniture\",\n \"rate_confirmation\": \"base64_encoded_string\",\n \"stops\": [\n {\n \"company_name\": \"Pickup Company\",\n \"address\": \"123 Pickup Street\",\n \"zip_code\": \"10001\",\n \"enter_time\": \"2025-02-06T08:30:00Z\",\n \"exit_time\": \"2025-02-06T09:30:00Z\",\n \"reference_id\": \"REF-001\",\n \"stop_type\": \"pickup\"\n },\n {\n \"company_name\": \"Delivery Company\",\n \"address\": \"456 Delivery Avenue\",\n \"zip_code\": \"20002\",\n \"enter_time\": \"2025-02-07T14:00:00Z\",\n \"exit_time\": \"2025-02-07T15:00:00Z\",\n \"reference_id\": \"REF-002\",\n \"stop_type\": \"delivery\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": 12345,
"shipment_id": "SHIP-987654",
"customer": "ABC Logistics",
"status": "In Progress",
"mc_number": "Armitage",
"load_id": "LD-987654",
"references_id": "REF-123456",
"load_pay": "5000.00",
"total_miles": "1500.75",
"tags": [
{
"name": "Urgent"
}
],
"per_mile_revenue": "3.25",
"special_instruction": "Handle with care"
}{
"error": 123,
"message": "<string>"
}Authorizations
Body
Request Body
Customer associated with the load
"ABC Logistics"
Motor Carrier number for the shipment
"Armitage"
Unique identifier for the load
"LD-987654"
Payment amount for the load
"5000.00"
Weight of the goods being transported
"2000kg"
Type of goods being transported
"Furniture"
Rate confirmation document in base64 format or use global url of the file)
"base64_encoded_string"
List of stops along the route
Show child attributes
Show child attributes
Response
Successful order creation response
Unique order ID
12345
Shipment identifier
"SHIP-987654"
Customer associated with the shipment
"ABC Logistics"
Current status of the load
"In Progress"
Motor Carrier number for the shipment
"Armitage"
Unique identifier for the load
"LD-987654"
Reference ID for the load
"REF-123456"
Total payment amount for the load
"5000.00"
Total miles covered for the load
"1500.75"
List of tags associated with the order
Show child attributes
Show child attributes
Revenue per mile (optional)
"3.25"
Any special instructions for the load
"Handle with care"