Route planning
Geocode stops, plan truck-legal routes per leg with scored alternatives, read the composite route and itinerary, override a leg's option, suggest breaks and apply the plan to the trip.
| Method | Endpoint | Purpose |
|---|---|---|
GET |
/v1/route/geocode?q=&lat=&lng= |
TomTom address search (biased to a point); rate-limited per session (RP-805) |
GET |
/v1/route/reverse-geocode?lat=&lng= |
Address for a dropped pin |
GET |
/v1/route/settings/{trip_id} · POST /v1/route/settings/{trip_id} |
Truck profile overrides, constraints, schedule, fuel and POI settings |
POST |
/v1/route/plan/{trip_id} |
Plan every leg: alternatives, scoring, POIs, schedule → a draft route |
GET |
/v1/route/get/{route_id} · /v1/route/list/{trip_id} |
One route with legs, options, schedule, geometry · summary list |
POST |
/v1/route/select-option/{route_id} |
leg_id, option_id — override the pre-selected alternative for a leg |
POST |
/v1/route/suggest-breaks/{route_id} |
Recompute break / fuel / overnight suggestions with the current settings |
GET |
/v1/route/pois/{route_id}?leg_id=&category= |
Fuel, truck stops, hotels, rest areas along a leg |
POST |
/v1/route/apply/{route_id} |
Insert suggested stops, write ETAs to the stops, mark the route current |
POST |
/v1/route/calculate |
Ad-hoc A→B truck route without saving (from_lat/lng, to_lat/lng, profile fields) |
Examples on this page are not recorded automatically because they would call TomTom; shapes below are taken from the response presenters.
Plan
POST /v1/route/plan/{trip_id} requires every stop to be pinned (RP-810) and a trailer with a tow vehicle. Legs are routed one by one with the truck profile derived from the vehicle, the trailer and the tallest boat on that leg; each leg gets up to max_alternatives options, each scored.
{
"success": true,
"route": {
"route_id": 41, "status": "draft", "provider": "tomtom",
"profile": { "height_in": 158, "length_in": 744, "weight_lb": 13900, "axles": 3 },
"legs": [
{
"leg_id": 7, "from_stop_id": 21, "to_stop_id": 22, "selected_option_id": 301,
"options": [
{ "option_id": 301, "distance_mi": 212.4, "travel_minutes": 221, "motorway_share": 0.91,
"longest_fuel_gap_mi": 68, "hotels_near_end": 4, "tolls": 1, "score": 86.2, "reasons": ["mostly interstate", "fuel within 70 mi"] },
{ "option_id": 302, "distance_mi": 198.7, "travel_minutes": 236, "motorway_share": 0.44,
"longest_fuel_gap_mi": 103, "hotels_near_end": 4, "tolls": 0, "score": 71.0, "reasons": ["103 mi without fuel"] }
]
}
],
"schedule": {
"days": [
{ "date": "2027-05-14", "start_local": "2027-05-14T07:00:00-04:00", "end_local": "2027-05-14T17:10:00-04:00",
"entries": [
{ "kind": "depart", "stop_id": 21, "at_local": "2027-05-14T07:00:00-04:00" },
{ "kind": "break", "after_minutes": 150, "minutes": 20, "poi_id": "tt:…" },
{ "kind": "fuel", "mile": 190, "minutes": 25, "poi_id": "tt:…" },
{ "kind": "arrive", "stop_id": 22, "at_local": "2027-05-14T12:41:00-04:00" }
] }
]
},
"geometry": { "type": "MultiLineString", "coordinates": "…simplified to 5 m…" }
}
}
Provider failures map to RP-801 (quota, 429), RP-802 (no drivable route, 422), RP-803 (provider error, 502).
Override a leg
POST /v1/route/select-option/41
Authorization: Bearer rp_live_••••••••
leg_id=7&option_id=302
Returns the route with the composite totals recomputed. A stop change after planning invalidates the route (RP-817) — plan again.
Apply
POST /v1/route/apply/{route_id} inserts the schedule's fuel, break and overnight suggestions as stops (source: "tomtom", removable individually), writes planned arrival/departure to every stop from the schedule, marks the route current and archives previous drafts. Re-planning later starts a new draft; the trip page, public page and driver links always show the current route.