Example 2 – Freight calculation with multiple values
In this example, the haulier wants to obtain the minimum freight rates for a route between São Paulo and Santos (81 km) – one-way – which will be carried out by 2 trucks with the following logistical and contractual specifications:
Truck 1:
- Number of axles: 5
- Type of operation: Table C
- Cargo: Refrigerated
Truck 2:
- Number of axles: 6
- Type of operation: Table D
- Cargo: Solid Bulk
In addition to freight, a flat rate of $120.00 and 5% tax will be added to the freight price.
Endpoint used: https://api.maplink.global/freight/v1/calculations (Method: POST)
The full request can be found below:
{ "operationType": [ "C", "D" ], "goodsType": [ "FRIGORIFICADA_OU_AQUECIDA", "GRANEL_SOLIDO" ], "axis": [ 5, 6 ], "roundTrip": false, "backEmpty": false, "distance": 81, "otherCosts": [ { "name": "Imposto", "type": "PERCENT", "value": 5 }, { "name": "Taxa Fixa", "type": "FIXED", "value": 120 } ], "date": "2021-12-02" }
When sending a request with multiple values, the API will consider all possible combinations to calculate the freight for the reported scenario. The full response can be found below:
{ "source": "RESOLUÇÃO Nº 496, DE 19 DE OUTUBRO DE 2021", "results": { "D": { "5": { "GRANEL_SOLIDO": { "value": 379.22, "otherCosts": { "Taxa Fixa": 120, "Imposto": 18.97 } }, "FRIGORIFICADA_OU_AQUECIDA": { "value": 459.30, "otherCosts": { "Taxa Fixa": 120, "Imposto": 22.97 } } }, "6": { "GRANEL_SOLIDO": { "value": 424.19, "otherCosts": { "Taxa Fixa": 120, "Imposto": 21.21 } }, "FRIGORIFICADA_OU_AQUECIDA": { "value": 511.11, "otherCosts": { "Taxa Fixa": 120, "Imposto": 25.56 } } } }, "C": { "5": { "GRANEL_SOLIDO": { "value": 409.15, "otherCosts": { "Taxa Fixa": 120, "Imposto": 20.46 } }, "FRIGORIFICADA_OU_AQUECIDA": { "value": 503.04, "otherCosts": { "Taxa Fixa": 120, "Imposto": 25.16 } } }, "6": { "GRANEL_SOLIDO": { "value": 454.12, "otherCosts": { "Taxa Fixa": 120, "Imposto": 22.71 } }, "FRIGORIFICADA_OU_AQUECIDA": { "value": 554.85, "otherCosts": { "Taxa Fixa": 120, "Imposto": 27.75 } } } } }, "minimumFreight": 3694.98, "minimumFreightWithCosts": 4839.77 }