Add tracking events for a delivery leg

A delivery leg event for a trackable item that relates to the status of a parcel post-allocation.

Delivery leg events can be used to update the status of a parcel when ready for collection in a store or at a pickup point.

SecurityBasicAuth
Request
header Parameters
User-Agent
string

The name of the client that interacts with the API.

Example: REPLACE-WITH-YOUR-USER-AGENT
Request Body schema: application/json
trackingIdentifier
required
string

The external identifier used to track the parcel. This can be the tracking identifier used by carriers or any barcode that identifies the parcel.

eventCode
required
string

Metapack event code.

Enum: "AWAITING_DESPATCH" "DESPATCHED" "NOT_YET_RECEIVED_BY_CARRIER" "RECEIVED_BY_CARRIER" "RECD_BY_CARRIER_NO_ELEC_ADVICE" "COLLECTION_REQUESTED" "COLLECTION_MADE" "COLLECTION_FAILED" "ROUTING_ERROR" "CARRIER_DELAYS" "PARCEL_LOST" "DELAYED_NOT_CARRIER" "HELD_BY_CUSTOMS" "PARCEL_DAMAGED" "IN_TRANSIT" "RECEIVED_LOCAL_DELIVERY_DEPOT" "HUB_SCAN_OUT" "CUSTOMS_PROCESSING" "COLLECT_AT_LOCAL_PO" "SUB_CONTRACTOR_EVENT" "OUT_FOR_DELIVERY" "SUB_CONTRACTOR_RECEIVED" "ADDRESS_QUERY" "CUSTOMER_CARDED" "DELIVERED_IN_PART" "CUSTOMER_TO_COLLECT_FROM_CARRIER" "HELD_BY_CARRIER" "CUSTOMER_MOVED" "REFUSED_BY_CUSTOMER" "RETURN_TO_SENDER" "NOT_DELIVERED" "NOT_DELIVERED_ADDRESSEE_DECEASED" "DELIVERED" "DELIVERED_TO_PO_BOX" "DELIVERED_DAMAGED" "INFORMATION" "POST_TRANSIT_STATUS" "PROOF_OF_DELIVERY" "HAZARDOUS_PROHIBITED" "CANCELLED" "ELEC_ADVICE_RECD_BY_CARRIER" "CLOSED_BY_SYSTEM" "MISSORTED" "DELIVERY_ARRANGED_WITH_RECIPIENT" "NO_ACCESS_TO_RECIPIENTS_ADDRESS" "COD_AMOUNT_NOT_PAID" "CUSTOMER_IDENTIFICATION_FAILED" "INVALID_METHOD_OF_PAYMENT" "COD_AMOUNT_PAID" "CUSTOMS_CLEARED" "PARCEL_REPACKED" "PARCEL_DISPOSED" "INCORRECT_DECLARATION" "HELD_BY_IMPORT_CUSTOMS" "HELD_BY_EXPORT_CUSTOMS" "DELIVERED_TO_NEIGHBOUR" "DELIVERED_SPECIFIED_SAFE_PLACE" "PARCEL_COLLECTED_FROM_PICKUP_POINT" "AWAITING_COLLECTION_FROM_PICKUP_POINT" "NOT_COLLECTED_FROM_PICKUP_POINT" "DELIVERED_TO_LOCKER_COLLECTION_POINT" "DELIVERED_TO_ALTERNATIVE_DELIVERY_LOCATION" "HELD_BY_CARRIER_FOR_CLEARANCE_PRE_PROCESSING" "PARCEL_OVER_LABELLED" "PARCEL_OUTSIDE_OF_SERVICE_CAPABILITY" "PARCEL_UPDATE_NOTIFICATION_VIA_SMS" "PARCEL_UPDATE_NOTIFICATION_VIA_EMAIL" "ATTEMPTED_DELIVERY" "ATTEMPTED_DELIVERY_2ND" "ATTEMPTED_DELIVERY_3RD" "READY_FOR_PACKING" "CANCELLED_BEFORE_DESPATCH" "RETURN_CREATED" "RETURN_NEEDS_APPROVAL" "RETURN_APPROVED" "RETURN_LABEL_CREATED" "RETURN_CANCELLED" "RETURN_REJECTED" "RETURN_WINDOW_EXPIRED" "RETURN_RECEIVED" "RETURN_COMPLETED" "RETURN_COMPLETED_IN_PART" "RETURN_NOT_COMPLETED"
eventDate
required
string <date-time>

Date and time when the event occured.

eventSource
string

Source of the event, such as CARRIER or STORE.

eventTimeZone
required
string

Time zone at the location of the event.

object (EventLocation)

Location information where the event occured.

Responses
204

Tracking event has been published successfully

400

Bad request.

The request failed validation due to missing required information in the parameters or the body of the request.

Error code: PS-0400.

401

Unauthorized.

The request did not provide the credentials required to authorize access to the API.

Error code: PS-0401.

403

Forbidden.

The API user is not authorized to proceed with the processing of the request.

Error code: PS-0403.

415

Unsupported media format.

The request failed due to an unsupported media type in the request.

Error code: PS-0415.

500

Internal Server Error.

The processing of the request failed due to an internal problem. The request needs to be retried.

Error code: PS-0500.

post/delivery-legs/events
Request samples
application/json
{
  • "trackingIdentifier": "REPLACE-WITH-YOUR-TRACKING-IDENTIFIER",
  • "eventCode": "AWAITING_COLLECTION_FROM_PICKUP_POINT",
  • "eventDate": "2019-08-24T14:15:22Z",
  • "eventSource": "STORE",
  • "eventTimeZone": "Europe/London",
  • "eventLocation": {
    }
}
Response samples
application/json
{
  • "message": "This is an error message",
  • "errorCode": "PS-XXXX",
  • "systemMessage": "This is a system message related to the error",
  • "traceId": "4d1544c7-1977-4c03-82fa-ecacd1837532",
  • "timestamp": "2019-08-24T14:15:22Z"
}