# Minimal Example
A request with one vehicle, one vehicle type, four services, a relation, and an objective to minimize total time. One service exceeds the vehicle's capacity and will be left unassigned. The `in_direct_sequence` relation forces order-3 to be served immediately after the vehicle's start, followed immediately by order-2:

```json
{
  "vehicles": [
    {
      "vehicle_id": "driver-1",
      "type_id": "van",
      "start_address": { "location_id": "depot", "lon": 13.3888, "lat": 52.5170 },
      "earliest_start": 1746612000
    }
  ],
  "vehicle_types": [
    {
      "type_id": "van",
      "profile": "car",
      "capacity": [10]
    }
  ],
  "services": [
    {
      "id": "order-1",
      "address": { "location_id": "order-1", "lon": 13.3762, "lat": 52.5206 },
      "size": [2],
      "duration": 300,
      "time_windows": [{ "earliest": 1746612000, "latest": 1746615600 }]
    },
    {
      "id": "order-2",
      "address": { "location_id": "order-2", "lon": 13.4050, "lat": 52.5200 },
      "size": [3],
      "duration": 300
    },
    {
      "id": "order-3",
      "address": { "location_id": "order-3", "lon": 13.4270, "lat": 52.5230 },
      "size": [1],
      "duration": 300
    },
    {
      "id": "order-4",
      "address": { "location_id": "order-4", "lon": 13.395163, "lat": 52.526215 },
      "size": [20],
      "duration": 300
    }
  ],
  "objectives": [
    { "type": "min", "value": "completion_time" }
  ],
  "relations": [ { "type": "in_direct_sequence", "ids": ["start","order-3","order-2"] } ],
  "configuration": { "routing": { "calc_points": true } }
}
```
The response contains a `solution` with a `routes` array (one per used vehicle) and an `unassigned` object for orders that could not be placed:

```json
{
  "solution": {
    "distance": 10424,
    "transport_time": 1279,
    "completion_time": 2179,
    "no_vehicles": 1,
    "no_unassigned": 1,
    "routes": [
      {
        "vehicle_id": "driver-1",
        "points": [
          { "type": "LineString", "coordinates": [[13.3888,52.517],"...",  [13.427,52.523]] },
          { "type": "LineString", "coordinates": [[13.427,52.523], "...", [13.405,52.52]] },
          { "type": "LineString", "coordinates": [[13.405,52.52],  "...", [13.3762,52.5207]] },
          { "type": "LineString", "coordinates": [[13.3762,52.5207],"...",[13.3888,52.517]] }
        ],
        "activities": [
          { "type": "start", "location_id": "depot", "arr_time": 1746612000, "end_time": 1746612000, "load_after": [0] },
          { "type": "service", "id": "order-3", "location_id": "order-3", "arr_time": 1746612352, "end_time": 1746612652, "load_before": [0], "load_after": [1] },
          { "type": "service", "id": "order-2", "location_id": "order-2", "arr_time": 1746612966, "end_time": 1746613266, "load_before": [1], "load_after": [4] },
          { "type": "service", "id": "order-1", "location_id": "order-1", "arr_time": 1746613640, "end_time": 1746613940, "load_before": [4], "load_after": [6], "time_window": { "earliest": 1746612000, "latest": 1746615600 } },
          { "type": "end", "location_id": "depot", "arr_time": 1746614179, "end_time": 1746614179, "load_before": [6] }
        ]
      }
    ],
    "unassigned": {
      "services": ["order-4"],
      "details": [{ "id": "order-4", "code": 3, "reason": "does not fit into any vehicle due to capacity" }]
    }
  }
}
```
Note that `time_windows` use Unix timestamps (recommended). The `in_direct_sequence` relation forced the solver to visit order-3 then order-2 immediately after the start, even though a different sequence might have been shorter. `order-4` was left unassigned with reason code 3 (capacity exceeded: size 20 vs. vehicle capacity 10). Because `configuration.routing.calc_points` is `true`, the response includes a `points` array with one LineString geometry per leg — use these to render routes on a map without a separate Routing API call.
