Tracking Lifecycle Model
Lifecycle is an aggregated state. It is not just "the latest checkpoint". The system evaluates multiple fields and applies precedence rules.
Why Lifecycle Exists
Carrier checkpoints are a history of events. The latest event alone can be misleading (for example, after failed attempts or return flows). Lifecycle gives one current business state for retailer operations, reporting, and trigger logic.
For information about the mapping of individual checkpoints of a delivery, refer to the following page.
Delivery Status ModelLifecycle Stage Codes and Business Labels
Pending
Pending
Label exists, but no in-transit progression yet.
Transit
Transit
In carrier network.
Customs
Customs
Shipment is currently in customs processing.
LastMile
Last mile
Shipment reached out-for-delivery at least once.
ReadyToCollect
Ready to collect
Shipment is available for customer pickup.
Delivered
Delivered
Final handover to customer (or equivalent completion).
SentBack
Sent back
Return to sender started but not yet completed.
Returned
Returned
Return delivered back to sender/retailer.
Failed
Failed
Shipment cannot proceed (lost/destroyed/seized return path).
Cancelled
Cancelled
Cancelled by retailer.
Notes:
Cancelledhas highest precedence and overrides all other states.LastMileis sticky in practice onceOutForDeliveryhas happened, unless overridden by terminal/return/cancel states.Failedis currently derived in return context when exceptions indicate unrecoverable loss/destruction/seizure.
Lifecycle Flags (Additional Context)
These flags complement stage and are exposed in formatted tracking output.
flag_delayedDispatch
Delayed dispatch from warehouse to carrier.
flag_failedAttempt
At least one failed delivery attempt occurred.
flag_delayed
Shipment delay was detected.
Notes:
Flags are orthogonal to lifecycle stage.
A shipment can be
Transit+flag_delayed = true, orDelivered+flag_failedAttempt = true.
Technical Details on Stage Resolution
The lifecycle engine evaluates in this order. Earlier matches win and return immediately.
CancelledReturn-to-Sender flow:
Failedif any checkpoint exception containsLost,Destroyed, orSeizedReturnedif return shipment has been deliveredOtherwise
SentBack
Delivered flow:
Non-branch delivery:
DeliveredBranch delivery:
ReadyToCollectuntil an internal retailer event confirms customer collection, thenDelivered(see details below)
Pickup-ready flow:
ReadyToCollect, if anyDeliveryStatuslikePickupReady*Additional condition for non-branch delivery: Delivery had a network scan before
In-transit flow:
Default
Transitas soon as any network scan is registeredLastMileif any checkpoint hasDeliveryStatuscontainingOutForDeliveryCustoms in/out logic (see below) can switch between
CustomsandTransit
Fallback default:
Pending
Branch Delivery Special Handling
For delivery_info.branchDelivery = true:
Carrier-level
delivery_datealone does not always mean customer-deliveredStage is
ReadyToCollectuntil an internal event confirms customer collectionInternal collection confirmation currently requires:
status_detailsbeginning withShopEventorparcelLab(case-insensitive), andmatching.DeliveryStatus = Delivered
This is why a branch shipment can have delivery_date and still be ReadyToCollect.
Customs Behavior
Customs is stateful while processing checkpoints in order:
Enters customs on:
DeliveryStatus = CustomsIn, orDeliveryStatus = Exceptionwith exception containingCustoms
Exits customs on:
CustomsReleased,DestinationDeliveryCenter, orDestinationDeliveryDepot
After customs exit, stage returns to
Transitunless a higher-precedence rule already applied.
Last updated
Was this helpful?