Skip to main content
POST
/
v2
/
vrp
/
evaluate
Evaluate
curl --request POST \
  --url https://api.solvice.io/v2/vrp/evaluate \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "resources": [
    {
      "name": "<string>",
      "shifts": [
        {
          "from": "<string>",
          "to": "<string>",
          "start": {
            "latitude": 123,
            "longitude": 123,
            "h3Index": 123
          },
          "end": {
            "latitude": 123,
            "longitude": 123,
            "h3Index": 123
          },
          "ignoreTravelTimeToFirstJob": true,
          "ignoreTravelTimeFromLastJob": true,
          "overtime": "<unknown>",
          "overtimeEnd": "<string>",
          "breaks": [
            {
              "type": "WINDOWED"
            }
          ],
          "tags": [
            "<string>"
          ],
          "jobTypeLimitations": {}
        }
      ],
      "start": {
        "latitude": 123,
        "longitude": 123,
        "h3Index": 123
      },
      "end": {
        "latitude": 123,
        "longitude": 123,
        "h3Index": 123
      },
      "maxDriveTimeInSeconds": "<unknown>",
      "maxDriveDistance": 123,
      "region": {
        "latitude": 123,
        "longitude": 123,
        "h3Index": 123
      },
      "tags": [
        "<string>"
      ],
      "category": "CAR",
      "rules": [
        {
          "period": {
            "from": "2024-01-01T08:00:00Z",
            "to": "2024-01-07T17:00:00Z"
          },
          "minWorkTime": 123,
          "maxWorkTime": 123,
          "minServiceTime": 123,
          "maxServiceTime": 123,
          "minDriveTime": 123,
          "maxDriveTime": 123,
          "minJobComplexity": 123,
          "maxJobComplexity": 123,
          "jobTypeLimitations": {}
        }
      ],
      "capacity": [
        123
      ],
      "hourlyCost": 123,
      "compatibleResources": [
        "<string>"
      ],
      "maxDriveTime": 123,
      "maxDriveTimeJob": 123
    }
  ],
  "jobs": [
    {
      "name": "<string>",
      "duration": 123,
      "location": {
        "latitude": 123,
        "longitude": 123,
        "h3Index": 123
      },
      "priority": 123,
      "urgency": 123,
      "tags": [
        {
          "name": "<string>",
          "hard": true,
          "weight": 123
        }
      ],
      "rankings": [
        {
          "name": "<string>",
          "ranking": 50
        }
      ],
      "proficiency": [
        {
          "resource": "<string>",
          "durationModifier": 1
        }
      ],
      "windows": [
        {
          "from": "<string>",
          "to": "<string>",
          "weight": 1,
          "hard": true
        }
      ],
      "durationSquash": 123,
      "plannedDate": "<string>",
      "plannedResource": "<string>",
      "plannedArrival": "<string>",
      "hard": true,
      "hardWeight": 123,
      "padding": 123,
      "load": [
        123
      ],
      "allowedResources": [
        "<string>"
      ],
      "initialResource": "<string>",
      "initialArrival": "<string>",
      "disallowedResources": [
        "<string>"
      ],
      "complexity": 123,
      "resumable": true,
      "jobTypes": [
        "<string>"
      ]
    }
  ],
  "options": {
    "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": {
    "priorityWeight": 100,
    "workloadSpreadWeight": 10,
    "travelTimeWeight": 1,
    "plannedWeight": 1000,
    "asapWeight": 5,
    "minimizeResourcesWeight": 3600,
    "allowedResourcesWeight": 500,
    "waitTimeWeight": 1,
    "urgencyWeight": 50,
    "driveTimeWeight": 1,
    "clusteringWeight": 1
  },
  "hook": "<string>",
  "customDistanceMatrices": {
    "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>",
  "relations": [
    {
      "type": "SAME_TRIP",
      "jobs": [
        "<string>"
      ],
      "timeInterval": "FROM_ARRIVAL",
      "resource": "<string>",
      "minTimeInterval": 123,
      "maxTimeInterval": 123,
      "partialPlanning": true,
      "maxWaitingTime": 123,
      "tags": [
        "<string>"
      ],
      "enforceCompatibility": true,
      "hardMinWait": true,
      "weight": 123
    }
  ]
}
'
{
  "id": "<string>",
  "status": "QUEUED",
  "solveDuration": 123,
  "errors": [
    {
      "message": "<string>",
      "code": 123
    }
  ],
  "warnings": [
    {
      "message": "<string>",
      "code": 123
    }
  ]
}

Authorizations

Authorization
string
header
required

Api Key based authentication (apikey)

Body

application/json

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

Response

Status

Status of a solve job

id
string
required

Job ID

status
enum<string> | null

Status of the solve.

Available options:
QUEUED,
SOLVING,
SOLVED,
ERROR
Example:

"SOLVING"

solveDuration
integer<int32> | null

Duration of the solve in seconds

errors
object[] | null

List of errors

warnings
object[] | null

List of warnings