> ## Documentation Index
> Fetch the complete documentation index at: https://docs.solvice.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Transport and 4PL

> A worked V3 example: nine pallet orders between terminals, suppliers and distribution centres, three trucks with driving-time breaks, a customs stop that must follow its pickup, one solve, then the plan with two orders the fleet cannot carry and one it declines

> [!NOTE]
>
> **V3 is in beta.** General availability (GA) is planned for 1 December 2026.

A fourth-party logistics coordinator plans a Monday of pallet transport across Belgium for a client. Nine orders have to move between a container terminal, suppliers, a cross-dock and distribution centres, each with a pickup window and a delivery window. One container has to clear a customs scan on the way out of the port before it goes anywhere, and if the scan cannot happen the container stays. One order is dangerous goods and needs a certified truck. One is a spot-market load the coordinator will take only if a truck is passing anyway. The three trucks are not alike, and their drivers' driving time is regulated.

This page models that day, solves it with `POST /v3/routing/solve`, and reads the plan: how a shipment appears as two stops, how a chain of three stops is kept together and served as a whole or not at all, where the driving-time breaks fall, and why two orders are left out with a number attached to each. The response is real output for the request shown. Yours can differ in the travel figures, if the road data has changed since, and in `timings`.

## The business rules

| Rule, as the planner states it | V3 field |
| - | - |
| An order is picked up at one address and delivered at another by the same truck, pickup first | A `shipments[]` entry with `pickup` and `delivery`. Same vehicle and pickup-before-delivery are built in; no relation is needed |
| Each address has a window in which it loads or receives | `time_windows` on the `pickup` and on the `delivery`, hard: no `per_late_hour` |
| An order is a number of pallets, and a truck has a number of pallet places | `load: { "pallets": n }` on the shipment, `capacity: { "pallets": n }` on the vehicle |
| The port container is scanned at the customs site right after pickup, then goes straight to the DC, nothing in between | A `consecutive` relation over `ord-port-zaventem:pickup`, `customs-scan-port` and `ord-port-zaventem:delivery`, plus a `same_route` relation over the same three stops |
| If the scan cannot happen today, do not move the container at all | An `all_or_none` relation over the shipment id and the scan job |
| Dangerous goods go on the ADR-certified truck | `required_skills: [{ "name": "adr" }]` on the shipment, `skills` on `truck-c` |
| The spot load is worth taking only if it costs less than 180 to serve | `drop_cost: 180` on that shipment |
| A driver takes 45 minutes after 4 hours 30 of driving | A `triggered` break with `after: "drive"`, `threshold_s: 16200`, `duration_s: 2700` on each shift |
| A truck is out at most 13 hours door to door, and may run up to an hour past 17:00 at a penalty | `limits.max_route_duration_s: 46800`, and `shifts[].max_overtime_s: 3600` with `per_overtime_hour: 90` |
| A truck that goes out costs 150, plus 45 an hour and 0.90 a kilometre | `objective.costs`: `per_route`, `per_route_hour`, `per_travel_km` |

The chain rule is the one that needs three relations, and each does one thing. `consecutive` forbids anything between the three stops when they share a route. `same_route` makes them share a route. `all_or_none` makes them stand or fall together, and it is allowed on this group because the group is exactly one `consecutive` chain; that is the form that lets a shipment id stand for both its legs. Drop any one of the three and the rule changes: without `same_route`, the scan could go on another truck; without `all_or_none`, the scan could be served and the container left behind.

## The data

All times are local time on 17 November 2026, written with the `+01:00` offset. Coordinates are `[longitude, latitude]`.

| Vehicle | Pallets | Skills | Shift |
| - | - | - | - |
| `truck-a` | 33 | | 05:00 to 17:00 from the Willebroek depot, up to 1 h overtime |
| `truck-b` | 33 | | the same |
| `truck-c` | 18 | `adr` | the same |

| Order | From, window | To, window | Pallets | Notes |
| - | - | - | - | - |
| `ord-port-zaventem` | port terminal, 06:00 to 09:00 | Zaventem DC, 09:00 to 14:00 | 30 | chained with `customs-scan-port`, a 40-minute job at the scanning site, 06:00 to 12:00 |
| `ord-gentxd-hasselt` | Ghent cross-dock, 06:00 to 10:00 | Hasselt, 10:00 to 16:00 | 24 | |
| `ord-gentxd-leuven` | Ghent cross-dock, 06:00 to 10:00 | Leuven, 09:00 to 15:00 | 8 | |
| `ord-kortrijk-mechelen` | Kortrijk, 07:00 to 11:00 | Mechelen, 11:00 to 16:00 | 12 | |
| `ord-aalst-liege` | Aalst, 06:00 to 09:00 | Liège, 11:00 to 15:00 | 16 | |
| `ord-roeselare-sintniklaas` | Roeselare, 07:00 to 10:00 | Sint-Niklaas, 10:00 to 14:00 | 10 | |
| `ord-chem-turnhout` | Sint-Niklaas, 08:00 to 11:00 | Turnhout, 12:00 to 16:00 | 6 | `adr` |
| `ord-spot-mons` | Zaventem, 12:00 to 14:00 | Mons, 14:00 to 17:00 | 14 | optional, `drop_cost: 180` |
| `ord-zeebrugge-namur` | Zeebrugge, 07:00 to 08:00 | Namur, 10:00 to 12:00 | 20 | |

