toll APIintegrationRESTdevelopers

Toll API: integrate toll calculation into your software

What a toll API is and how to call the Tolls Calculator toll and cost endpoints with Bearer auth, example payloads and integration practices.

By Jorge Parada, CTO de Cargoffer

Toll API: integrate toll calculation into your software

Direct answer: a toll API takes a route (polyline or waypoints), a vehicle profile and a payment method, and returns the toll cost broken down by section. Tolls Calculator documents two doors: POST https://back.transcend.cargoffer.com/api/v1/tolls/calculate (tolls only) and POST https://api.cargoffer.com/costs/calculate (toll + fuel + driver).

Authentication

Both endpoints use Authorization: Bearer <API_KEY>; keys are issued by the product team and must never ship in frontend code.

Toll endpoint

Payload: polyline, vehicle_class (CLASS_1..CLASS_4 for heavy vehicles), payment_method (TELEPASS, VIA_T, CASH, CARD). Response: total_toll_cost_eur, currency and a toll_sections array (illustrative figures). Full reference in the toll endpoint spec.

Integration practices

Cache per route geometry + date, store the query timestamp for audits, validate the vehicle profile before calling, and treat results as estimates until the vehicle actually passes.

All amounts shown are illustrative; real results come from live queries.

Frequently asked questions

How do I authenticate the toll API?
Bearer token in the Authorization header; the key is issued by the product team and stays on your backend.
What does the response include?
A total plus a per-section breakdown (infrastructure, cost, distance) for audits and route comparison.
Can I use it without my own routing?
Use the costs endpoint with waypoints; the tolls endpoint needs a polyline.

Related resources

Ready to calculate tolls with live data?