curl --request POST \
--url https://api.tread-horizon.com/v1/accounts/{account-id}/auto_add_on_assignments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"add_on_rate_type": "RateForEach",
"add_on_types": [
"driver_pay"
],
"quantity": 123,
"rate": 123,
"percentage": 123,
"external_id": "<string>",
"accounting_id": "<string>",
"add_on_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"account_type": "customer",
"total_installments": 1,
"revenue_rate_value": 123,
"revenue_cost_rate_type": "RateForEach",
"cost_rate_value": 123,
"original_auto_add_on_assignment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"source_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"source_type": "Settlement"
}
'import requests
url = "https://api.tread-horizon.com/v1/accounts/{account-id}/auto_add_on_assignments"
payload = {
"name": "<string>",
"add_on_rate_type": "RateForEach",
"add_on_types": ["driver_pay"],
"quantity": 123,
"rate": 123,
"percentage": 123,
"external_id": "<string>",
"accounting_id": "<string>",
"add_on_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"account_type": "customer",
"total_installments": 1,
"revenue_rate_value": 123,
"revenue_cost_rate_type": "RateForEach",
"cost_rate_value": 123,
"original_auto_add_on_assignment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"source_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"source_type": "Settlement"
}
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({
name: '<string>',
add_on_rate_type: 'RateForEach',
add_on_types: ['driver_pay'],
quantity: 123,
rate: 123,
percentage: 123,
external_id: '<string>',
accounting_id: '<string>',
add_on_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
account_type: 'customer',
total_installments: 1,
revenue_rate_value: 123,
revenue_cost_rate_type: 'RateForEach',
cost_rate_value: 123,
original_auto_add_on_assignment_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
source_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
source_type: 'Settlement'
})
};
fetch('https://api.tread-horizon.com/v1/accounts/{account-id}/auto_add_on_assignments', 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/accounts/{account-id}/auto_add_on_assignments",
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([
'name' => '<string>',
'add_on_rate_type' => 'RateForEach',
'add_on_types' => [
'driver_pay'
],
'quantity' => 123,
'rate' => 123,
'percentage' => 123,
'external_id' => '<string>',
'accounting_id' => '<string>',
'add_on_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'account_type' => 'customer',
'total_installments' => 1,
'revenue_rate_value' => 123,
'revenue_cost_rate_type' => 'RateForEach',
'cost_rate_value' => 123,
'original_auto_add_on_assignment_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'source_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'source_type' => 'Settlement'
]),
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/accounts/{account-id}/auto_add_on_assignments"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"add_on_rate_type\": \"RateForEach\",\n \"add_on_types\": [\n \"driver_pay\"\n ],\n \"quantity\": 123,\n \"rate\": 123,\n \"percentage\": 123,\n \"external_id\": \"<string>\",\n \"accounting_id\": \"<string>\",\n \"add_on_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"account_type\": \"customer\",\n \"total_installments\": 1,\n \"revenue_rate_value\": 123,\n \"revenue_cost_rate_type\": \"RateForEach\",\n \"cost_rate_value\": 123,\n \"original_auto_add_on_assignment_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"source_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"source_type\": \"Settlement\"\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/accounts/{account-id}/auto_add_on_assignments")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"add_on_rate_type\": \"RateForEach\",\n \"add_on_types\": [\n \"driver_pay\"\n ],\n \"quantity\": 123,\n \"rate\": 123,\n \"percentage\": 123,\n \"external_id\": \"<string>\",\n \"accounting_id\": \"<string>\",\n \"add_on_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"account_type\": \"customer\",\n \"total_installments\": 1,\n \"revenue_rate_value\": 123,\n \"revenue_cost_rate_type\": \"RateForEach\",\n \"cost_rate_value\": 123,\n \"original_auto_add_on_assignment_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"source_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"source_type\": \"Settlement\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tread-horizon.com/v1/accounts/{account-id}/auto_add_on_assignments")
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 \"name\": \"<string>\",\n \"add_on_rate_type\": \"RateForEach\",\n \"add_on_types\": [\n \"driver_pay\"\n ],\n \"quantity\": 123,\n \"rate\": 123,\n \"percentage\": 123,\n \"external_id\": \"<string>\",\n \"accounting_id\": \"<string>\",\n \"add_on_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"account_type\": \"customer\",\n \"total_installments\": 1,\n \"revenue_rate_value\": 123,\n \"revenue_cost_rate_type\": \"RateForEach\",\n \"cost_rate_value\": 123,\n \"original_auto_add_on_assignment_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"source_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"source_type\": \"Settlement\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"quantity": "<string>",
"rate": "<string>",
"percentage": "<string>",
"add_on_rate_type": "RateForEach",
"external_id": "<string>",
"accounting_id": "<string>",
"add_on_types": [
"driver_pay"
],
"total_installments": 123,
"auto_add_on_installments_count": 123,
"revenue_rate_value": "<string>",
"revenue_cost_rate_type": "RateForEach",
"cost_rate_value": "<string>",
"account_type": "customer",
"add_on_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"original_auto_add_on_assignment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"source_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"source_type": "Settlement",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"add_on": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"quantity": "<string>",
"rate": "<string>",
"percentage": "<string>",
"add_on_rate_type": "RateForEach",
"fuel_surcharge_schedule": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
}
}
}
}{
"error": {
"code": "<string>"
}
}{
"error": {
"code": "<string>",
"error_type": "<string>"
}
}{
"error": {
"code": "<string>"
}
}{
"error": {
"code": "<string>"
}
}{
"error": {
"code": "<string>"
}
}{
"error": {
"code": "<string>",
"errors": [
{
"model": "<string>",
"field": "<string>",
"message": "<string>"
}
]
}
}Create AutoAddOnAssignments for an Account
Create AutoAddOnAssignment for an Account
curl --request POST \
--url https://api.tread-horizon.com/v1/accounts/{account-id}/auto_add_on_assignments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"add_on_rate_type": "RateForEach",
"add_on_types": [
"driver_pay"
],
"quantity": 123,
"rate": 123,
"percentage": 123,
"external_id": "<string>",
"accounting_id": "<string>",
"add_on_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"account_type": "customer",
"total_installments": 1,
"revenue_rate_value": 123,
"revenue_cost_rate_type": "RateForEach",
"cost_rate_value": 123,
"original_auto_add_on_assignment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"source_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"source_type": "Settlement"
}
'import requests
url = "https://api.tread-horizon.com/v1/accounts/{account-id}/auto_add_on_assignments"
payload = {
"name": "<string>",
"add_on_rate_type": "RateForEach",
"add_on_types": ["driver_pay"],
"quantity": 123,
"rate": 123,
"percentage": 123,
"external_id": "<string>",
"accounting_id": "<string>",
"add_on_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"account_type": "customer",
"total_installments": 1,
"revenue_rate_value": 123,
"revenue_cost_rate_type": "RateForEach",
"cost_rate_value": 123,
"original_auto_add_on_assignment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"source_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"source_type": "Settlement"
}
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({
name: '<string>',
add_on_rate_type: 'RateForEach',
add_on_types: ['driver_pay'],
quantity: 123,
rate: 123,
percentage: 123,
external_id: '<string>',
accounting_id: '<string>',
add_on_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
account_type: 'customer',
total_installments: 1,
revenue_rate_value: 123,
revenue_cost_rate_type: 'RateForEach',
cost_rate_value: 123,
original_auto_add_on_assignment_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
source_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
source_type: 'Settlement'
})
};
fetch('https://api.tread-horizon.com/v1/accounts/{account-id}/auto_add_on_assignments', 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/accounts/{account-id}/auto_add_on_assignments",
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([
'name' => '<string>',
'add_on_rate_type' => 'RateForEach',
'add_on_types' => [
'driver_pay'
],
'quantity' => 123,
'rate' => 123,
'percentage' => 123,
'external_id' => '<string>',
'accounting_id' => '<string>',
'add_on_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'account_type' => 'customer',
'total_installments' => 1,
'revenue_rate_value' => 123,
'revenue_cost_rate_type' => 'RateForEach',
'cost_rate_value' => 123,
'original_auto_add_on_assignment_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'source_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'source_type' => 'Settlement'
]),
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/accounts/{account-id}/auto_add_on_assignments"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"add_on_rate_type\": \"RateForEach\",\n \"add_on_types\": [\n \"driver_pay\"\n ],\n \"quantity\": 123,\n \"rate\": 123,\n \"percentage\": 123,\n \"external_id\": \"<string>\",\n \"accounting_id\": \"<string>\",\n \"add_on_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"account_type\": \"customer\",\n \"total_installments\": 1,\n \"revenue_rate_value\": 123,\n \"revenue_cost_rate_type\": \"RateForEach\",\n \"cost_rate_value\": 123,\n \"original_auto_add_on_assignment_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"source_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"source_type\": \"Settlement\"\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/accounts/{account-id}/auto_add_on_assignments")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"add_on_rate_type\": \"RateForEach\",\n \"add_on_types\": [\n \"driver_pay\"\n ],\n \"quantity\": 123,\n \"rate\": 123,\n \"percentage\": 123,\n \"external_id\": \"<string>\",\n \"accounting_id\": \"<string>\",\n \"add_on_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"account_type\": \"customer\",\n \"total_installments\": 1,\n \"revenue_rate_value\": 123,\n \"revenue_cost_rate_type\": \"RateForEach\",\n \"cost_rate_value\": 123,\n \"original_auto_add_on_assignment_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"source_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"source_type\": \"Settlement\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tread-horizon.com/v1/accounts/{account-id}/auto_add_on_assignments")
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 \"name\": \"<string>\",\n \"add_on_rate_type\": \"RateForEach\",\n \"add_on_types\": [\n \"driver_pay\"\n ],\n \"quantity\": 123,\n \"rate\": 123,\n \"percentage\": 123,\n \"external_id\": \"<string>\",\n \"accounting_id\": \"<string>\",\n \"add_on_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"account_type\": \"customer\",\n \"total_installments\": 1,\n \"revenue_rate_value\": 123,\n \"revenue_cost_rate_type\": \"RateForEach\",\n \"cost_rate_value\": 123,\n \"original_auto_add_on_assignment_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"source_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"source_type\": \"Settlement\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"quantity": "<string>",
"rate": "<string>",
"percentage": "<string>",
"add_on_rate_type": "RateForEach",
"external_id": "<string>",
"accounting_id": "<string>",
"add_on_types": [
"driver_pay"
],
"total_installments": 123,
"auto_add_on_installments_count": 123,
"revenue_rate_value": "<string>",
"revenue_cost_rate_type": "RateForEach",
"cost_rate_value": "<string>",
"account_type": "customer",
"add_on_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"original_auto_add_on_assignment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"source_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"source_type": "Settlement",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"add_on": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"quantity": "<string>",
"rate": "<string>",
"percentage": "<string>",
"add_on_rate_type": "RateForEach",
"fuel_surcharge_schedule": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
}
}
}
}{
"error": {
"code": "<string>"
}
}{
"error": {
"code": "<string>",
"error_type": "<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
Account ID
Body
If you are creating for an Account
account_typeis required- for Vendor
AutoAddOnAssignments, usevendor - for Customer
AutoAddOnAssignments, usecustomer
If you are creating for a User, Rate, Job, JobAssignment
account_typeis not required and accepted
If you are creating for a Project, Order
account_typeis optional- for Vendor
AutoAddOnAssignments, usevendor - for Customer
AutoAddOnAssignments, usecustomer - for Driver
AutoAddOnAssignments, omit or leave as null
RateForEach, RatePercentOfTotal, PerLoad, FuelSurcharge "RateForEach"
driver_pay, invoicing, job, settlement, driver_day Deprecated in favor of revenue_rate_value.
customer, vendor "customer"
x >= 0The cost rate or buy price of the add on.
RateForEach, RatePercentOfTotal, PerLoad, FuelSurcharge "RateForEach"
The cost rate or buy price of the add on.
If you are creating an AutoAddOnAssignment based on an existing one, you'd need to provide this value for cascading effect.
If the AutoAddOnAssignment you are basing on already has a original_auto_add_on_assignment_id, then just copy it over.
Otherwise, use its id as the original_auto_add_on_assignment_id for the new record.
Settlement "Settlement"
Response
Created
Note:
add_on_idis deprecated
Show child attributes
Show child attributes