Delivery record structure
A delivery record is created when you assign a delivery partner to an order. It contains the following fields:| Field | Description |
|---|---|
id | Unique delivery identifier |
order_id | The order this delivery belongs to |
pickup_points | Array of PickupPoint objects (partner and timestamp) |
stages | Array of DeliveryStage objects recording each status transition |
current_stage | The active DeliveryStageType value |
estimated_delivery_time | Expected delivery timestamp, or null |
actual_delivery_time | Confirmed delivery timestamp, or null |
created_at | When the delivery record was created |
updated_at | When the delivery record was last modified |
Delivery stages
Each entry in thestages array represents a transition in the delivery lifecycle and contains:
| Field | Description |
|---|---|
partner_id | The delivery partner responsible at this stage |
stage | The DeliveryStageType value for this transition |
proof | Optional proof-of-delivery reference, or null |
timestamp | ISO timestamp of when this stage was recorded |
location | Optional { latitude, longitude } coordinates, or null |
Stage values
| Stage | Meaning |
|---|---|
assigned | A delivery partner has been assigned to the order |
at_pickup | The partner has arrived at the pickup location |
in_transit | The parcel is on its way to the customer |
delivered | The parcel has been delivered successfully |
failed | A delivery attempt failed |
cancelled | The delivery was cancelled |
current_stage field always reflects the most recent stage in the stages array.
The delivery detail view shows the full stage history in chronological order, so you can see exactly when each transition occurred and which partner was responsible.
Pickup points
Pickup points record the intermediate handoff locations where a partner collects the parcel. EachPickupPoint contains:
| Field | Description |
|---|---|
partner_id | The partner who collected the parcel at this point |
timestamp | When the pickup occurred |
Assigning a delivery partner
To assign a delivery partner to an order, you create a new delivery record. The following fields are required:| Field | Required | Description |
|---|---|---|
order_id | Yes | The order to assign the delivery to |
stages | Yes | Initial array of DeliveryStage entries |
current_stage | Yes | The starting stage: assigned, in_transit, delivered, or failed |
pickup_points | No | Optional array of PickupPoint entries |
estimated_delivery_time | No | Expected delivery timestamp |
Open the order detail view
Navigate to Orders and click the order you want to assign a delivery partner to. The order must be in a status that allows fulfillment (for example,
confirmed).Open the delivery section
Scroll to the Delivery section of the order detail view. If no delivery has been assigned yet, you will see an option to assign a partner.
Select a delivery partner
Choose the delivery partner from the available list. The system creates a delivery record with the initial stage set to
assigned.Adding a delivery stage
As the delivery progresses, you can record each stage transition. The following fields are required:| Field | Description |
|---|---|
partner_id | The partner responsible for this stage |
stage | The new stage: assigned, in_transit, delivered, or failed |
Open the delivery detail
From the order detail view, open the delivery record. You can also access deliveries directly from the Deliveries section of the dashboard.
Filtering deliveries
You can filter the deliveries list by the following criteria:| Filter | Description |
|---|---|
search | Search by order number or delivery ID |
status | Filter by delivery status: active, completed, or cancelled |
stage | Filter by a specific DeliveryStageType |
partnerId | Show deliveries for a specific partner |
orderId | Look up the delivery for a specific order |