Skip to main content
POST
/
v3
/
routing
/
solve
curl -X POST https://api.solvice.io/v3/routing/solve \
  -H "Authorization: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "vehicles": [
      {
        "id": "truck-1",
        "start": [4.3517, 50.8503],
        "end": [4.3517, 50.8503],
        "shifts": [
          {
            "from": "2026-04-01T08:00:00+02:00",
            "to": "2026-04-01T17:00:00+02:00"
          }
        ],
        "capacity": [100],
        "skills": ["refrigerated"],
        "max_duration": 28800
      }
    ],
    "jobs": [
      {
        "id": "delivery-1",
        "location": [4.7005, 50.8798],
        "demand": [10],
        "time_windows": [
          {
            "from": "2026-04-01T09:00:00+02:00",
            "to": "2026-04-01T12:00:00+02:00"
          }
        ],
        "service_duration": 300,
        "skills": ["refrigerated"]
      },
      {
        "id": "delivery-2",
        "location": [3.7303, 51.05],
        "demand": [20],
        "time_windows": [
          {
            "from": "2026-04-01T10:00:00+02:00",
            "to": "2026-04-01T15:00:00+02:00"
          }
        ],
        "service_duration": 600
      }
    ],
    "options": {
      "time_limit_ms": 5000,
      "seed": 42,
      "minimize": "time"
    }
  }'
{
  "summary": {
    "status": "completed",
    "total_distance": 142000,
    "total_duration": 7200,
    "vehicles_used": 1,
    "jobs_assigned": 2,
    "jobs_unassigned": 0,
    "elapsed_ms": 850,
    "iterations": 1200
  },
  "routes": [
    {
      "vehicle_id": "truck-1",
      "shift_from": "2026-04-01T08:00:00+02:00",
      "shift_to": "2026-04-01T17:00:00+02:00",
      "stops": [
        {
          "job_id": "delivery-2",
          "location": [3.7303, 51.05],
          "arrival": "2026-04-01T08:40:00+02:00",
          "departure": "2026-04-01T08:50:00+02:00",
          "wait_time": 0,
          "travel_time": 2400,
          "service_time": 600,
          "load_after": [20]
        },
        {
          "job_id": "delivery-1",
          "location": [4.7005, 50.8798],
          "arrival": "2026-04-01T09:50:00+02:00",
          "departure": "2026-04-01T09:55:00+02:00",
          "wait_time": 0,
          "travel_time": 3600,
          "service_time": 300,
          "load_after": [30]
        }
      ],
      "distance": 142000,
      "duration": 7200,
      "load": 30,
      "n_stops": 2,
      "start_time": "2026-04-01T08:00:00+02:00",
      "end_time": "2026-04-01T10:30:00+02:00"
    }
  ],
  "unassigned": []
}

Request body

vehicles
array
required
List of available vehicles with start/end locations, capacity, and time windows.
jobs
array
required
List of jobs (deliveries, pickups, service visits) to assign to vehicles.
relations
array
Ordering constraints between jobs. Each relation has type ("SEQUENCE" or "FIRST_JOB") and jobs (ordered list of job IDs).
options
object
Solver options.

Response

summary
object
Aggregate statistics for the solve run.
routes
array
Optimized routes, one per used vehicle.
unassigned
array
Jobs that could not be assigned, each with job_id and reason
curl -X POST https://api.solvice.io/v3/routing/solve \
  -H "Authorization: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "vehicles": [
      {
        "id": "truck-1",
        "start": [4.3517, 50.8503],
        "end": [4.3517, 50.8503],
        "shifts": [
          {
            "from": "2026-04-01T08:00:00+02:00",
            "to": "2026-04-01T17:00:00+02:00"
          }
        ],
        "capacity": [100],
        "skills": ["refrigerated"],
        "max_duration": 28800
      }
    ],
    "jobs": [
      {
        "id": "delivery-1",
        "location": [4.7005, 50.8798],
        "demand": [10],
        "time_windows": [
          {
            "from": "2026-04-01T09:00:00+02:00",
            "to": "2026-04-01T12:00:00+02:00"
          }
        ],
        "service_duration": 300,
        "skills": ["refrigerated"]
      },
      {
        "id": "delivery-2",
        "location": [3.7303, 51.05],
        "demand": [20],
        "time_windows": [
          {
            "from": "2026-04-01T10:00:00+02:00",
            "to": "2026-04-01T15:00:00+02:00"
          }
        ],
        "service_duration": 600
      }
    ],
    "options": {
      "time_limit_ms": 5000,
      "seed": 42,
      "minimize": "time"
    }
  }'
{
  "summary": {
    "status": "completed",
    "total_distance": 142000,
    "total_duration": 7200,
    "vehicles_used": 1,
    "jobs_assigned": 2,
    "jobs_unassigned": 0,
    "elapsed_ms": 850,
    "iterations": 1200
  },
  "routes": [
    {
      "vehicle_id": "truck-1",
      "shift_from": "2026-04-01T08:00:00+02:00",
      "shift_to": "2026-04-01T17:00:00+02:00",
      "stops": [
        {
          "job_id": "delivery-2",
          "location": [3.7303, 51.05],
          "arrival": "2026-04-01T08:40:00+02:00",
          "departure": "2026-04-01T08:50:00+02:00",
          "wait_time": 0,
          "travel_time": 2400,
          "service_time": 600,
          "load_after": [20]
        },
        {
          "job_id": "delivery-1",
          "location": [4.7005, 50.8798],
          "arrival": "2026-04-01T09:50:00+02:00",
          "departure": "2026-04-01T09:55:00+02:00",
          "wait_time": 0,
          "travel_time": 3600,
          "service_time": 300,
          "load_after": [30]
        }
      ],
      "distance": 142000,
      "duration": 7200,
      "load": 30,
      "n_stops": 2,
      "start_time": "2026-04-01T08:00:00+02:00",
      "end_time": "2026-04-01T10:30:00+02:00"
    }
  ],
  "unassigned": []
}