Every pickup and delivery takes 25 minutes. The nine orders are 140 pallets; the three trucks have 84 places between them, so the day only works with trucks delivering and loading again, and some orders may not fit.

## The request

The complete body, as sent. `POST /v3/routing/validate/solve` checks the relations before anything else: it rejects a relation that names a shipment id where only a leg id is allowed, an `all_or_none` group that is not one `consecutive` chain, and a `consecutive` relation that gives a stop two successors.

```bash theme={null}
curl -X POST https://api.solvice.io/v3/routing/solve \
  -H "Authorization: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "problem": {
      "depots": [{"id": "willebroek", "location": [4.36, 51.06]}],
      "vehicles": [
        {
          "id": "truck-a",
          "capacity": {"pallets": 33},
          "shifts": [
            {
              "id": "mon",
              "from": "2026-11-17T05:00:00+01:00",
              "to": "2026-11-17T17:00:00+01:00",
              "start": {"depot": "willebroek"},
              "end": {"depot": "willebroek"},
              "max_overtime_s": 3600,
              "breaks": [
                {"type": "triggered", "after": "drive", "threshold_s": 16200, "duration_s": 2700}
              ]
            }
          ],
          "limits": {"max_route_duration_s": 46800}
        },
        {
          "id": "truck-b",
          "capacity": {"pallets": 33},
          "shifts": [
            {
              "id": "mon",
              "from": "2026-11-17T05:00:00+01:00",
              "to": "2026-11-17T17:00:00+01:00",
              "start": {"depot": "willebroek"},
              "end": {"depot": "willebroek"},
              "max_overtime_s": 3600,
              "breaks": [
                {"type": "triggered", "after": "drive", "threshold_s": 16200, "duration_s": 2700}
              ]
            }
          ],
          "limits": {"max_route_duration_s": 46800}
        },
        {
          "id": "truck-c",
          "capacity": {"pallets": 18},
          "shifts": [
            {
              "id": "mon",
              "from": "2026-11-17T05:00:00+01:00",
              "to": "2026-11-17T17:00:00+01:00",
              "start": {"depot": "willebroek"},
              "end": {"depot": "willebroek"},
              "max_overtime_s": 3600,
              "breaks": [
                {"type": "triggered", "after": "drive", "threshold_s": 16200, "duration_s": 2700}
              ]
            }
          ],
          "limits": {"max_route_duration_s": 46800},
          "skills": [{"name": "adr"}]
        }
      ],
      "shipments": [
        {
          "id": "ord-port-zaventem",
          "pickup": {
            "location": [4.33, 51.3],
            "service_duration_s": 1500,
            "time_windows": [{"from": "2026-11-17T06:00:00+01:00", "to": "2026-11-17T09:00:00+01:00"}]
          },
          "delivery": {
            "location": [4.47, 50.88],
            "service_duration_s": 1500,
            "time_windows": [{"from": "2026-11-17T09:00:00+01:00", "to": "2026-11-17T14:00:00+01:00"}]
          },
          "load": {"pallets": 30}
        },
        {
          "id": "ord-gentxd-hasselt",
          "pickup": {
            "location": [3.72, 51.09],
            "service_duration_s": 1500,
            "time_windows": [{"from": "2026-11-17T06:00:00+01:00", "to": "2026-11-17T10:00:00+01:00"}]
          },
          "delivery": {
            "location": [5.34, 50.93],
            "service_duration_s": 1500,
            "time_windows": [{"from": "2026-11-17T10:00:00+01:00", "to": "2026-11-17T16:00:00+01:00"}]
          },
          "load": {"pallets": 24}
        },
        {
          "id": "ord-gentxd-leuven",
          "pickup": {
            "location": [3.72, 51.09],
            "service_duration_s": 1500,
            "time_windows": [{"from": "2026-11-17T06:00:00+01:00", "to": "2026-11-17T10:00:00+01:00"}]
          },
          "delivery": {
            "location": [4.7, 50.88],
            "service_duration_s": 1500,
            "time_windows": [{"from": "2026-11-17T09:00:00+01:00", "to": "2026-11-17T15:00:00+01:00"}]
          },
          "load": {"pallets": 8}
        },
        {
          "id": "ord-kortrijk-mechelen",
          "pickup": {
            "location": [3.27, 50.83],
            "service_duration_s": 1500,
            "time_windows": [{"from": "2026-11-17T07:00:00+01:00", "to": "2026-11-17T11:00:00+01:00"}]
          },
          "delivery": {
            "location": [4.48, 51.03],
            "service_duration_s": 1500,
            "time_windows": [{"from": "2026-11-17T11:00:00+01:00", "to": "2026-11-17T16:00:00+01:00"}]
          },
          "load": {"pallets": 12}
        },
        {
          "id": "ord-aalst-liege",
          "pickup": {
            "location": [4.04, 50.94],
            "service_duration_s": 1500,
            "time_windows": [{"from": "2026-11-17T06:00:00+01:00", "to": "2026-11-17T09:00:00+01:00"}]
          },
          "delivery": {
            "location": [5.57, 50.63],
            "service_duration_s": 1500,
            "time_windows": [{"from": "2026-11-17T11:00:00+01:00", "to": "2026-11-17T15:00:00+01:00"}]
          },
          "load": {"pallets": 16}
        },
        {
          "id": "ord-roeselare-sintniklaas",
          "pickup": {
            "location": [3.12, 50.95],
            "service_duration_s": 1500,
            "time_windows": [{"from": "2026-11-17T07:00:00+01:00", "to": "2026-11-17T10:00:00+01:00"}]
          },
          "delivery": {
            "location": [4.14, 51.17],
            "service_duration_s": 1500,
            "time_windows": [{"from": "2026-11-17T10:00:00+01:00", "to": "2026-11-17T14:00:00+01:00"}]
          },
          "load": {"pallets": 10}
        },
        {
          "id": "ord-chem-turnhout",
          "pickup": {
            "location": [4.14, 51.17],
            "service_duration_s": 1500,
            "time_windows": [{"from": "2026-11-17T08:00:00+01:00", "to": "2026-11-17T11:00:00+01:00"}]
          },
          "delivery": {
            "location": [4.95, 51.32],
            "service_duration_s": 1500,
            "time_windows": [{"from": "2026-11-17T12:00:00+01:00", "to": "2026-11-17T16:00:00+01:00"}]
          },
          "load": {"pallets": 6},
          "required_skills": [{"name": "adr"}]
        },
        {
          "id": "ord-spot-mons",
          "pickup": {
            "location": [4.47, 50.88],
            "service_duration_s": 1500,
            "time_windows": [{"from": "2026-11-17T12:00:00+01:00", "to": "2026-11-17T14:00:00+01:00"}]
          },
          "delivery": {
            "location": [3.95, 50.45],
            "service_duration_s": 1500,
            "time_windows": [{"from": "2026-11-17T14:00:00+01:00", "to": "2026-11-17T17:00:00+01:00"}]
          },
          "load": {"pallets": 14},
          "drop_cost": 180
        },
        {
          "id": "ord-zeebrugge-namur",
          "pickup": {
            "location": [3.19, 51.33],
            "service_duration_s": 1500,
            "time_windows": [{"from": "2026-11-17T07:00:00+01:00", "to": "2026-11-17T08:00:00+01:00"}]
          },
          "delivery": {
            "location": [4.87, 50.47],
            "service_duration_s": 1500,
            "time_windows": [{"from": "2026-11-17T10:00:00+01:00", "to": "2026-11-17T12:00:00+01:00"}]
          },
          "load": {"pallets": 20}
        }
      ],
      "jobs": [
        {
          "id": "customs-scan-port",
          "location": [4.302, 51.282],
          "service_duration_s": 2400,
          "time_windows": [{"from": "2026-11-17T06:00:00+01:00", "to": "2026-11-17T12:00:00+01:00"}]
        }
      ],
      "relations": [
        {
          "type": "consecutive",
          "stops": ["ord-port-zaventem:pickup", "customs-scan-port", "ord-port-zaventem:delivery"]
        },
        {
          "type": "same_route",
          "stops": ["ord-port-zaventem:pickup", "customs-scan-port", "ord-port-zaventem:delivery"]
        },
        {"type": "all_or_none", "stops": ["ord-port-zaventem", "customs-scan-port"]}
      ],
      "objective": {
        "currency": "EUR",
        "costs": {"per_route": 150, "per_route_hour": 45, "per_travel_km": 0.9, "per_overtime_hour": 90}
      }
    },
    "options": {"time_limit_s": 5, "seed": 7}
  }'
```

