Track a parcel handled by a single carrier
After a parcel has been allocated to a carrier and has been given a tracking identifier, then the information about the parcel can be provided by means of a delivery leg. The delivery leg includes the tracking identifier of the parcel and the carrier code of the carrier shipping the parcel.
Find out about the list of supported carriers and carrier codes in Supported carriers section of the documentation.
Steps:
- Open the resource POST Create or update a delivery leg .
- Update the body with the following JSON object:
{
"trackingIdentifier": "TRACK-001",
"carrierCode": "DPD_UK"
}
- Send the request.
- Expect a successful response with 204 No Content response code.
After a delivery leg is created for a given parcel then the parcel journey becomes available and can be retrieved using the tracking identifier of the parcel. The parcel journey includes all information provided in the delivery leg and is enriched with additional information available within MetaPack. The parcel journey is used to track the progress of the delivery of a parcel.
- Open the resource GET Retrieve the parcel journeys for an order or a parcel .
- In the tab Parameters , set the value of the query parameter trackingIdentifier to TRACK-001 .
- Remove all other query parameters so that only the query parameter trackingIdentifier is retained.
- Send the request to retrieve the parcel journey using the tracking identifier of the parcel.
- Expect a successful response with a 200 OK response code and the following JSON body:
[
{
"delivery": {
"type": "HOME",
"direction": "OUTBOUND",
"carrierServiceType": "TRACKED"
},
"parcel": {
"deliveryLegs": [
{
"carrierCode": "DPD_UK",
"carrierTrackingURL": "https://www.dpd.co.uk/service/tracking?parcel=TRACK-001",
"trackingIdentifier": "TRACK-001",
"carrierDisplayName": "DPD UK",
"finalDeliveryLeg": true
}
],
"items": []
},
"trackingEvents": []
}
]
In this simple example, the parcel journey is enriched with the following information:
-
delivery
: information about the type of delivery
-
type
: defaults to
HOME
delivery. Supported types are[ HOME, PUDO, STORE ]
. -
direction
: defaults to
OUTBOUND
. Supported directions are[ OUTBOUND, RETURN ]
. -
carrierServiceType
: defaults to
TRACKED
. Supported services are[ TRACKED, UNTRACKED ]
.
-
type
: defaults to
-
parcel.deliveryLegs
:
- carrierTrackingURL : a link for tracking the parcel directly on the carrier website.
- carrierDisplayName : the name of the carrier delivering the parcel.
- finalDeliveryLeg : an indicator that identifies the delivery leg for the final mile delivery.
- parcel.items : an array used to identify items within the parcel.
- trackingEvents : an array that will contain all the tracking events that compose the tracking history of the parcel.
Summary:
Number of parcels | Number of carriers | Number of delivery legs required | Number of parcel journeys |
---|---|---|---|
1 | 1 | 1 | 1 |
2 | 1 | 2 | 2 |
n | 1 | n | n |