Skip to main content
This VRP request schema is used for solving a Vehicle Routing Problem. It consists of resources, jobs, relations, options and weights.
NameTypeRequiredDescription
resources[Resource]trueList of Resources
jobs[Job]trueList of Jobs
optionsOptionsfalseOptions for solver configuration
relationsJobRelationfalseJob relations
weightsWeightsfalseWeighting the constraints
hookstring(uri)falseWebhook for getting notified after request is solved.

OnRoute Request for solving, evaluating

resources
object[]
required

List of available resources (vehicles, drivers, workers) that can be assigned to perform jobs. Each resource defines their working schedules, location constraints, capacity limits, and capabilities. At least one resource is required, with a maximum of 2000 resources per request.

Required array length: 1 - 2000 elements
jobs
object[]
required

List of jobs/tasks to be assigned to resources. Each job specifies service requirements, location, time constraints, duration, and resource preferences. Jobs represent the work that needs to be scheduled and optimized. At least one job is required, with a maximum of 10,000 jobs per request.

Required array length: 1 - 10000 elements
options
object

Options to tweak the routing engine

Example:
{
"euclidian": false,
"routingEngine": "OSM",
"partialPlanning": true,
"minimizeResources": true,
"traffic": 1.1,
"polylines": true,
"fairWorkloadPerTrip": false,
"fairWorkloadPerResource": false,
"workloadSensitivity": 0.1,
"snapUnit": 300,
"maxSuggestions": 3,
"onlyFeasibleSuggestions": true,
"explanation": {
"enabled": true,
"filterHardConstraints": true
}
}
weights
object

OnRoute Weights

Example:
{
"priorityWeight": 100,
"workloadSpreadWeight": 10,
"travelTimeWeight": 1,
"plannedWeight": 1000,
"asapWeight": 5,
"minimizeResourcesWeight": 3600,
"allowedResourcesWeight": 500,
"waitTimeWeight": 1,
"urgencyWeight": 50,
"driveTimeWeight": 1,
"clusteringWeight": 1
}
hook
string<uri> | null

Optional webhook URL that will receive a POST request with the job ID when the optimization is complete. This enables asynchronous processing where you can submit a request and be notified when results are ready, rather than waiting for the synchronous response.

customDistanceMatrices
object

Custom distance matrix configuration for multi-profile and multi-slice scenarios

Example:
{
"profileMatrices": {
"CAR": {
"6": "matrix-car-morning-123",
"9": "matrix-car-midday-456",
"16": "matrix-car-evening-789"
},
"TRUCK": {
"6": "matrix-truck-morning-abc",
"9": "matrix-truck-midday-def"
}
},
"matrixServiceUrl": "https://custom-matrix-service.com/api"
}
label
string | null
relations
object[] | null