Three things to notice before reading the answer:

* **A shipment's legs are named `{id}:pickup` and `{id}:delivery`.** Those are the stop ids the relations use and the ids the response reports on the two stops. The shipment's own id appears in `unassigned[].task` and in `all_or_none`, where it stands for both legs.
* **`required_skills` and `drop_cost` sit on the shipment, not on a leg.** They apply to the pair and are priced once.
* **`limits` sits on the vehicle, `max_overtime_s` on the shift.** The duration cap is a property of the truck; the overtime allowance belongs to a working day. Both could be moved to the other level if the fleet needed it, since a shift's `limits` override the vehicle's.

## The response

The response below is the real output for that request, trimmed in three ways to keep it readable: each stop keeps its times, waits, travel and load and drops `location`, `snapped_location` and `service_s`; the top-level `search_progress` and `warnings` are left out; and `plan` is shown whole because it is what you send back. Response times are in each shift's own offset, `+01:00`.

```json theme={null}
{
  "summary": {
    "score": {
      "violation_count": 0,
      "unassigned_priority": 2,
      "cost": 2578.1033,
      "currency": "EUR",
      "components": {
        "routes": 450.0,
        "stops": 0.0,
        "vehicles": 0.0,
        "time": 1039.5875,
        "distance": 908.5158,
        "waiting": 0.0,
        "driving": 0.0,
        "overtime": 0.0,
        "lateness": 0.0,
        "window_choice": 0.0,
        "target": 0.0,
        "tag_preference": 0.0,
        "reloads": 0.0,
        "grouping": 0.0,
        "workload_share": 0.0,
        "drop_costs": 180.0,
        "preferences": 0.0,
        "assignment": 0.0,
        "delay": 0.0
      }
    },
    "tasks": {"served": 7, "unassigned": 3, "unassigned_required": 2},
    "vehicles_used": 3,
    "shifts_used": 3,
    "distance_m": 1009462,
    "time": {
      "span_s": 83167,
      "travel_s": 43308,
      "service_s": 20400,
      "depot_s": 0,
      "wait_s": 14059,
      "break_s": 5400,
      "overtime_s": 0
    },
    "timings": {"search_ms": 5000, "total_ms": 5529},
    "search": {"termination": "time_limit", "iterations": 116596},
    "travel_estimated": false
  },
  "routes": [
    {
      "vehicle": "truck-a",
      "shift": "mon",
      "distance_m": 145761,
      "time": {
        "span_s": 17192,
        "travel_s": 6659,
        "service_s": 5400,
        "depot_s": 0,
        "wait_s": 5133,
        "break_s": 0,
        "overtime_s": 0
      },
      "load_peak": {"pallets": 30},
      "stops": [
        {"type": "start", "depot": "willebroek", "arrival": "2026-11-17T05:00:00+01:00", "departure": "2026-11-17T05:00:00+01:00", "load_after": {"pallets": 0}},
        {"type": "pickup", "id": "ord-port-zaventem:pickup", "arrival": "2026-11-17T05:34:25+01:00", "service_start": "2026-11-17T06:00:00+01:00", "departure": "2026-11-17T06:25:00+01:00", "wait_s": 1535, "lateness_s": 0, "travel_s": 2065, "distance_m": 42000, "load_after": {"pallets": 30}},
        {"type": "job", "id": "customs-scan-port", "arrival": "2026-11-17T06:37:23+01:00", "service_start": "2026-11-17T06:37:23+01:00", "departure": "2026-11-17T07:17:23+01:00", "wait_s": 0, "lateness_s": 0, "travel_s": 743, "distance_m": 11325, "load_after": {"pallets": 30}},
        {"type": "delivery", "id": "ord-port-zaventem:delivery", "arrival": "2026-11-17T08:00:02+01:00", "service_start": "2026-11-17T09:00:00+01:00", "departure": "2026-11-17T09:25:00+01:00", "wait_s": 3598, "lateness_s": 0, "travel_s": 2559, "distance_m": 63241, "load_after": {"pallets": 0}},
        {"type": "end", "depot": "willebroek", "arrival": "2026-11-17T09:46:32+01:00", "departure": "2026-11-17T09:46:32+01:00", "wait_s": 0, "travel_s": 1292, "distance_m": 29195, "load_after": {"pallets": 0}}
      ]
    },
    {
      "vehicle": "truck-b",
      "shift": "mon",
      "distance_m": 433585,
      "time": {
        "span_s": 28952,
        "travel_s": 17548,
        "service_s": 6000,
        "depot_s": 0,
        "wait_s": 2704,
        "break_s": 2700,
        "overtime_s": 0
      },
      "load_peak": {"pallets": 32},
      "stops": [
        {"type": "start", "depot": "willebroek", "arrival": "2026-11-17T05:00:00+01:00", "departure": "2026-11-17T05:00:00+01:00", "load_after": {"pallets": 0}},
        {"type": "pickup", "id": "ord-zeebrugge-namur:pickup", "arrival": "2026-11-17T06:14:56+01:00", "service_start": "2026-11-17T07:00:00+01:00", "departure": "2026-11-17T07:25:00+01:00", "wait_s": 2704, "lateness_s": 0, "travel_s": 4496, "distance_m": 114014, "load_after": {"pallets": 20}},
        {"type": "pickup", "id": "ord-kortrijk-mechelen:pickup", "arrival": "2026-11-17T08:13:36+01:00", "service_start": "2026-11-17T08:13:36+01:00", "departure": "2026-11-17T08:38:36+01:00", "wait_s": 0, "lateness_s": 0, "travel_s": 2916, "distance_m": 69311, "load_after": {"pallets": 32}},
        {"type": "delivery", "id": "ord-zeebrugge-namur:delivery", "arrival": "2026-11-17T10:12:45+01:00", "service_start": "2026-11-17T10:12:45+01:00", "departure": "2026-11-17T10:37:45+01:00", "wait_s": 0, "lateness_s": 0, "travel_s": 5649, "distance_m": 156132, "load_after": {"pallets": 12}},
        {"type": "break", "arrival": "2026-11-17T10:37:45+01:00", "departure": "2026-11-17T11:22:45+01:00", "load_after": {"pallets": 12}},
        {"type": "delivery", "id": "ord-kortrijk-mechelen:delivery", "arrival": "2026-11-17T12:21:02+01:00", "service_start": "2026-11-17T12:21:02+01:00", "departure": "2026-11-17T12:46:02+01:00", "wait_s": 0, "lateness_s": 0, "travel_s": 3497, "distance_m": 83743, "load_after": {"pallets": 0}},
        {"type": "end", "depot": "willebroek", "arrival": "2026-11-17T13:02:32+01:00", "departure": "2026-11-17T13:02:32+01:00", "wait_s": 0, "travel_s": 990, "distance_m": 10385, "load_after": {"pallets": 0}}
      ]
    },
    {
      "vehicle": "truck-c",
      "shift": "mon",
      "distance_m": 430116,
      "time": {
        "span_s": 37023,
        "travel_s": 19101,
        "service_s": 9000,
        "depot_s": 0,
        "wait_s": 6222,
        "break_s": 2700,
        "overtime_s": 0
      },
      "load_peak": {"pallets": 18},
      "stops": [
        {"type": "start", "depot": "willebroek", "arrival": "2026-11-17T05:00:00+01:00", "departure": "2026-11-17T05:00:00+01:00", "load_after": {"pallets": 0}},
        {"type": "pickup", "id": "ord-gentxd-leuven:pickup", "arrival": "2026-11-17T05:44:34+01:00", "service_start": "2026-11-17T06:00:00+01:00", "departure": "2026-11-17T06:25:00+01:00", "wait_s": 926, "lateness_s": 0, "travel_s": 2674, "distance_m": 57586, "load_after": {"pallets": 8}},
        {"type": "pickup", "id": "ord-roeselare-sintniklaas:pickup", "arrival": "2026-11-17T07:18:00+01:00", "service_start": "2026-11-17T07:18:00+01:00", "departure": "2026-11-17T07:43:00+01:00", "wait_s": 0, "lateness_s": 0, "travel_s": 3180, "distance_m": 76747, "load_after": {"pallets": 18}},
        {"type": "delivery", "id": "ord-roeselare-sintniklaas:delivery", "arrival": "2026-11-17T08:52:34+01:00", "service_start": "2026-11-17T10:00:00+01:00", "departure": "2026-11-17T10:25:00+01:00", "wait_s": 4046, "lateness_s": 0, "travel_s": 4174, "distance_m": 110293, "load_after": {"pallets": 8}},
        {"type": "pickup", "id": "ord-chem-turnhout:pickup", "arrival": "2026-11-17T10:25:00+01:00", "service_start": "2026-11-17T10:25:00+01:00", "departure": "2026-11-17T10:50:00+01:00", "wait_s": 0, "lateness_s": 0, "travel_s": 0, "distance_m": 0, "load_after": {"pallets": 14}},
        {"type": "delivery", "id": "ord-chem-turnhout:delivery", "arrival": "2026-11-17T11:39:10+01:00", "service_start": "2026-11-17T12:00:00+01:00", "departure": "2026-11-17T12:25:00+01:00", "wait_s": 1250, "lateness_s": 0, "travel_s": 2950, "distance_m": 73356, "load_after": {"pallets": 8}},
        {"type": "break", "arrival": "2026-11-17T12:25:00+01:00", "departure": "2026-11-17T13:10:00+01:00", "load_after": {"pallets": 8}},
        {"type": "delivery", "id": "ord-gentxd-leuven:delivery", "arrival": "2026-11-17T14:16:38+01:00", "service_start": "2026-11-17T14:16:38+01:00", "departure": "2026-11-17T14:41:38+01:00", "wait_s": 0, "lateness_s": 0, "travel_s": 3998, "distance_m": 63903, "load_after": {"pallets": 0}},
        {"type": "end", "depot": "willebroek", "arrival": "2026-11-17T15:17:03+01:00", "departure": "2026-11-17T15:17:03+01:00", "wait_s": 0, "travel_s": 2125, "distance_m": 48231, "load_after": {"pallets": 0}}
      ]
    }
  ],
  "plan": {
    "routes": [
      {
        "vehicle": "truck-a",
        "shift": "mon",
        "stops": [
          {"type": "pickup", "id": "ord-port-zaventem:pickup"},
          {"type": "job", "id": "customs-scan-port"},
          {"type": "delivery", "id": "ord-port-zaventem:delivery"}
        ]
      },
      {
        "vehicle": "truck-b",
        "shift": "mon",
        "stops": [
          {"type": "pickup", "id": "ord-zeebrugge-namur:pickup"},
          {"type": "pickup", "id": "ord-kortrijk-mechelen:pickup"},
          {"type": "delivery", "id": "ord-zeebrugge-namur:delivery"},
          {"type": "delivery", "id": "ord-kortrijk-mechelen:delivery"}
        ]
      },
      {
        "vehicle": "truck-c",
        "shift": "mon",
        "stops": [
          {"type": "pickup", "id": "ord-gentxd-leuven:pickup"},
          {"type": "pickup", "id": "ord-roeselare-sintniklaas:pickup"},
          {"type": "delivery", "id": "ord-roeselare-sintniklaas:delivery"},
          {"type": "pickup", "id": "ord-chem-turnhout:pickup"},
          {"type": "delivery", "id": "ord-chem-turnhout:delivery"},
          {"type": "delivery", "id": "ord-gentxd-leuven:delivery"}
        ]
      }
    ]
  },
  "unassigned": [
    {
      "task": "ord-aalst-liege",
      "category": "blocked",
      "reasons": [{"constraint": "time_window", "message": "A route cannot reach this task within its time window"}],
      "relaxations": [
        {
          "pointer": "/problem/shipments/4/pickup/time_windows",
          "op": "extend_time_window",
          "amount": 1601,
          "unit": "s",
          "message": "Extend a time window by 1601s (~26 min)."
        }
      ]
    },
    {
      "task": "ord-gentxd-hasselt",
      "category": "blocked",
      "reasons": [
        {"constraint": "capacity", "message": "Capacity refused this task on at least one vehicle"},
        {"constraint": "time_window", "message": "A route cannot reach this task within its time window"}
      ],
      "relaxations": [
        {
          "pointer": "/problem/shipments/1/load",
          "op": "reduce_load",
          "amount": 6,
          "unit": "load",
          "message": "Reduce this task's load (its `load`) by 6, or add 6 capacity to an eligible vehicle."
        },
        {
          "pointer": "/problem/shipments/1/pickup/time_windows",
          "op": "extend_time_window",
          "amount": 859,
          "unit": "s",
          "message": "Extend a time window by 859s (~14 min)."
        }
      ]
    },
    {
      "task": "ord-spot-mons",
      "category": "priced_out",
      "reasons": [{"message": "A feasible insertion exists, but the solver did not assign the task"}],
      "relaxations": []
    }
  ]
}
```

