OptimizeToursRequest
boolean ( true
/ false
)
If true
, the request is processed even if the timeout is set to a large value (longer than 30 minutes) that risks potential server interruptions.
boolean ( true
/ false
)
If true
, uses traffic data for routing. If false, uses road network speeds only.
number
When useGeodesicDistances
is true, this speed is used to calculate travel times.
Routes from a previous solution to start the optimization from.
Constrains the solution to be similar to existing routes, specifying which properties must be preserved and which may be relaxed.
boolean ( true
/ false
)
If true
, matches shipments/vehicles in injected routes by their label
instead of array index.
string
Arbitrary label to identify the request, returned in the response.
integer
Specifies the maximum number of validation errors to return. If unspecified, a default limit applies.
Required. The set of vehicles and shipments to be optimized.
boolean ( true
/ false
)
If true
, returns encoded polylines for routes.
boolean ( true
/ false
)
If true
, returns encoded polylines for individual transitions between visits.
A list of routes to be refreshed. This recalculates polylines, durations, and distances for existing routes without modifying the visit sequence.
RETURN_FAST
(quick results) or CONSUME_ALL_AVAILABLE_TIME
(best quality within timeout).
DEFAULT_SOLVE
(default) or VALIDATE_ONLY
to validate the model without solving.
The maximum duration the solver should run (e.g., "30s", "300s").
boolean ( true
/ false
)
If true
, travel distances and times are calculated using geodesic (straight-line) distances and the geodesicMetersPerSecond
speed.
Specifies custom duration and distance matrixes used for routing between locations.
array of strings
Tags defining the destinations (columns) for the custom duration and distance matrixes.
array of strings
Tags defining the sources (rows) for the custom duration and distance matrixes.
number
Cost per hour of the global time span of the route, from the earliest vehicle start to the latest vehicle end.
Latest end time for any event in the model.
Earliest start time for any event in the model.
integer
Maximum number of vehicles allowed to be active in the solution.
Rules defining ordering constraints between specific shipments.
The list of shipments to be serviced.
Rules preventing shipments of certain types from being serviced by the same vehicle.
Rules requiring shipments of certain types to be serviced by the same vehicle.
Specifies extra costs, delays, and distance limits for transitions between visits with specific tags.
The list of vehicles available to perform the shipments.
array of integers
Indices of vehicles allowed to perform this shipment.
map (key: integer, value: number)
Additional costs incurred if a specific vehicle services this shipment.
array of integers
Indices of vehicles to which costsPerVehicle
values apply.
Alternatives for delivering the shipment.
boolean ( true
/ false
)
If true
, the shipment is ignored and not used in optimization.
string
User-defined label for identifying the shipment, returned in the response.
map (key: string, value: Load
)
The capacity required (e.g., weight, volume) to carry this shipment.
number
Cost if the shipment is not serviced. If unset, the shipment is mandatory.
Alternatives for picking up the shipment.
The maximum absolute detour time allowed between pickup and delivery compared to the direct path.
number
The maximum relative detour allowed for the shipment (e.g., a value of 2.0 means the total time can be at most 2x the direct travel time).
The maximum allowed duration from the start of the pickup to the start of the delivery.
string
Type classification used for incompatibility and requirement rules.
VisitRequest
(A component of pickups
and deliveries
in Shipment
)
The geographic arrival location as latitude/longitude coordinates.
The location where the vehicle arrives to perform the visit. Defined by coordinates or a place ID.
number
The cost incurred if this specific visit request is selected by the solver.
The geographic departure location as latitude/longitude coordinates.
The location where the vehicle departs after completing the visit. If omitted, it is assumed to be the same as the arrivalWaypoint
.
The duration of the visit (service time), e.g., how long it takes to load/unload.
string
User-defined label for this specific visit request, returned in the response.
map (key: string, value: Load
)
Demands specifying the load change at this visit (e.g., -1 to drop off a package).
array of strings
Tags attached to this visit request. These are used to calculate travel times between this visit and others using transitionAttributes
.
The allowed time windows for the arrival at this visit.
array of strings
Strings describing the type of visit (e.g., "delivery", "installation"). Used to apply extraVisitDurationForVisitType
from the Vehicle model.
Defines rules for breaks (e.g., mandatory lunch break).
number
Cost per hour of the total route duration.
number
Cost per kilometer traveled.
number
Cost per hour while the vehicle is moving.
The geographic end location as latitude/longitude coordinates.
array of strings
Tags defining the vehicle's end state, used for transition attributes.
Allowed windows for the vehicle to end its route.
Geographic end location using a Waypoint (coordinates or place ID).
Adds extra duration to visits based on their visitType
.
number
A fixed cost that's applied if the vehicle is used, regardless of the route's distance or duration.
boolean ( true
/ false
)
If true
, the vehicle is ignored and not used in optimization.
string
User-defined label for the vehicle, returned in the response.
Vehicle capacities (e.g., max weight, max volume).
A hard or soft limit on the total distance of the vehicle's route.
A hard or soft limit on the total duration of the vehicle's route.
One or several constraints like avoiding tolls, highways, or ferries.
The geographic start location as latitude/longitude coordinates.
array of strings
Tags defining the vehicle's start state, used for transition attributes.
Allowed windows for the vehicle to start its route.
Geographic start location using a Waypoint (coordinates or place ID).
A hard or soft limit on the total travel duration (excluding wait/service time) of the vehicle.
number
Multiplier applied to travel times (e.g., 1.5 makes travel 50% slower).
The travel mode (e.g., DRIVING
, WALKING
). Affects travel times and distances.
Defines order of unloading (e.g., LIFO
or LAST_IN_FIRST_OUT
).
boolean ( true
/ false
)
If true
, the vehicle is considered used even without shipments. It incurs fixed costs and travels between its start and end locations.