Update delivery information for a parcel
In case of a change regarding the delivery of a parcel, the information already provided by means of a delivery leg can be updated so that the change gets reflected when retrieving the parcel journey.
An example is a change in the delivery window for the parcel.
In this example, the information for the parcel reference BOX-001 that is tracked under TRACK-MULTI-002 is updated to include delivery information with a new delivery window for the final mile delivery. This is achieved by posting an updated delivery leg for this parcel which includes the new information.
The delivery leg includes these additional fields that contains the new delivery window:
- delivery.deliveryWindow.from : the date and time from which the parcel is expected to be delivered in ISO 8601 format.
- delivery.deliveryWindow.to : the date and time by which the parcel is expected to be delivered in ISO 8601 format.
Steps:
- Open the resource POST Create or update a delivery leg .
- Update the body with the following JSON object:
{
"trackingIdentifier": "TRACK-MULTI-002",
"carrierCode": "COLISSIMO",
"parcel": {
"parcelRef": "BOX-001"
},
"finalDeliveryLeg": true,
"delivery": {
"deliveryWindow": {
"from": "2022-06-30T12:30:00.000Z",
"to": "2022-06-30T13:30:00.000Z"
}
}
}
- Send the request to update the information contained in the delivery leg.
- Expect a successful response with 204 No Content response code.
After the updated information has been provided by re-posting a delivery leg, then this new information will be reflected in the parcel journey.
- 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 either TRACK-MULTI-001 or TRACK-MULTI-002 .
- 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",
"deliveryWindow": {
"from": "2022-06-30T12:30:00.000Z",
"to": "2022-06-30T13:30:00.000Z"
}
},
"parcel": {
"parcelRef": "BOX-001",
"deliveryLegs": [
{
"carrierCode": "FEDEX",
"carrierTrackingURL": "https://www.fedex.com/apps/fedextrack/?action=track&tracknumbers=TRACK-MULTI-001",
"trackingIdentifier": "TRACK-MULTI-001",
"carrierDisplayName": "FedEx",
"finalDeliveryLeg": false
},
{
"carrierCode": "COLISSIMO",
"carrierTrackingURL": "https://www.coliposte.net/particulier/suivi_particulier.jsp?colispart=TRACK-MULTI-002",
"trackingIdentifier": "TRACK-MULTI-002",
"carrierDisplayName": "Colissimo",
"finalDeliveryLeg": true
}
],
"items": []
},
"trackingEvents": []
}
]
The parcel journey now includes the updated delivery window located in the delivery object that was provided when updating the delivery leg.
The parcel journey always prioritises the most recent information when collecting information from delivery legs.
This update mechanism can be used to enrich the parcel journey with more information by adding a block of information to the delivery leg and by posting the new version of the delivery leg.
This mechanism can also be used to remove information from the parcel journey by removing a block of information from the delivery leg and by posting the new version of the delivery leg.
Information provided in a delivery leg which remains immutable includes the tracking identifier for the parcel and the parcel reference if such reference was previously provided.