### The plan in one paragraph

All three trucks go out and six of the nine orders move, 86 pallets, plus the customs scan. `truck-a` does the port chain and nothing else: terminal, scan, Zaventem, home by 09:46. `truck-b` runs the two big western pickups, Zeebrugge and Kortrijk, to Namur and Mechelen, with its driving break in Namur. `truck-c`, the small ADR truck, runs a loop of four orders through Ghent, Roeselare, Sint-Niklaas, Turnhout and Leuven, and is the last home at 15:17. Two required orders, Aalst to Liège and Ghent to Hasselt, are unassigned, each with a relaxation that says what would have let it in. The spot load to Mons is declined at its `drop_cost`.

### Summary

* **`tasks`** reads `served: 7, unassigned: 3, unassigned_required: 2`. A shipment is one task; the seven served are six shipments and the scan job. Of the three unassigned, the spot load has a `drop_cost` and does not count as required. HTTP `200` all the same.
* **`distance_m`** 1,009,462: a thousand kilometres over three trucks. `time.travel_s` 43,308 s is twelve hours of driving between them; `time.wait_s` 14,059 s is time spent at an address before its window opened; `time.break_s` 5,400 s is two 45-minute breaks. `time.overtime_s` is `0`: nobody needed the hour past 17:00.
* **`search`** used the five-second budget in full (`termination: "time_limit"`) over 116,596 iterations, far more than the parcel example in the same time, because a problem with ten tasks has few positions to try.

