Packages API
Packages represent the physical items being delivered. Each task can have one or more packages. Packages are typically created as part of the task creation payload, but you can also manage them separately.
Package Fields
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Package description or contents name |
quantity | number | Yes | Number of items |
weight | number | No | Weight in kilograms |
width | number | No | Width in centimeters |
height | number | No | Height in centimeters |
length | number | No | Length in centimeters |
isFragile | boolean | No | Whether the package requires careful handling |
notes | string | No | Special handling instructions |
Creating Packages with Tasks
The most common approach is to include packages directly when creating a task:
{
"taskType": "delivery",
"customer": { ... },
"packages": [
{
"name": "Electronics - Laptop",
"quantity": 1,
"weight": 2.5,
"width": 40,
"height": 30,
"length": 5,
"isFragile": true,
"notes": "Handle with care, keep upright"
},
{
"name": "Accessories box",
"quantity": 1,
"weight": 0.5
}
]
}
Add Package to Existing Task
POST
/api/v1/tasks/:taskId/packages
Add a package to an existing task. Only allowed when the task is in NEW or AWAITING_ASSIGNMENT status.
List Packages for a Task
GET
/api/v1/tasks/:taskId/packages
Retrieve all packages associated with a task.
Dimensions for Routing
Providing accurate weight and dimensions helps the system make better assignment decisions — particularly for external couriers that have vehicle capacity constraints.
