POST/api/v1/optimize

Optimize a route

Compute the optimal stop order with arrival times, distance and duration.

https://app.otiggo.com/api/v1/optimize

Billing

  • 1 stop credit per stop in the request (not per kilometer)
  • 2–200 stops per call in production
  • Failed optimizations are refunded automatically

Request body

ParamTypeDescription
startrequiredLocationDeparture point. Coordinates or street + postalCode + city.
endoptionalLocationOptional return point. Same shape as start.
stopsrequiredStop[]Array of stops (2–200). Each needs a unique id and a location.
departureTimeoptionalstring (ISO 8601)Optional departure datetime used for the schedule.
avoidTollsoptionalbooleanWhen true, prefer routes without tolls.

Location

Either coordinates, or a full address (geocoded server-side — live keys only).

ParamTypeDescription
latitudeoptionalnumber−90 … 90
longitudeoptionalnumber−180 … 180
streetoptionalstringStreet address
postalCodeoptionalstringPostal code
cityoptionalstringCity

Stop

ParamTypeDescription
idrequiredstringUnique id (max 100 chars). Returned in order and schedule.
deadlineoptionalstringOptional "HH:MM" deadline in Europe/Paris time.
serviceSecondsoptionalnumberOptional time spent at the stop (0–3600).

Response fields

ParamTypeDescription
orderoptionalstring[]Optimal stop ids in visit order.
waypointsoptionalobject[]id, order, latitude, longitude for each stop.
totalDistanceKmoptionalnumberTotal route distance.
estimatedTimeMinoptionalnumberEstimated duration in minutes.
scheduleoptionalobject[]Arrival times per stop (colisId, arrivee).
departAt / returnAtoptionalstring | nullISO departure and return times.
lateStopsoptionalobject[] | nullStops past their deadline, if any.
stopsChargedoptionalnumberCredits charged (0 in sandbox).
stopsBalanceoptionalnumberRemaining balance (live only).