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

FieldTypeRequiredDescription
namestringYesPackage description or contents name
quantitynumberYesNumber of items
weightnumberNoWeight in kilograms
widthnumberNoWidth in centimeters
heightnumberNoHeight in centimeters
lengthnumberNoLength in centimeters
isFragilebooleanNoWhether the package requires careful handling
notesstringNoSpecial 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.