### The chain on truck A

`truck-a`'s stops are `start`, `ord-port-zaventem:pickup`, `customs-scan-port`, `ord-port-zaventem:delivery`, `end`. Nothing sits between the three, which is what `consecutive` demands, and all three are on one route, which is what `same_route` demands. The times show the windows at work:

| Stop | Arrives | Service starts | Leaves | What the response shows |
| - | - | - | - | - |
| `ord-port-zaventem:pickup` | 05:34 | 06:00 | 06:25 | The truck leaves the depot at 05:00, reaches the terminal 26 minutes before its window, waits (`wait_s: 1535`), loads 30 pallets. `load_after` is 30 |
| `customs-scan-port` | 06:37 | 06:37 | 07:17 | A `job` stop with no load of its own, 40 minutes. The container stays on board: `load_after` is still 30 |
| `ord-port-zaventem:delivery` | 08:00 | 09:00 | 09:25 | An hour early for the DC's 09:00 window (`wait_s: 3598`). `load_after` back to 0 |
| `end` | 09:46 | | 09:46 | Home. The truck has seven hours of shift left and nothing to do with them |

That last line is worth a look. `truck-a` is free from 09:46, and two orders are unassigned. The solver did not find a way to use it: the Aalst pickup closes at 09:00, while the truck is still in Zaventem; the Ghent cross-dock closes at 10:00, and the response's relaxation says the truck would have been 14 minutes too late. The unassigned section below reads both.

