Route with stops
When calculating an EV route with the Chargetrip Route API, you can add intermediate stops between the origin and destination using via.
Stops allow you to customize routing for real-world travel scenarios—such as charging at a preferred charge station, picking up passengers or stopping at a restaurant.
Types of stops
Chargetrip supports two types of intermediate stops:
| Stop | Charging | Input field | Purpose |
|---|---|---|---|
| Location | No | via.geometry | Geographic stop (pick-up, delivery, scenic detour, coffee break). |
| Station | Yes | via.properties.station.station_id | Explicitly selected charging station. |
Stop duration
You can configure the duration of every stop. Depending on the type of stop (charging or non-charging), the stop_duration is configured in different locations and has different behaviors:
1. In non-charging stops
The stop duration is configured at input.via.properties.location.stop_duration. This duration represents the exact stop duration and is added directly to the total trip duration without affecting the vehicle charging or driving time.
2. In charging stops
The stop duration is configured at input.via.properties.station.stop_duration. This value represents the minimum stop duration. The vehicle remains at the station for at least this long, but the route planner may extend the stop depending on the configured charge_mode:
-
ALWAYS_TO_MAX_CHARGE: Extends charging time if needed to reach the maximum configured SoC. If the requestedstop_durationexceeds the time required to reach the maximum SoC, the remaining time is logged as idle stopover. -
OPTIMIZE_TRAVEL_TIME: Extends the stay beyondstop_durationonly if doing so reduces overall trip time (for example, by eliminating a subsequent charging stop). Otherwise, charges for the exact requested duration. If the requestedstop_durationexceeds the time required to reach the optimal SoC, the remaining time is logged as idle stopover.
If no value is provided, the planner optimizes charging duration purely based on the route’s charge_mode.
Examples
Calculate a route with a 30-minute non-charging stop.
On this stop, a stop_duration of 1800 seconds (30 minutes) has been added. This will be the exact stop duration.
Calculate a route with a charging stop of at least 30 minutes.
On this stop, a stop_duration of 1800 seconds (30 minutes) has been added. This will be the minimum stop duration. Because the vehicle.charging.mode:OPTIMIZE_TRAVEL_TIME, if charging longer benefits the travel time, the duration will automaticly be increased.
Calculate a route with a charging stop without a minimum stop duration.
On this stop, stop_duration is omitted. The planner calculates optimal charging time exclusively based on the choosen charging mode (OPTIMIZE_TRAVEL_TIME).
Was this content helpful?