Generate estimated Order values
curl --request POST \
--url https://api.tread-horizon.com/v1/companies/{company-id}/orders/estimate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"equipment_capacity": 123,
"job_duration_minutes": 123,
"cycle_time_minutes": 123,
"total_loads": 123,
"truck_quantity": 123,
"total_units": 123
}
'import requests
url = "https://api.tread-horizon.com/v1/companies/{company-id}/orders/estimate"
payload = {
"equipment_capacity": 123,
"job_duration_minutes": 123,
"cycle_time_minutes": 123,
"total_loads": 123,
"truck_quantity": 123,
"total_units": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
equipment_capacity: 123,
job_duration_minutes: 123,
cycle_time_minutes: 123,
total_loads: 123,
truck_quantity: 123,
total_units: 123
})
};
fetch('https://api.tread-horizon.com/v1/companies/{company-id}/orders/estimate', 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/companies/{company-id}/orders/estimate",
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([
'equipment_capacity' => 123,
'job_duration_minutes' => 123,
'cycle_time_minutes' => 123,
'total_loads' => 123,
'truck_quantity' => 123,
'total_units' => 123
]),
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/companies/{company-id}/orders/estimate"
payload := strings.NewReader("{\n \"equipment_capacity\": 123,\n \"job_duration_minutes\": 123,\n \"cycle_time_minutes\": 123,\n \"total_loads\": 123,\n \"truck_quantity\": 123,\n \"total_units\": 123\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.tread-horizon.com/v1/companies/{company-id}/orders/estimate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"equipment_capacity\": 123,\n \"job_duration_minutes\": 123,\n \"cycle_time_minutes\": 123,\n \"total_loads\": 123,\n \"truck_quantity\": 123,\n \"total_units\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tread-horizon.com/v1/companies/{company-id}/orders/estimate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"equipment_capacity\": 123,\n \"job_duration_minutes\": 123,\n \"cycle_time_minutes\": 123,\n \"total_loads\": 123,\n \"truck_quantity\": 123,\n \"total_units\": 123\n}"
response = http.request(request)
puts response.read_body{
"data": {
"truck_quantity": 123,
"loads_per_truck": 123,
"total_loads": 123,
"delivered_per_truck": 123,
"total_units": 123,
"units_per_hour": 123
}
}{
"error": {
"code": "<string>"
}
}{
"error": {
"code": "<string>",
"error_type": "<string>"
}
}{
"error": {
"code": "<string>"
}
}{
"error": {
"code": "<string>"
}
}{
"error": {
"code": "<string>",
"errors": [
{
"model": "<string>",
"field": "<string>",
"message": "<string>"
}
]
}
}Orders
Generate estimated Order values
Generates estimated Order values.
One of total_loads, total_units, or truck_quantity must be set in the request.
POST
/
v1
/
companies
/
{company-id}
/
orders
/
estimate
Generate estimated Order values
curl --request POST \
--url https://api.tread-horizon.com/v1/companies/{company-id}/orders/estimate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"equipment_capacity": 123,
"job_duration_minutes": 123,
"cycle_time_minutes": 123,
"total_loads": 123,
"truck_quantity": 123,
"total_units": 123
}
'import requests
url = "https://api.tread-horizon.com/v1/companies/{company-id}/orders/estimate"
payload = {
"equipment_capacity": 123,
"job_duration_minutes": 123,
"cycle_time_minutes": 123,
"total_loads": 123,
"truck_quantity": 123,
"total_units": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
equipment_capacity: 123,
job_duration_minutes: 123,
cycle_time_minutes: 123,
total_loads: 123,
truck_quantity: 123,
total_units: 123
})
};
fetch('https://api.tread-horizon.com/v1/companies/{company-id}/orders/estimate', 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/companies/{company-id}/orders/estimate",
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([
'equipment_capacity' => 123,
'job_duration_minutes' => 123,
'cycle_time_minutes' => 123,
'total_loads' => 123,
'truck_quantity' => 123,
'total_units' => 123
]),
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/companies/{company-id}/orders/estimate"
payload := strings.NewReader("{\n \"equipment_capacity\": 123,\n \"job_duration_minutes\": 123,\n \"cycle_time_minutes\": 123,\n \"total_loads\": 123,\n \"truck_quantity\": 123,\n \"total_units\": 123\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.tread-horizon.com/v1/companies/{company-id}/orders/estimate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"equipment_capacity\": 123,\n \"job_duration_minutes\": 123,\n \"cycle_time_minutes\": 123,\n \"total_loads\": 123,\n \"truck_quantity\": 123,\n \"total_units\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tread-horizon.com/v1/companies/{company-id}/orders/estimate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"equipment_capacity\": 123,\n \"job_duration_minutes\": 123,\n \"cycle_time_minutes\": 123,\n \"total_loads\": 123,\n \"truck_quantity\": 123,\n \"total_units\": 123\n}"
response = http.request(request)
puts response.read_body{
"data": {
"truck_quantity": 123,
"loads_per_truck": 123,
"total_loads": 123,
"delivered_per_truck": 123,
"total_units": 123,
"units_per_hour": 123
}
}{
"error": {
"code": "<string>"
}
}{
"error": {
"code": "<string>",
"error_type": "<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.
Example:
"en"
Path Parameters
Company ID
Body
application/json
Required if you want calculations based on total loads counts
Required if you want calculations based on truck count
Required if you want calculations based on total units of material
Response
OK
Show child attributes
Show child attributes
Typeahead search on Orders' Dispatch Number by CompanyRetrieve Orders based on Invoices that belong to a Company
⌘I