Skip to main content

Container | Truck | Dry Run | Climes API


Logistics Freights API's are useful to calculate the truecost value of a single shipment having multiple factors.

Request Parameters​

Endpoint​

/v3/logistics/freight

Method​

POST

Headers​

{
'x-api-key': 'API_KEY',
'Content-Type': 'application/json'
}

Payload​

{
"configs": {
"region": "IN",
"transportation_type": "truck"
},
"queries": {
"legs": [
{
"shipping_method": "container",
"weight": 14125,
"distance": 2200,
"container_type": "22UP",
"dry_run": true
},
{
"shipping_method": "container",
"weight": 14125,
"distance": 2200,
"container_type": "22UP",
"dry_run": false
}
]
}
}

Response Parameters​

Status Code​

200

Response Data​

The response will contain the truecost values in tonnes CO2e for each shipping_method as per the request order respectively.

{
"message": "Truecost calculated successfully",
"truecost": {
"total_truecost": 2677,
"legs": [
1141,
1536
],
"equivalents": {
"trash_collected": "113773",
"trees_planted": "44171",
"lamps_collected": "101458"
}
}
}
caution

The error message is for your information, not the end users.
Please use the status codes and communicate the error to user accordingly
The API returns the first validation error that is encountered even if there are multiple errors with the request

tip

Here the response will be in the same order as the request values.

Sample Request​

curl --location --request POST 'BASE_URL/logistics/freight'  
--header 'x-api-key: API_KEY'
--header 'Content-Type: application/json'
--data-raw '{
"configs": {
"region": "IN",
"transportation_type": "truck"
},
"queries": {
"legs": [
{
"shipping_method": "container",
"weight": 14125,
"distance": 2200,
"container_type": "22UP",
"dry_run": true
},
{
"shipping_method": "container",
"weight": 14125,
"distance": 2200,
"container_type": "22UP",
"dry_run": false
}
]
}
}'

Sample Response​

Below are sample responses for the above request.

Responses

{
"message": "Truecost calculated successfully",
"truecost": {
"total_truecost": 2677,
"legs": [
1141,
1536
],
"equivalents": {
"trash_collected": "113773",
"trees_planted": "44171",
"lamps_collected": "101458"
}
}
}