Skip to main content
POST
/
v2
/
vrp
/
sync
/
solve
Solve a routing problem (solver2-compatible V2 format)
curl --request POST \
  --url https://api.example.com/v2/vrp/sync/solve \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "jobs": [
    {
      "name": "<string>",
      "duration": 123,
      "load": [
        123
      ],
      "location": {
        "latitude": 123,
        "longitude": 123
      },
      "windows": [
        {
          "from": "<string>",
          "to": "<string>",
          "hard": true
        }
      ]
    }
  ],
  "resources": [
    {
      "name": "<string>",
      "capacity": [
        123
      ],
      "end": {
        "latitude": 123,
        "longitude": 123
      },
      "shifts": [
        {
          "from": "<string>",
          "to": "<string>",
          "end": {
            "latitude": 123,
            "longitude": 123
          },
          "start": {
            "latitude": 123,
            "longitude": 123
          }
        }
      ],
      "start": {
        "latitude": 123,
        "longitude": 123
      },
      "tags": [
        "<string>"
      ]
    }
  ],
  "options": {
    "solvingTime": 1
  },
  "relations": [
    {
      "jobs": [
        "<string>"
      ],
      "type": "<string>",
      "resource": "<string>"
    }
  ]
}
'
{
  "trips": [
    {
      "resource": "<string>",
      "visits": [
        {
          "job": "<string>",
          "arrival": "<string>",
          "distance": 123,
          "location": {
            "latitude": 123,
            "longitude": 123
          },
          "serviceTime": 123,
          "travelTime": 123
        }
      ],
      "distance": 123,
      "travelTime": 123
    }
  ],
  "totalTravelDistanceInMeters": 123,
  "totalTravelTimeInSeconds": 123,
  "unserved": [
    "<string>"
  ],
  "unservedReasons": {}
}

Authorizations

Authorization
string
header
required

Query Parameters

millis
integer<int64>

Time limit override in milliseconds

Required range: x >= 0

Body

application/json

Top-level request body for POST /v2/vrp/sync/solve.

Mirrors the solver2 OnRoute API. The mapping to V3 is handled by [crate::api::v2_compat::map_v2_request].

jobs
object[]
required

Jobs to be assigned and sequenced.

resources
object[]
required

Fleet of vehicles (called "resources" in V2).

options
object

Solver options; currently only solvingTime is honoured.

relations
object[] | null

Optional ordering constraints between jobs.

Response

Solution found

Top-level response body for POST /v2/vrp/sync/solve.

trips
object[]
required

One trip per vehicle that has at least one visit.

totalTravelDistanceInMeters
integer<int64> | null

Total travel distance across all trips in metres.

totalTravelTimeInSeconds
integer<int64> | null

Total travel time across all trips in seconds.

unserved
string[] | null

Job names that could not be assigned; None when all jobs are assigned.

unservedReasons
object

Maps each unserved job name to a list of reason strings.