curl --request PATCH \
--url https://api.tread-horizon.com/v1/companies/{company-id}/invoices/{invoice-id}/add_on_charges \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"add_on_charges": [
{
"name": "<string>",
"percentage": 0,
"quantity": 123,
"rate": 123,
"add_on_rate_type": "RateForEach",
"add_on_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"invoice_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"external_id": "<string>",
"accounting_id": "<string>",
"load_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"revenue_rate_value": 123,
"revenue_cost_rate_type": "RateForEach",
"rebill_revenue_rate_value": 123,
"rebill_percentage": 123,
"cost_rate_value": 123
}
]
}
'{
"data": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"percentage": "<string>",
"quantity": "<string>",
"total_amount": "<string>",
"external_id": "<string>",
"revenue_rate_value": "<string>",
"revenue_cost_rate_type": "RateForEach",
"add_on_requestable_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"add_on_requestable_type": "Job",
"add_on_applicable_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"add_on_applicable_type": "Invoice",
"accounting_id": "<string>",
"rate": "<string>",
"add_on_rate_type": "RateForEach",
"rebill_revenue_rate_value": "<string>",
"rebill_total_amount": "<string>",
"add_on": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"invoice": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"load": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"job": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"job_id": "<string>",
"loads_count": 123,
"job_start_at": "2023-11-07T05:31:56Z",
"unit_of_measure": "Load"
},
"rebill_percentage": "<string>"
}
]
}Batch update AddOnCharges for an Invoice for a Company
This endpoint allows updating, creating, deleting AddOnCharges all at once.
If updating existing records:
id for each record to be updatedadd_on_charges: [
{
"id": "some-uuid"
"quantity": 20.25,
"rate": 15.75
}
]
If creating new records:
id for each record to be createdadd_on_charges: [
{
"quantity": 20.25,
"rate": 12.5,
"add_on_rate_type": "RateForEach"
},
{
"percentage": 10,
"add_on_rate_type": "RatePercentOfTotal"
}
]
If deleting exisitng records:
id and the property _destroy: 1e.g.
add_on_charges: [
{
"id": "some-uuid"
"_destroy": 1
}
]
curl --request PATCH \
--url https://api.tread-horizon.com/v1/companies/{company-id}/invoices/{invoice-id}/add_on_charges \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"add_on_charges": [
{
"name": "<string>",
"percentage": 0,
"quantity": 123,
"rate": 123,
"add_on_rate_type": "RateForEach",
"add_on_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"invoice_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"external_id": "<string>",
"accounting_id": "<string>",
"load_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"revenue_rate_value": 123,
"revenue_cost_rate_type": "RateForEach",
"rebill_revenue_rate_value": 123,
"rebill_percentage": 123,
"cost_rate_value": 123
}
]
}
'{
"data": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"percentage": "<string>",
"quantity": "<string>",
"total_amount": "<string>",
"external_id": "<string>",
"revenue_rate_value": "<string>",
"revenue_cost_rate_type": "RateForEach",
"add_on_requestable_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"add_on_requestable_type": "Job",
"add_on_applicable_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"add_on_applicable_type": "Invoice",
"accounting_id": "<string>",
"rate": "<string>",
"add_on_rate_type": "RateForEach",
"rebill_revenue_rate_value": "<string>",
"rebill_total_amount": "<string>",
"add_on": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"invoice": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"load": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"job": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"job_id": "<string>",
"loads_count": 123,
"job_start_at": "2023-11-07T05:31:56Z",
"unit_of_measure": "Load"
},
"rebill_percentage": "<string>"
}
]
}Documentation Index
Fetch the complete documentation index at: https://docs.tread.ai/llms.txt
Use this file to discover all available pages before exploring further.
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
The Accept-Language request HTTP header indicates the natural language and locale that the client prefers.
"en"
Show child attributes
OK
Show child attributes