VRP request schema is used for solving a Vehicle Routing Problem. It consists of resources, jobs, relations, options
and weights.
| Name | Type | Required | Description |
|---|---|---|---|
resources | [Resource] | true | List of Resources |
jobs | [Job] | true | List of Jobs |
options | Options | false | Options for solver configuration |
relations | JobRelation | false | Job relations |
weights | Weights | false | Weighting the constraints |
hook | string(uri) | false | Webhook for getting notified after request is solved. |
OnRoute Request for solving, evaluating
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.
1 - 2000 elementsList 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.
1 - 10000 elementsOptions to tweak the routing engine
{
"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
}
}OnRoute Weights
{
"priorityWeight": 100,
"workloadSpreadWeight": 10,
"travelTimeWeight": 1,
"plannedWeight": 1000,
"asapWeight": 5,
"minimizeResourcesWeight": 3600,
"allowedResourcesWeight": 500,
"waitTimeWeight": 1,
"urgencyWeight": 50,
"driveTimeWeight": 1,
"clusteringWeight": 1
}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.
Custom distance matrix configuration for multi-profile and multi-slice scenarios
{
"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"
}