The scan could not have gone elsewhere. Had the request listed only `consecutive` and `all_or_none`, the solver would have been free to put the scan on `truck-c` as a separate job, and `consecutive` would have been satisfied trivially, because it binds only members that share a route. `same_route` is what makes "right after" mean what the planner meant.

### Trucks B and C

`truck-b` picks up at Zeebrugge (20 pallets) and Kortrijk (12), for a `load_peak` of 32 on a 33-pallet truck, delivers Namur at 10:12 and Mechelen at 12:21, and is home at 13:02 after 434 km. Its `break` stop is at Namur, 10:37 to 11:22, listed before the Mechelen delivery: the truck had driven 3 hours 36 minutes by then, and the next leg would have taken it past 4 hours 30, so the break goes before the leg. The counter resets after it.

`truck-c` is the busy one: four orders, 18 pallets on board at the peak, which is its whole capacity, 430 km and ten hours. Two things to read on it:

* **Waiting at the receiver.** It reaches Sint-Niklaas at 08:52 with the Roeselare order, and the receiver opens at 10:00: `wait_s: 4046`. It uses the stop to pick up the ADR order at the same address straight after (`ord-chem-turnhout:pickup` at 10:25), which is why the plan is willing to wait: the two stops share an address and the second is the only ADR order, which only this truck may carry.
* **The break at Turnhout.** 12:25 to 13:10, after the delivery and before the long leg to Leuven, which arrives at 14:16, inside its window.

