moovexDocs

Create Routes

Generate optimized trips from bookings

POST/routing/create

Generate optimized trips from a set of bookings. The engine clusters stops, sequences them optimally, and returns trips with route geometry. This endpoint is asynchronous - it returns a production ID to poll for results.

Request Body

FieldTypeRequiredDescription
jobsJob[]YesArray of bookings to route
tripsTrip[]NoExisting trips to potentially join jobs to
settingsRoutingSettingsNoRouting configuration
areasArea[]NoGeographic zones for area-based rules
attributesAttribute[]NoService attributes
profilesProfile[]NoService profiles that can share rides
locationsLocation[]NoKnown locations with custom stop times
trafficTrafficSettingsNoTraffic adjustment settings

Job

FieldTypeRequiredDescription
idstringYesUnique job identifier
fromCoordinatesYesPickup location
fromAddrstringNoPickup address display name
toCoordinatesYesDrop-off location
toAddrstringNoDrop-off address display name
pickISO8601Yes*Requested pickup time
dropISO8601Yes*Requested drop-off time
seatsnumberYesNumber of seats required
passengerstringNoPassenger name/identifier
phonestringNoContact phone number
attrstring[]NoRequired attributes (wheelchair, child_seat, etc.)
unitstringNoSite/unit identifier for multi-tenant routing
privatebooleanNoIf true, job cannot be shared with others
forceJoinstringNoGroup ID - jobs with same value must route together
waitAndReturnIdstringNoLinks outbound and return legs
profileNamestringNoService profile name

*Either pick or drop must be provided.

Coordinates

FieldTypeRequiredDescription
latnumberYesLatitude
lngnumberYesLongitude

RoutingSettings

SettingTypeDefaultDescription
maxSinglePassengerTimeRangeValue60Max passenger ride time (minutes)
maxTripDurationRangeValue120Max total trip duration (minutes)
maxTripStopsnumber10Maximum stops per trip
maxPickupStopsnumber-Maximum pickup stops per trip
maxDropoffStopsnumber-Maximum drop-off stops per trip
maxPassengersnumber8Maximum total passengers per trip
maxPassengersAtOncenumber4Max passengers at any point
maxReservationsAtOncenumber4Max jobs at any point
sharedRideRationumber1.5Max shared-ride vs direct ratio
sharedRideDifferenceLimitnumber15Max additional minutes vs direct
maxBoardingDelaynumber15How late driver can arrive (minutes)
maxBoardingEarlynumber15How early driver can arrive (minutes)
maxDropOffDelaynumber15How late for drop-off (minutes)
maxDropOffEarlynumber15How early for drop-off (minutes)
tripBoardingTimenumber120Time to complete pickup (seconds)
tripDropOffTimenumber60Time to complete drop-off (seconds)
waitForBoardingTimebooleanfalseWait until exact pickup time
onlyPrivatebooleanfalseDisable all ride sharing
isClusteringEnabledbooleantrueEnable stop clustering
clusterReservationsRadiusnumber200Cluster radius (meters)

RangeValue

For settings that vary by distance:

{
  "value": 60,
  "ranges": [
    { "from": 0, "to": 10000, "value": 45 },
    { "from": 10000, "to": 50000, "value": 60 }
  ]
}
FieldTypeDescription
valuenumberDefault value
rangesRange[]Distance-based overrides
ranges[].fromnumberStart distance (meters)
ranges[].tonumberEnd distance (meters)
ranges[].valuenumberValue for this range

Example Response

{
  "productionId": "prod_xyz789",
  "status": "processing"
}

Poll the Get Route Result endpoint with the productionId to retrieve the optimized trips.

On this page