Get toll fares corresponding to transponders
Toll fares can have dramatically different values depending on payment method. In particular, transponders usually correspond to much lower prices, and a user having transponders may prefer to not see other fares at all. The parameter tolls[transponder]
allows the user to specify that they possess such transponders. Currently, the only allowed value is all
, while not specifying the parameter means the user has no transponders at all.
Specifying this parameter has two effects:
- If a toll can be paid by one of the specified transponders, only the fares using transponders are returned.
- If a toll can be paid by one of the specified transponders, and toll summaries are requested, the value of the transponder fare is used to calculate this summary.
Example
The route resulting from this request passes through roads that require toll payment and accept transponders as means of payment.
curl -X GET \
'https://router.hereapi.com/v8/routes?origin=51.255598,4.260537&destination=51.316223,4.337377&return=tolls&transportMode=car&departureTime=any&apikey={YOUR_API_KEY}'
{
"routes":
[
{
"id": "dfc779fd-381e-44a0-a31b-7e9d6d86ef69",
"sections":
[
{
"id": "917a1520-b8f0-4895-8e7a-a9cfcbc56fa5",
"type": "vehicle",
"departure":
{
"time": "2022-09-12T13:04:12+02:00",
"place":
{
"type": "place",
"location":
{
"lat": 51.2559314,
"lng": 4.2599393
},
"originalLocation":
{
"lat": 51.255598,
"lng": 4.260537
}
}
},
"arrival":
{
"time": "2022-09-12T13:17:29+02:00",
"place":
{
"type": "place",
"location":
{
"lat": 51.31641,
"lng": 4.33678
},
"originalLocation":
{
"lat": 51.3162229,
"lng": 4.337377
}
}
},
"transport":
{
"mode": "car"
},
"tolls":
[
{
"countryCode": "BEL",
"tollSystemRef": 0,
"tollSystem": "LIEFKENSHOEKTUNNEL",
"fares":
[
{
"id": "c4f1d917-3a7a-43f0-8c90-47ebca012647",
"name": "LIEFKENSHOEKTUNNEL",
"price":
{
"type": "value",
"currency": "EUR",
"value": 3.56
},
"reason": "toll",
"paymentMethods":
[
"transponder"
]
},
{
"id": "c0e97aa0-4d49-4bbe-a09e-774710ac852e",
"name": "LIEFKENSHOEKTUNNEL",
"price":
{
"type": "value",
"currency": "EUR",
"value": 6
},
"reason": "toll",
"paymentMethods":
[
"cash"
]
},
{
"id": "bf1ea0f5-559a-4112-95bb-562e12397aa0",
"name": "LIEFKENSHOEKTUNNEL",
"price":
{
"type": "value",
"currency": "EUR",
"value": 4.95
},
"reason": "toll",
"paymentMethods":
[
"bankCard",
"creditCard",
"travelCard"
]
}
],
"tollCollectionLocations":
[
{
"name": "Kallo",
"location":
{
"lat": 51.28629,
"lng": 4.28951
}
}
]
}
],
"tollSystems":
[
{
"id": 7057,
"name": "LIEFKENSHOEKTUNNEL",
"languageCode": "ENG"
}
]
}
]
}
]
}
Note that there are three different possible fares to cover the cost of the tunnel toll. However, one of this is only valid when paying with transponder. This becomes evident when adding tolls[transponders]=all
to the request:
curl -X GET \
'https://router.hereapi.com/v8/routes?origin=51.255598,4.260537&destination=51.316223,4.337377&return=tolls&transportMode=car&departureTime=any&tolls[transponders]=all&apikey={YOUR_API_KEY}'
{
"routes":
[
{
"id": "a5702b49-3dbc-42a4-b938-49fd3e869c73",
"sections":
[
{
"id": "110e80a7-2165-4106-b534-77f461b67aa1",
"type": "vehicle",
"departure":
{
"time": "2022-09-12T13:08:40+02:00",
"place":
{
"type": "place",
"location":
{
"lat": 51.2559314,
"lng": 4.2599393
},
"originalLocation":
{
"lat": 51.255598,
"lng": 4.260537
}
}
},
"arrival":
{
"time": "2022-09-12T13:21:53+02:00",
"place":
{
"type": "place",
"location":
{
"lat": 51.31641,
"lng": 4.33678
},
"originalLocation":
{
"lat": 51.3162229,
"lng": 4.337377
}
}
},
"transport":
{
"mode": "car"
},
"tolls":
[
{
"countryCode": "BEL",
"tollSystemRef": 0,
"tollSystem": "LIEFKENSHOEKTUNNEL",
"fares":
[
{
"id": "343afda9-850c-480a-a54c-e45ff4a642b3",
"name": "LIEFKENSHOEKTUNNEL",
"price":
{
"type": "value",
"currency": "EUR",
"value": 3.56
},
"reason": "toll",
"paymentMethods":
[
"transponder"
]
}
],
"tollCollectionLocations":
[
{
"name": "Kallo",
"location":
{
"lat": 51.28629,
"lng": 4.28951
}
}
]
}
],
"tollSystems":
[
{
"id": 7057,
"name": "LIEFKENSHOEKTUNNEL",
"languageCode": "ENG"
}
]
}
]
}
]
}
Note that, in this case, only the fare corresponding to paying with a transponder is included in the result.