Both breaks are `triggered` breaks and have no window of their own; their position is a consequence of the route. Neither truck's route exceeds `max_route_duration_s`: `truck-c`'s span is 37,023 s against a cap of 46,800.

### The unassigned orders

```json theme={null}
{
  "unassigned": [
    {
      "task": "ord-aalst-liege",
      "category": "blocked",
      "reasons": [{ "constraint": "time_window", "message": "A route cannot reach this task within its time window" }],
      "relaxations": [
        {
          "pointer": "/problem/shipments/4/pickup/time_windows",
          "op": "extend_time_window",
          "amount": 1601,
          "unit": "s",
          "message": "Extend a time window by 1601s (~26 min)."
        }
      ]
    },
    {
      "task": "ord-gentxd-hasselt",
      "category": "blocked",
      "reasons": [
        { "constraint": "capacity", "message": "Capacity refused this task on at least one vehicle" },
        { "constraint": "time_window", "message": "A route cannot reach this task within its time window" }
      ],
      "relaxations": [
        {
          "pointer": "/problem/shipments/1/load",
          "op": "reduce_load",
          "amount": 6,
          "unit": "load",
          "message": "Reduce this task's load (its `load`) by 6, or add 6 capacity to an eligible vehicle."
        },
        {
          "pointer": "/problem/shipments/1/pickup/time_windows",
          "op": "extend_time_window",
          "amount": 859,
          "unit": "s",
          "message": "Extend a time window by 859s (~14 min)."
        }
      ]
    },
    {
      "task": "ord-spot-mons",
      "category": "priced_out",
      "reasons": [{ "message": "A feasible insertion exists, but the solver did not assign the task" }],
      "relaxations": []
    }
  ]
}
```

Three entries, three different stories:

1. **`ord-aalst-liege` is `blocked` by a `time_window`.** Some truck could do Aalst to Liège on its own; none can alongside what the plan already carries. The relaxation says the pickup window, which closes at 09:00, would need to be 26 minutes 41 seconds longer. `truck-a` is the truck in question: after the scan it reaches Zaventem at 08:00, and Aalst is on the other side of Brussels. A supplier that loads until 09:30 would have made the day whole.
2. **`ord-gentxd-hasselt` is `blocked` by `capacity` and a `time_window`,** and gets a relaxation for each. The capacity reason is `truck-c`: 24 pallets on an 18-pallet truck, so reduce the load by 6 or add 6 places. The window reason is the two big trucks: the cross-dock closes at 10:00, and the nearest of them is 14 minutes 19 seconds short of it. Each figure is the measured shortfall for that vehicle; re-solve to confirm the order is placed.
3. **`ord-spot-mons` is `priced_out`.** It fits, it has a `drop_cost`, and serving it at the cheapest position found would cost at least 180, so the solver paid the 180 instead. The single reason has no `constraint`: no rule kept it out. The 180 shows up in `score.components.drop_costs`, and `unassigned_priority` does not count it, because a task with a `drop_cost` is not a required task.

