Update the status of an order

While an order is being processed and after a delivery has been created with information about the order, an update about the processing of the order is provided by means of a delivery event. A delivery event will be included in the tracking history returned in the parcel journey for the given order.

Find out about the supported events in Supported tracking events section of the documentation.

In this example, an order referenced ORDER-PROCESS-01, for which a delivery referenced DELIVERY-PROCESS-01 is created, receives a delivery event READY_FOR_PACKING that informs the recipient that the order is ready for packing.

Steps:

Copy
Copied
{
  "order": {
    "orderRef": "ORDER-PROCESS-01"
  },
  "deliveryRef": "DELIVERY-PROCESS-01"
}
  • Send the request to create the delivery with the order information.
  • Expect a successful response with 204 No Content response code.
  • Open the resource POST Add events for a delivery
  • Update the body with the following JSON object that defines the delivery event:
Copy
Copied
{
  "deliveryRef": "DELIVERY-PROCESS-01",
  "eventCode": "READY_FOR_PACKING",
  "eventDate": "2022-06-29T06:27:42.306Z",
  "eventTimeZone": "Europe/London"
}

The parcel journey returned for tracking the processing of the order should include the delivery event in the tracking history.

  • 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 orderRef to ORDER-PROCESS-01 .
  • Remove all other query parameters so that only the query parameter orderRef is retained.
  • Send the request to retrieve the parcel journey for the order using the order reference.
  • Expect a successful response with a 200 OK response code and the following JSON body:
Copy
Copied
[
    {
        "delivery": {
            "type": "HOME",
            "direction": "OUTBOUND",
            "carrierServiceType": "TRACKED"
        },
        "order": {
            "orderRef": "ORDER-PROCESS-01"
        },
        "parcel": {
            "deliveryRef": "DELIVERY-PROCESS-01",
            "deliveryLegs": [],
            "items": []
        },
        "latestTrackingStatus": {
            "eventCode": "READY_FOR_PACKING",
            "eventDate": "2022-06-29T06:27:42.306Z",
            "eventTimeZone": "Europe/London",
            "trackingIdentifier": "DELIVERY-PROCESS-01",
            "eventDescription": "Ready for packing",
            "statusCode": "PROCESSING",
            "statusDescription": "Processing",
            "eventCategory": "HAPPY"
        },
        "trackingEvents": [
            {
                "eventCode": "READY_FOR_PACKING",
                "eventDate": "2022-06-29T06:27:42.306Z",
                "eventTimeZone": "Europe/London",
                "trackingIdentifier": "DELIVERY-PROCESS-01",
                "eventDescription": "Ready for packing",
                "statusCode": "PROCESSING",
                "statusDescription": "Processing",
                "eventCategory": "HAPPY"
            }
        ]
    }
]

The delivery event is presented in the same shape as any other tracking events in the tracking history of the parcel journey and used for the latest tracking status for the order.