> ## 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.

# Last Mile Delivery

> E-commerce delivery with time windows and breaks

# Last Mile Delivery

Fleet routing with time windows, capacity, breaks, and special requirements.

## Request

```json theme={null}
{
  "resources": [
    {
      "name": "van-001",
      "shifts": [{
        "from": "2024-03-15T08:00:00",
        "to": "2024-03-15T16:00:00",
        "start": {"latitude": 40.7484, "longitude": -73.9857},
        "end": {"latitude": 40.7484, "longitude": -73.9857},
        "breaks": [{
          "type": "FIXED",
          "from": "2024-03-15T12:00:00",
          "to": "2024-03-15T12:30:00",
          "duration": 1800
        }]
      }],
      "capacity": [150, 2000],
      "tags": ["refrigerated"]
    }
  ],
  "jobs": [
    {
      "name": "order-001-premium",
      "location": {"latitude": 40.7580, "longitude": -73.9855},
      "duration": 300,
      "load": [1, 2],
      "priority": 100,
      "windows": [{
        "from": "2024-03-15T09:00:00",
        "to": "2024-03-15T11:00:00",
        "hard": true
      }]
    },
    {
      "name": "order-002-cold",
      "location": {"latitude": 40.7282, "longitude": -73.9942},
      "duration": 300,
      "load": [3, 8],
      "windows": [{
        "from": "2024-03-15T10:00:00",
        "to": "2024-03-15T14:00:00",
        "hard": true
      }],
      "tags": [{"name": "refrigerated", "hard": true}]
    }
  ],
  "options": {
    "traffic": 1.2,
    "routingEngine": "OSM"
  }
}
```

## Response

```json theme={null}
{
  "score": {"hardScore": 0, "softScore": -15420, "feasible": true},
  "trips": [{
    "resource": "van-001",
    "visits": [
      {"arrival": "2024-03-15T09:10:00", "job": "order-001-premium"},
      {"arrival": "2024-03-15T10:15:00", "job": "order-002-cold"}
    ],
    "travelTime": 4200,
    "serviceTime": 600
  }],
  "unserved": []
}
```

## Key Features

| Feature                 | Usage                             |
| ----------------------- | --------------------------------- |
| `capacity: [150, 2000]` | Multi-dimensional (count, weight) |
| `windows.hard: true`    | Must arrive within window         |
| `tags.hard: true`       | Requires matching resource tag    |
| `breaks`                | Fixed or windowed driver breaks   |
| `traffic: 1.2`          | 20% traffic multiplier            |