A relaxation is a measurement, not advice. Widening a supplier's window by 27 minutes is a phone call the coordinator can make; splitting a 24-pallet order is a different conversation. The response makes both sizes visible so the right conversation can happen. Note too what the response does not suggest: using `truck-a`'s idle afternoon. It cannot, because every unassigned pickup closes before `truck-a` can reach it, and the relaxations are the proof.

### Score

`score.cost` is the sum of `score.components`, in the currency you labelled:

| Component | Value | Where it comes from |
| - | - | - |
| `routes` | 450.0 | Three trucks out at `per_route: 150` |
| `time` | 1039.5875 | The three spans, 17,192 s, 28,952 s and 37,023 s, at 45 per hour. Waiting and breaks are inside the span and so inside this number |
| `distance` | 908.5158 | 1,009.462 km at 0.90 |
| `drop_costs` | 180.0 | The spot load, declined at its `drop_cost` |
| `overtime` | 0.0 | `per_overtime_hour: 90` was set but no route ran past 17:00 |
| `cost` | 2578.1033 | The sum |

`unassigned_priority` is `2`: the two required orders left out, at the default priority of `1` each. Had the Hasselt order carried `priority: 5`, the solver would have ranked a plan that serves it and drops two others above this one, whatever the cost difference, because unassigned priority is minimised before money.

### One KPI line

**Cost per delivered pallet: 29.98** (2,578.10 over 86 pallets), with 86 of the 126 required pallets delivered and two orders, 40 pallets, left for tomorrow or a subcontractor. The figure includes the 180 paid to decline the spot load; take `drop_costs` out of `cost` to compare the fleet's own efficiency across days.

## What the solution cannot prove

The response proves what the solver was told to respect. It cannot prove what it was not told:

* **That the windows are the ones the sites will keep.** A pickup window of 06:00 to 09:00 that the supplier reads as "we open at 06:00 and load until noon" is a 26-minute phone call away from a fuller plan, and the response cannot make it.
* **That 25 minutes per pallet exchange is right.** A terminal that takes an hour to release a container turns `truck-a`'s 26-minute wait into lateness at the DC, which the plan cannot absorb because the DC window has no price. `wait_s` per stop shows where the plan has slack; `truck-c` has almost none after 10:25.
* **That the 4 hours 30 rule is the only rule.** A `triggered` break models one break after one accumulator. Daily and weekly driving limits, split breaks and rest periods are outside what this request says, and a plan that keeps the one rule can still breach the others.
* **That the trucks can load together.** The plan has `truck-b` carrying Zeebrugge and Kortrijk pallets at once. Whether 32 pallets from two shippers can share a trailer in practice is something the request did not state, and capacity alone does not say.
* **That the spot load should stay declined.** `priced_out` means "at 180, no". The cheapest way to serve it is somewhere above 180; the response does not say how far above. To find out, send the plan to `/v3/routing/suggest` with the spot load left out of `plan`: the first insertion's `delta.cost` is the price of taking it.

What it does prove, and how to check it in code: every shipment on a route has its `pickup` stop before its `delivery` stop on the same route; `ord-port-zaventem:pickup`, `customs-scan-port` and `ord-port-zaventem:delivery` are three consecutive stops of one route; the ADR order is on `truck-c`; each route's `load_peak` is within its vehicle's `capacity`; every route's `time.span_s` is within `max_route_duration_s`; every task stop's `service_start` is inside its window; and every task is either in some route's `stops` or in `unassigned[]`. [Relations](https://docs.solvice.io/guides/vrp/v3/constraints.md#relations) and [Shipments](https://docs.solvice.io/guides/vrp/v3/constraints.md#shipments) list the fields rule by rule.

## Next steps

> [card] [Relations](https://docs.solvice.io/guides/vrp/v3/constraints.md#relations)
>
> All ten relation types, what each binds, and the common 400s.

> [card] [Suggest](https://docs.solvice.io/guides/vrp/v3/suggest.md)
>
> Price the spot load: ranked insertions into this plan.

> [card] [Handling infeasibility](https://docs.solvice.io/guides/vrp/v3/infeasibility.md)
>
> Reading categories, reasons and relaxations, and the ranked fixes.

> [card] [Waste collection](https://docs.solvice.io/guides/vrp/v3/examples/waste-collection.md)
>
> The same loop with mid-route reloads and depot intake caps.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.