Add events for a delivery

A delivery event is an event published by a seller that relates to the status of a delivery pre-allocation, such as an order being processed or awaiting payment.

Delivery events can be defined before a trackable item exists.

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
deliveryRef
required
string

The unique delivery reference. This reference is used to link a delivery for an order with the delivery legs for the parcels within this delivery that are part of the order.

eventCode
required
string

Metapack event code.

Enum: "ORDER_ACCEPTED" "PAYMENT_SUCCESSFUL" "PAYMENT_DECLINED" "CANCELLED_BEFORE_DESPATCH" "ORDER_DECLINED" "PERSONALISATION_STARTED" "PERSONALISATION_ISSUE" "AWAITING_FULFILMENT" "PERSONALISATION_COMPLETED" "READY_FOR_PACKING" "DESPATCH_DELAYED" "DESPATCH_DELAYED_IN_PART" "RETURN_CREATED" "RETURN_NEEDS_APPROVAL" "RETURN_APPROVED" "RETURN_CANCELLED" "RETURN_REJECTED" "RETURN_WINDOW_EXPIRED" "RETURN_NOT_COMPLETED" "RETURN_COMPLETED" "RETURN_COMPLETED_IN_PART"
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

Delivery 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/deliveries/events
Request samples
application/json
{
  • "deliveryRef": "REPLACE-WITH-YOUR-DELIVERY-REF",
  • "eventCode": "ORDER_ACCEPTED",
  • "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"
}