Activate toll cost calculation or toll cost optimization in "calculateroute.json" by request parameter "tollVehicleType".
In addition to the "tollVehicleType" you can specify many toll-relevant vehicle parameters, like weight, width, length, height, trailer height or fuel type. These parameters are marked with "used for toll cost" in the API Reference.
These route response will contain cost / details / tollCost and the toll cost will be added to cost / totalCost.
In addition, toll cost detail can be requested on different levels, using the "rollups" parameter:
The total cost due for road usage can be divided into 3 categories:
The total cost for these 3 categories is returned separately in the response to a request. Note that ferry costs are currently only averages and hence taken into consideration for route optimization, but not returned as explicit cost items.
The router always computes a cost optimized route. Per default it assumes high driver cost and hence computes the fastest route.
To only compute the toll cost along the fastest route (i.e. do not change the route to reduce toll cost) specify a high value in the driver_cost parameter and a low value in the vehicle_cost parameter.
To get a (toll) cost optimized route, specify (part of) the following parameters:
driver_cost– Cost of driving per hour in the specified currency, such as the hourly wage for a truck driver
vehicle_cost– Cost of using the vehicle per kilometer in the specified currency, such as the cost of using a truck
customConsumptionDetails– Fuel / energy cost of the vehicle