Logistics Schema | Climes API
This is the schema for the logistics-freight truecost api's and it will be consistent throughout logistics-freight api's.
Request Schema
Each request requires 2 objects queries
and configs
object that has a top level key legs
configs
are params that will apply to all legs under queries
Configs Schema
Name | Description | Type | Optional |
---|---|---|---|
region | Restricted to IN for now. | string | required |
transportation_type | This is the type of transportation used for the logistics. Enums : truck ship rail | string | required |
Queries Schema
Each queries
object has a legs
array which requires individual leg object.
Name | Description | Type | Optional |
---|---|---|---|
legs | It is an array of individual requests per leg that this emission is being calculated for. | string | required |
Leg Schema
Name | Description | Type | Optional |
---|---|---|---|
shipping_method | This is type of shipping used. Enums : container loose | string | required |
weight | Shipping objects weights in Kgs | number | required |
distance | Shipping distance in Kms | number | required |
container_type | This field is only required if shipping_method is container . Use the values from below Container Weight Mappings | string | optional |
truck_unladen_weight | This field can be sent only if transportation_type is truck .The unit is in kgs. If not sent will be assumed based on the weight param | number | optional |
truck_max_capacity | This field can be sent only if transportation_type is truck .The unit is in kgs. If not sent will be assumed based on the weight param | number | optional |
container_tare_weight | This is the tare weight of container in Kgs | number | optional |
dry_run | This field is only used when transportation_type is truck | boolean | optional |
Container Weight Mappings
container_type | container_name |
---|---|
0 | None |
22GP | 20 Standard Dry |
42GP | 40 Standard Dry |
45GP | 40 High Cube |
22RT | 20 Reefer |
22TN | 20 Tank |
22UT | 20 Open Top |
42RT | 40 Reefer |
42UT | 40 Open Top |
L5GP | 45 High Cube (45 General Purpose) |
42TN | 40 Tank |
42VH | 40 Ventilated |
42UP | 40 Hard Top |
42PC | 40 Collapsible Flat Rack |
42PF | 40 Flat Rack |
42HR | 40 Insulated |
20BU | 20 Bulk |
29PL | 20 Platform |
22VH | 20 Ventilated |
22UP | 20 Hard Top |
22PC | 20 Collapsible Flat Rack |
22PF | 20 Flat Rack |
22HR | 20 Insulated |
There are 3 folders in this collection which have examples for each variable of API call possible for this use case
In the above definition of the leg
object, if dry_run
is set to true, the shipment weight is excluded from the total weight and only used to calculate the axle and unladen weight of the truck but not for truecost - This is applicable only when transportation_type
is truck
.
Response Schema
Name | Description | Type |
---|---|---|
message | A human readable string describing response for the given request. | string |
truecost | This object contains the calculated truecost values in Kg CO2e for the request. | object |
total_truecost | This is the total amount of Kg CO2e for the request | number |
legs | This key has the breakdown of the Kg CO2e emissions per leg sent in the request.This is in the exact order as legs sent in the request. | array |
equivalents | This object contains the equivalents for the calculated truecost values of legs in request. | object |
trash_collected | Its the total number of trash bags collected for recycle for the response's total_truecost | string |
trees_planted | Its the total number of seedlings planted and grown for 10 years for the amount of response's total_truecost | string |
lamps_collected | Its the total lamps' electricity saved for the response's total_truecost | string |