Skip to content

The Problem object (request)

Reference · API reference

The request body has four parts. Only problem is required.

{
  "problem":       { "fleet": [  ], "jobs": [  ] },
  "objective":     1,
  "configuration": {  },
  "version":       "1.2"
}
Field Required What it is
problem The fleet and the jobs to route.
objective What "best" means. Default 1. See Enums.
configuration Units, polylines, and constraint switches.
version Optional contract version tag.

problem.fleet[] — your vehicles

At least one vehicle. Each vehicle:

Field Required Notes
id Unique integer.
capacities[] Named buckets: { "name": "parcels", "units": 40 }. Order matters — it aligns with a task's demand.
shifts[] Working periods (see below).
skills[] Skills the vehicle/driver provides, matched to job skills.
limits { maxDistance, maxStops, lifoDepth }.
lastKnownLocation Current position (re-optimization only).
routeTemplateId Apply a saved template (v1.1+).
maxInstances Max route instances this vehicle may run.

Shiftstart and end each have a time (ISO 8601 with offset) and a location. Optional breaks[], each with a serviceWindow, duration (seconds), and location.

{
  "id": 1,
  "capacities": [{ "name": "parcels", "units": 40 }],
  "shifts": [{
    "start": { "time": "2026-07-31T08:00:00-07:00", "location": [49.28270, -123.11540] },
    "end":   { "time": "2026-07-31T17:00:00-07:00", "location": [49.28270, -123.11540] },
    "breaks": [{ "serviceWindow": { "start": "2026-07-31T12:00:00-07:00", "end": "2026-07-31T13:00:00-07:00" }, "duration": 1800 }]
  }]
}

problem.jobs[] — the work

At least one job. Each job has an id and pickups and/or deliveries — arrays of task objects.

Task fields:

Field Required Notes
id Unique integer.
location [lat, lng] or { "lat":…, "lng":… }. Use ≥ 5 decimals.
serviceWindows[] Allowed time ranges (start/end).
duration Service time at the stop, in seconds.
demand[] Capacity consumed, aligned to the vehicle capacities order.
skills[] Skills this task requires.
status pending / in_progress / performed (re-optimization).
vehicleId, eta Current assignment/ETA (re-optimization).
{
  "id": 101,
  "deliveries": [{
    "id": 1001,
    "location": [49.26340, -123.13830],
    "serviceWindows": [{ "start": "2026-07-31T09:00:00-07:00", "end": "2026-07-31T12:00:00-07:00" }],
    "duration": 300,
    "demand": [2]
  }]
}

Job shapes

A job can be pickup-only, delivery-only, or pickup-and-delivery. What it can't be: multiple pickups and multiple deliveries in the same job. See Enums, limits and rules.

Related: The Solution object · Enums, limits and rules · Recipes