Download OpenAPI specification:Download
The Relay v2 Shipping API is designed to let retailers and marketplaces start shipping with Relay fast.
You'll need to contact Relay at j.hoon@relaytech.co or r.ladbrook@relaytech.co to request an API key and register your retailer locations (warehouses).
The Relay API uses HTTP Bearer Authentication. This means that to let us know it's really you calling the Relay API, you'll need to include a header in your request of the form Relay-Authorization: Bearer $YOUR_API_KEY. We also require that all requests to the API be made over HTTPS.
We attempt to follow a few conventions throughout the API:
The current shipment status and its history can be accessed through the status and events fields respectively. Events offer more context for status changes but please note that multiple events can map to the same status.
| Status | Explanation | Description in API response |
|---|---|---|
| pending | The shipment is waiting in our system. The shipment can be cancelled while in this status. | Order details received |
| cancelled | The shipment has been cancelled. Relay will not collect or attempt to deliver the shipment. | Cancelled by the sender |
| delivered | The shipment has been delivered to the end customer. | Delivered |
| failed | The shipment failed the delivery attempt to the end customer. | Delivery attempt failed |
| scheduled | The shipment has been assigned a delivery route. | Scheduled for delivery |
| out_for_delivery | The shipment is on its assigned delivery route. | Out for delivery with our courier |
| lost | The shipment location is unknown and therefore considered as lost in transit. | Unable to locate your order |
| manifested_not_received | The shipment was expected to be collected but was not. | Order not received from the sender |
| delayed | The shipment is delayed. | Delayed |
| discarded | The parcel is not suitable for delivery. | Damaged parcel discarded by Relay |
| inbound_return | The delivery is being sent back to the retailer. | Delivery back to retailer |
| damaged_upon_receipt | The shipment is damaged. | Damaged upon receipt by Relay |
| received | The shipment is confirmed to be collected. | Order received from the sender |
| max_attempts_reached_rts_pending | All delivery attempts have failed so the shipment will be returned to the sender. | Maximum delivery attempts reached |
| customer_rejected_rts_pending | The end customer refused to accept the delivery. | Customer refused delivery |
| hsc_received_rts_parcel | The return to sender shipment has reached the Relay Hub. | Parcel returned to Relay Hub, |
| hsc_received_inbound_return | The parcel has been received at the Relay Hub. | Parcel received at Relay Hub |
| rts_parcel_dispatched | The return to sender shipment has been dispatched to the sender. | Parcel returned to the sender |
| rts_pending | The shipment is being returned to the sender. | Returning to the sender |
| customer_collected | The customer has collected the parcel. | Customer collected the parcel |
| preparing_customer_collection | The parcel is being prepared for customer collection. | Preparing for customer collection |
| awaiting_customer_collection | The shipment is ready for customer collection at the pitstop. | Ready for customer collection at pitstop |
| customer_collection_delayed | The customer collection is delayed. | Pickup Delayed |
| received_at_pitstop | The shipment is received at a pitstop. | Received at pitstop |
| awaiting_parcel_drop_off | The shipment is awaiting a parcel drop off. | Expecting Your Parcel |
| driver_collected_parcel_from_pitstop | The courier has collected the parcel from the pitstop. | Courier Collected Your Parcel |
| rts_awaiting_customer_collection | The return to sender parcel is ready for customer collection at the pitstop. | Ready for customer collection at pitstop |
| rts_customer_collected | The customer has collected the return to sender parcel. | Customer collected the parcel |
| rts_failed | The return to sender shipment has failed. | Failed to return to the sender |
| processed_at_gateway | The parcel has been processed at a Relay gateway. | Parcel was processed at a Relay gateway |
| entered_relay_network | The parcel has entered the Relay network. | Parcel has entered the Relay network |
| Category | Description | Example Events |
|---|---|---|
| shipment_created | Shipment creation events | new_shipment_to_customer, new_c2c_shipment |
| shipment_received | Package sorting and routing events | sortation_scan, sortation_intake_scan |
| in_transit | In-transit movement events | pitstop_shipment_checkin, lm_out_for_delivery, lm_delivery_failed |
| delivered | Final delivery outcome events | handed_to_customer, left_in_safe_place, collected_by_customer |
| error | Problem and error state events | agent_flagged_as_lost, retailer_cancelled, collection_expired |
Events provide more context for status changes.
| Event Name | Description | Category |
|---|---|---|
| new_shipment_to_customer | Shipment created for delivery to a customer | shipment_created |
| new_shipment_to_retailer | Shipment created for delivery to a retailer | shipment_created |
| new_c2c_shipment | Customer-to-customer shipment created | shipment_created |
| new_l2l_collection_shipment | Shipment created for delivery from a marketplace retailer to a customer | shipment_created |
| sortation_scan | Package scanned during sorting process | shipment_received |
| pitstop_shipment_checkin | Individual shipment checked into pitstop | in_transit |
| lm_out_for_delivery | Shipment out for delivery by courier | in_transit |
| lm_delivery_failed | Delivery attempt failed | in_transit |
| handed_to_customer | Package successfully delivered to customer | delivered |
| left_in_safe_place | Package left in customer's designated safe location | delivered |
| handed_to_neighbour | Package delivered to customer's neighbour | delivered |
| pod_upload | Proof of delivery images uploaded | delivered |
| agent_flagged_as_lost | Agent marked package as lost | error |
| automatic_cleanup_lost | System automatically marked shipment as lost | error |
| agent_flagged_as_return_to_sender | Agent marked package for return to sender | error |
| sortation_exception_return_to_sender | Package returned to sender due to sorting exception | error |
| sortation_exception_discard | Package discarded due to sorting exception | error |
| too_many_attempts_rts | Package returned to sender after too many delivery attempts | error |
| retailer_cancelled | Shipment cancelled by retailer | error |
| sortation_intake_scan | Package received at sorting facility | shipment_received |
| rts_dispatch_scan | Return to sender package dispatched | delivered |
| customer_refused_delivery_rts | Customer refused delivery, returning to sender | error |
| inbound_intake_scan | Package scanned at inbound facility | shipment_received |
| handed_to_retailer | Package delivered to retailer location | delivered |
| collected_by_customer | Package collected by customer from pickup point | delivered |
| collected_by_sender | Package collected by sender | delivered |
| awaiting_customer_collection | Package ready for customer collection at pitstop | in_transit |
| awaiting_sender_collection | Package ready for sender collection | in_transit |
| customer_collection_requested | Customer has requested to collect package from a pitstop | in_transit |
| collection_expiry_reminder | Reminder sent that collection window is expiring soon | in_transit |
| collection_expired | Collection window expired | error |
| assign_to_route | Shipment assigned to a delivery route | in_transit |
| lm_delivery_did_not_attempt | Delivery was not attempted | error |
| rts_intake_scan | Return to sender package received at facility | in_transit |
| drop_off_expired | Drop-off window expired | error |
| shipment_discarded | Package discarded due to damage or other issues | error |
| sortation_box_scan_received | Package box scan received at sortation | shipment_received |
| pitstop_destination_redirected | Shipment destination redirected to a different pitstop | in_transit |
| pitstop_origin_redirected | Shipment origin redirected to a different pitstop | in_transit |
| services | Array of strings (Services) Items Enum: "customer_delivery" "customer_collection" "customer_return" "customer_to_customer" "customer_to_customer_offboarding" "customer_drop_off" "l2l_drop_off" "customer_collection_pause" "customer_to_customer_pause" |
Postcode (string) or Postcode (null) (Postcode) | |
Latlon (string) or Latlon (null) (Latlon) | |
| radius_m | integer (Radius M) Default: 8000 |
| limit | integer (Limit) Default: 30 |
Forwarded (string) or Forwarded (null) (Forwarded) |
[- {
- "address": {
- "country_iso": "GBR",
- "county": "string",
- "lat": 0,
- "line1": "string",
- "line2": "string",
- "line3": "string",
- "line4": "string",
- "lon": 0,
- "organisation": "string",
- "postcode": "string",
- "town": "string"
}, - "code": "string",
- "distance_from_search_point_m": 0,
- "name": "string",
- "opening_hours": [
- {
- "closes": "string",
- "dow": "string",
- "opens": "string"
}
], - "pudo_type": "pitstop",
- "supported_services": [
- "customer_delivery"
]
}
]Array of Services (strings) or Services (null) (Services) |
Forwarded (string) or Forwarded (null) (Forwarded) |
[- {
- "address": {
- "country_iso": "GBR",
- "county": "string",
- "lat": 0,
- "line1": "string",
- "line2": "string",
- "line3": "string",
- "line4": "string",
- "lon": 0,
- "organisation": "string",
- "postcode": "string",
- "town": "string"
}, - "code": "string",
- "name": "string",
- "opening_hours": [
- {
- "closes": "string",
- "dow": "string",
- "opens": "string"
}
], - "pudo_type": "pitstop",
- "supported_services": [
- "customer_delivery"
]
}
]This endpoint is used to create a new shipment with the specified details, including origin, destination, parcel information, and service type.
You can optionally specify a label configuration to control how the label is generated. You can also decide not to generate a label in this request.
Forwarded (string) or Forwarded (null) (Forwarded) |
Box Number (string) or Box Number (null) (Box Number) The box number for the delivery that contains this shipment. This should be applied to every shipment covered by the same box. | |
required | ExternalApiCustomerLocation (object) or ExternalApiPudoLocationRequiredCode (object) or ExternalApiRetailerLocation (object) (Destination) The location to which this shipment is destined. |
SafePlace (object) or null A safe place to put the parcel if the shipment cannot be delivered to the destination address. | |
End Customer Promise Date (string) or End Customer Promise Date (null) (End Customer Promise Date) Date of the customer delivery promise. What is the last possible date the retailer has committed to the customer that the delivery will occur. | |
FMOrigin (string) or null The first mile origin type for the shipment (international or domestic). | |
LabelConfig (object) or null | |
required | ExternalApiPudoLocationWithHandoverInput (object) or ExternalApiRetailerLocation (object) or ExternalApiMarketplaceRetailerLocation (object) (Origin) The location from which this shipment originates. This could be a retailer or pudo location |
required | object (Parcel-Input) |
Retailer Brand (string) or Retailer Brand (null) (Retailer Brand) | |
Retailer Brand Id (string) or Retailer Brand Id (null) (Retailer Brand Id) | |
Retailer Code (string) or Retailer Code (null) (Retailer Code) A unique code identifying the retailer initiating the shipment. | |
| service_type required | string (ExternalApiInputServiceType) Enum: "next_day" "two_day" "five_day" "next_day_upgrade" "inbound_return" "customer_to_customer" "customer_drop_off" The type of delivery service. For example 'next_day', means a shipment created on day T (before the daily cut-off time) will be delivered on day T+1 (e.g. Monday -> Tuesday). As Relay adds more delivery services, we will add more options to this field. |
| shipper_metadata | any (Shipper Metadata) Capture miscellaneous events and data on the shipment that does not fit into the existing fields. |
Waybill Number (string) or Waybill Number (null) (Waybill Number) The AWB number for the delivery that contains this shipment. This should be applied to every shipment covered by the same waybill. |
{- "box_number": "string",
- "destination": {
- "customer": {
- "address": {
- "country_iso": "GBR",
- "county": "string",
- "lat": 0,
- "line1": "string",
- "line2": "string",
- "line3": "string",
- "line4": "string",
- "lon": 0,
- "organisation": "string",
- "postcode": "string",
- "town": "string"
}, - "email": "string",
- "mobile": "string",
- "name": "string",
- "reference": "string"
}, - "location_type": "customer"
}, - "destination_alternative": {
- "building_entry_code": "string",
- "details": "string",
- "neighbour_door_number": "string",
- "safe_place_type": "receptionist"
}, - "end_customer_promise_date": "2019-08-24",
- "fm_origin": "international",
- "label_config": {
- "add_base64_to_response": false,
- "custom_text": "string",
- "fileformat": "PDF",
- "mode": "printable"
}, - "origin": {
- "customer": {
- "address": {
- "country_iso": "GBR",
- "county": "string",
- "lat": 0,
- "line1": "string",
- "line2": "string",
- "line3": "string",
- "line4": "string",
- "lon": 0,
- "organisation": "string",
- "postcode": "string",
- "town": "string"
}, - "email": "string",
- "mobile": "string",
- "name": "string",
- "reference": "string"
}, - "handover_notes": "string",
- "handover_window_begins": "2019-08-24T14:15:22Z",
- "handover_window_ends": "2019-08-24T14:15:22Z",
- "location_type": "pudo",
- "pudo_code": "string"
}, - "parcel": {
- "contents": [
- {
- "depth_cm": 0,
- "description": "string",
- "id": "string",
- "length_cm": 0,
- "name": "string",
- "quantity": 0,
- "reference": "string",
- "return_reason": "wrong_size",
- "sku": "string",
- "total_value": 0,
- "total_value_unit": "string",
- "weight_kg": 0,
- "width_cm": 0
}
], - "description": "string",
- "external_id": "string",
- "external_reference": "string",
- "internal_reference": "string",
- "measurements": {
- "depth_cm": 0,
- "length_cm": 0,
- "package_format": "cardboard_box",
- "package_type": "small_box",
- "weight_kg": 0,
- "width_cm": 0
}, - "order_number": "string",
- "original_order_datetime": "2019-08-24T14:15:22Z",
- "parcel_tags": [
- "fragile"
], - "value": 0,
- "value_unit": "string"
}, - "retailer_brand": "string",
- "retailer_brand_id": "string",
- "retailer_code": "string",
- "service_type": "next_day",
- "shipper_metadata": null,
- "waybill_number": "string"
}{- "box_number": "string",
- "code": "string",
- "created_at": "2019-08-24T14:15:22Z",
- "destination": {
- "customer": {
- "address": {
- "country_iso": "GBR",
- "county": "string",
- "lat": 0,
- "line1": "string",
- "line2": "string",
- "line3": "string",
- "line4": "string",
- "lon": 0,
- "organisation": "string",
- "postcode": "string",
- "town": "string"
}, - "email": "string",
- "mobile": "string",
- "name": "string",
- "reference": "string"
}, - "location_type": "customer"
}, - "destination_alternative": {
- "building_entry_code": "string",
- "details": "string",
- "neighbour_door_number": "string",
- "safe_place_type": "receptionist"
}, - "end_customer_promise_date": "2019-08-24",
- "fm_origin": "international",
- "label": {
- "contents_base64": "string",
- "custom_text": "string",
- "file_format": "PDF"
}, - "origin": {
- "customer": {
- "address": {
- "country_iso": "GBR",
- "county": "string",
- "lat": 0,
- "line1": "string",
- "line2": "string",
- "line3": "string",
- "line4": "string",
- "lon": 0,
- "organisation": "string",
- "postcode": "string",
- "town": "string"
}, - "email": "string",
- "mobile": "string",
- "name": "string",
- "reference": "string"
}, - "location_type": "customer"
}, - "parcel": {
- "contents": [
- {
- "depth_cm": 0,
- "description": "string",
- "id": "string",
- "length_cm": 0,
- "name": "string",
- "quantity": 0,
- "reference": "string",
- "return_reason": "wrong_size",
- "sku": "string",
- "total_value": 0,
- "total_value_unit": "string",
- "weight_kg": 0,
- "width_cm": 0
}
], - "description": "string",
- "external_id": "string",
- "external_reference": "string",
- "internal_reference": "string",
- "measurements": {
- "depth_cm": 0,
- "length_cm": 0,
- "package_format": "cardboard_box",
- "package_type": "small_box",
- "weight_kg": 0,
- "width_cm": 0
}, - "order_number": "string",
- "original_order_datetime": "2019-08-24T14:15:22Z",
- "parcel_tags": [
- "fragile"
], - "value": 0,
- "value_unit": "string"
}, - "retailer_brand": "string",
- "retailer_brand_id": "string",
- "retailer_code": "string",
- "service_type": "two_day",
- "shipper_metadata": null,
- "sort_centre_code": "string",
- "waybill_number": "string"
}Forwarded (string) or Forwarded (null) (Forwarded) |
| codes required | Array of strings (Codes) The list of shipment tracking codes to get shipment details for. |
{- "codes": [
- "string"
]
}[- {
- "box_number": "string",
- "created_at": "2019-08-24T14:15:22Z",
- "destination": {
- "customer": {
- "address": {
- "country_iso": "GBR",
- "county": "string",
- "lat": 0,
- "line1": "string",
- "line2": "string",
- "line3": "string",
- "line4": "string",
- "lon": 0,
- "organisation": "string",
- "postcode": "string",
- "town": "string"
}, - "email": "string",
- "mobile": "string",
- "name": "string",
- "reference": "string"
}, - "location_type": "customer"
}, - "destination_alternative": {
- "building_entry_code": "string",
- "details": "string",
- "neighbour_door_number": "string",
- "safe_place_type": "receptionist"
}, - "end_customer_promise_date": "2019-08-24",
- "fm_origin": "international",
- "origin": {
- "customer": {
- "address": {
- "country_iso": "GBR",
- "county": "string",
- "lat": 0,
- "line1": "string",
- "line2": "string",
- "line3": "string",
- "line4": "string",
- "lon": 0,
- "organisation": "string",
- "postcode": "string",
- "town": "string"
}, - "email": "string",
- "mobile": "string",
- "name": "string",
- "reference": "string"
}, - "location_type": "customer"
}, - "parcel": {
- "contents": [
- {
- "depth_cm": 0,
- "description": "string",
- "id": "string",
- "length_cm": 0,
- "name": "string",
- "quantity": 0,
- "reference": "string",
- "return_reason": "wrong_size",
- "sku": "string",
- "total_value": 0,
- "total_value_unit": "string",
- "weight_kg": 0,
- "width_cm": 0
}
], - "description": "string",
- "external_id": "string",
- "external_reference": "string",
- "internal_reference": "string",
- "measurements": {
- "depth_cm": 0,
- "length_cm": 0,
- "package_format": "cardboard_box",
- "package_type": "small_box",
- "weight_kg": 0,
- "width_cm": 0
}, - "order_number": "string",
- "original_order_datetime": "2019-08-24T14:15:22Z",
- "parcel_tags": [
- "fragile"
], - "value": 0,
- "value_unit": "string"
}, - "retailer_brand": "string",
- "retailer_brand_id": "string",
- "retailer_code": "string",
- "service_type": "two_day",
- "shipper_metadata": null,
- "sort_centre_code": "string",
- "waybill_number": "string"
}
]Forwarded (string) or Forwarded (null) (Forwarded) |
| codes required | Array of strings (Codes) The list of shipment tracking codes to get statuses for. |
{- "codes": [
- "string"
]
}[- {
- "events": [
- {
- "event_category": "shipment_created",
- "event_name": "new_shipment_to_customer",
- "occurred_at": "2019-08-24T14:15:22Z",
- "status": "pending",
- "status_description": "string"
}
], - "last_scan_location": "string",
- "last_updated_at": "2019-08-24T14:15:22Z",
- "pods": [
- {
- "captured_at": "2019-08-24T14:15:22Z",
- "coordinates": {
- "lat": 0,
- "lon": 0
},
}
], - "shipment_code": "string",
- "status": "active"
}
]Bulk update barcodes with their associated waybill and box numbers.
Forwarded (string) or Forwarded (null) (Forwarded) |
required | Array of objects (Boxes) The boxes and their associated barcodes. |
| waybill_number required | string (Waybill Number) The AWB number that applies to all barcodes in this request. |
{- "boxes": [
- {
- "barcodes": [
- "string"
], - "box_number": "string"
}
], - "waybill_number": "string"
}{- "message": "string",
- "success": true
}Update WMS data for a list of shipments
Forwarded (string) or Forwarded (null) (Forwarded) |
required | Array of objects (Updates) The list of shipment WMS data updates. |
{- "updates": [
- {
- "code": "string",
- "wms_data": {
- "container": {
- "closed_at": "2019-08-24T14:15:22Z",
- "created_at": "2019-08-24T14:15:22Z",
- "handed_over_to_carrier_at": "2019-08-24T14:15:22Z",
- "id": "string"
}, - "items": [
- {
- "packed_at": "2019-08-24T14:15:22Z",
- "picked_at": "2019-08-24T14:15:22Z",
- "quantity": 0,
- "sku_id": "string",
- "warehouse_in_stock": true,
- "warehouse_stock_count": 0
}
], - "label_created_at": "2019-08-24T14:15:22Z",
- "order_allocated_to_wave_at": "2019-08-24T14:15:22Z",
- "order_packed_at": "2019-08-24T14:15:22Z",
- "order_picked_at": "2019-08-24T14:15:22Z",
- "order_scanned_into_container_at": "2019-08-24T14:15:22Z",
- "origin_retailer": {
- "collected_at": "2019-08-24T14:15:22Z",
- "dropped_off_at": "2019-08-24T14:15:22Z"
}, - "volumiser": {
- "depth_cm": 0,
- "length_cm": 0,
- "measured_at": "2019-08-24T14:15:22Z",
- "weight_kg": 0,
- "width_cm": 0
}
}
}
]
}{- "message": "string",
- "success": true
}| code required | string (Code) |
Forwarded (string) or Forwarded (null) (Forwarded) |
{- "box_number": "string",
- "created_at": "2019-08-24T14:15:22Z",
- "destination": {
- "customer": {
- "address": {
- "country_iso": "GBR",
- "county": "string",
- "lat": 0,
- "line1": "string",
- "line2": "string",
- "line3": "string",
- "line4": "string",
- "lon": 0,
- "organisation": "string",
- "postcode": "string",
- "town": "string"
}, - "email": "string",
- "mobile": "string",
- "name": "string",
- "reference": "string"
}, - "location_type": "customer"
}, - "destination_alternative": {
- "building_entry_code": "string",
- "details": "string",
- "neighbour_door_number": "string",
- "safe_place_type": "receptionist"
}, - "end_customer_promise_date": "2019-08-24",
- "fm_origin": "international",
- "origin": {
- "customer": {
- "address": {
- "country_iso": "GBR",
- "county": "string",
- "lat": 0,
- "line1": "string",
- "line2": "string",
- "line3": "string",
- "line4": "string",
- "lon": 0,
- "organisation": "string",
- "postcode": "string",
- "town": "string"
}, - "email": "string",
- "mobile": "string",
- "name": "string",
- "reference": "string"
}, - "location_type": "customer"
}, - "parcel": {
- "contents": [
- {
- "depth_cm": 0,
- "description": "string",
- "id": "string",
- "length_cm": 0,
- "name": "string",
- "quantity": 0,
- "reference": "string",
- "return_reason": "wrong_size",
- "sku": "string",
- "total_value": 0,
- "total_value_unit": "string",
- "weight_kg": 0,
- "width_cm": 0
}
], - "description": "string",
- "external_id": "string",
- "external_reference": "string",
- "internal_reference": "string",
- "measurements": {
- "depth_cm": 0,
- "length_cm": 0,
- "package_format": "cardboard_box",
- "package_type": "small_box",
- "weight_kg": 0,
- "width_cm": 0
}, - "order_number": "string",
- "original_order_datetime": "2019-08-24T14:15:22Z",
- "parcel_tags": [
- "fragile"
], - "value": 0,
- "value_unit": "string"
}, - "retailer_brand": "string",
- "retailer_brand_id": "string",
- "retailer_code": "string",
- "service_type": "two_day",
- "shipper_metadata": null,
- "sort_centre_code": "string",
- "waybill_number": "string"
}Update the details of an existing shipment.
| code required | string (Code) |
Forwarded (string) or Forwarded (null) (Forwarded) |
Box Number (string) or Box Number (null) (Box Number) | |
End Customer Promise Date (string) or End Customer Promise Date (null) (End Customer Promise Date) | |
| shipper_metadata | any (Shipper Metadata) |
Waybill Number (string) or Waybill Number (null) (Waybill Number) |
{- "box_number": "string",
- "end_customer_promise_date": "2019-08-24",
- "shipper_metadata": null,
- "waybill_number": "string"
}{- "message": "string",
- "success": true
}| code required | string (Code) |
Forwarded (string) or Forwarded (null) (Forwarded) |
{- "calls_to_customer": [
- {
- "call_duration_sec": 0,
- "occurred_at": "2019-08-24T14:15:22Z"
}
], - "courier_note": "string",
- "delivery_failures": [
- {
- "failure_reason": "no_answer_from_customer",
- "failure_reason_description": "string"
}
], - "pods": [
- {
- "captured_at": "2019-08-24T14:15:22Z",
- "coordinates": {
- "lat": 0,
- "lon": 0
},
}
], - "safe_place": {
- "building_entry_code": "string",
- "details": "string",
- "images": [ ],
- "neighbour_door_number": "string",
- "safe_place_type": "receptionist",
- "updated_at": "2019-08-24T14:15:22Z"
}, - "status": "pending"
}| code required | string (Code) |
ShipmentLabelType (string) or Mode (null) (Mode) | |
LabelFileFormat (string) or Fileformat (null) (Fileformat) |
Forwarded (string) or Forwarded (null) (Forwarded) |
null| code required | string (Code) |
Forwarded (string) or Forwarded (null) (Forwarded) |
{- "events": [
- {
- "event_category": "shipment_created",
- "event_name": "new_shipment_to_customer",
- "occurred_at": "2019-08-24T14:15:22Z",
- "status": "pending",
- "status_description": "string"
}
], - "last_scan_location": "string",
- "last_updated_at": "2019-08-24T14:15:22Z",
- "pods": [
- {
- "captured_at": "2019-08-24T14:15:22Z",
- "coordinates": {
- "lat": 0,
- "lon": 0
},
}
], - "shipment_code": "string",
- "status": "active"
}Update WMS data for a shipment
| code required | string (Code) |
Forwarded (string) or Forwarded (null) (Forwarded) |
WMSContainerData (object) or null | |
Array of Items (objects) or Items (null) (Items) | |
Label Created At (string) or Label Created At (null) (Label Created At) | |
Order Allocated To Wave At (string) or Order Allocated To Wave At (null) (Order Allocated To Wave At) | |
Order Packed At (string) or Order Packed At (null) (Order Packed At) | |
Order Picked At (string) or Order Picked At (null) (Order Picked At) | |
Order Scanned Into Container At (string) or Order Scanned Into Container At (null) (Order Scanned Into Container At) | |
WMSOriginRetailerData (object) or null | |
WMSVolumiserData (object) or null |
{- "container": {
- "closed_at": "2019-08-24T14:15:22Z",
- "created_at": "2019-08-24T14:15:22Z",
- "handed_over_to_carrier_at": "2019-08-24T14:15:22Z",
- "id": "string"
}, - "items": [
- {
- "packed_at": "2019-08-24T14:15:22Z",
- "picked_at": "2019-08-24T14:15:22Z",
- "quantity": 0,
- "sku_id": "string",
- "warehouse_in_stock": true,
- "warehouse_stock_count": 0
}
], - "label_created_at": "2019-08-24T14:15:22Z",
- "order_allocated_to_wave_at": "2019-08-24T14:15:22Z",
- "order_packed_at": "2019-08-24T14:15:22Z",
- "order_picked_at": "2019-08-24T14:15:22Z",
- "order_scanned_into_container_at": "2019-08-24T14:15:22Z",
- "origin_retailer": {
- "collected_at": "2019-08-24T14:15:22Z",
- "dropped_off_at": "2019-08-24T14:15:22Z"
}, - "volumiser": {
- "depth_cm": 0,
- "length_cm": 0,
- "measured_at": "2019-08-24T14:15:22Z",
- "weight_kg": 0,
- "width_cm": 0
}
}{- "message": "string",
- "success": true
}Get customer collection details for a shipment including QR code, collection code, and pitstop information.
| tracking_number required | string (Tracking Number) |
Forwarded (string) or Forwarded (null) (Forwarded) |
{- "collection_code": "string",
- "pitstop": {
- "address": {
- "country_iso": "GBR",
- "county": "string",
- "lat": 0,
- "line1": "string",
- "line2": "string",
- "line3": "string",
- "line4": "string",
- "lon": 0,
- "organisation": "string",
- "postcode": "string",
- "town": "string"
}, - "code": "string",
- "name": "string",
- "opening_hours": [
- {
- "closes": "string",
- "dow": "string",
- "opens": "string"
}
], - "pudo_type": "pitstop",
- "supported_services": [
- "customer_delivery"
]
}, - "qr_code": "string"
}Get postcode exclusions for the authenticated shipper.
Returns additions (newly excluded postcodes) and removals (no longer excluded postcodes) based on the timestamp parameter.
If no timestamp is provided, returns all current exclusions as additions.
Polling behavior:
When an outcode is removed from exclusions (e.g., becomes whitelisted), any blacklisted postcodes within that outcode are automatically included as additions. This ensures that individual postcode exclusions are not accidentally cleared when their parent outcode becomes supported.
Timestamp (integer) or Timestamp (null) (Timestamp) Unix timestamp in seconds. If provided, returns only changes since this timestamp. If not provided, returns all current exclusions. |
Forwarded (string) or Forwarded (null) (Forwarded) |
{- "additions": [
- {
- "level": 1,
- "postcode": "string"
}
], - "last_updated_at": 0,
- "removals": [
- {
- "level": 1,
- "postcode": "string"
}
]
}When events occur, Relay sends a POST request to your webhook URL with a JSON payload:
{
"event_name": "handed_to_customer",
"event_category": "delivered",
"occurred_at": "2024-01-15T14:30:00Z",
"shipment_code": "RELAY123456",
"status": "delivered",
"status_description": "Delivered",
"event_history": [...],
"event_details": {...}
}
Some webhook events include additional details in an event_details field (only available with the default presenter).
| Event Name | Field | Description |
|---|---|---|
| pod_upload | pods |
List of proof of delivery images with signed URLs (valid for 7 days) |
| customer_collection_requested | address_change |
Old and new address details when customer requests pitstop collection |
| pitstop_destination_redirected | address_change |
Old and new address details when shipment destination is redirected to a different pitstop |
| pitstop_origin_redirected | address_change |
Old and new address details when shipment origin is redirected to a different pitstop |
| new_c2c_shipment | handover_details |
Handover code and window for parcel drop-off at the origin pitstop |
| awaiting_customer_collection | handover_details |
Handover code, QR code URL, pudo code, and collection window for customer collection |
| awaiting_sender_collection | handover_details |
Handover code, QR code URL, pudo code, and collection window for sender collection (RTS) |
| pitstop_shipment_checkin | handover_details |
PUDO code of the pitstop where the parcel was dropped off (only for received_at_pitstop status) |
| lm_delivery_failed | delivery_failure |
Failure reason and description when a last-mile delivery attempt fails |
{
"old_address": {
"organisation": null,
"line1": "123 Example Street",
"line2": "Flat 4",
"line3": null,
"line4": null,
"town": "London",
"county": null,
"postcode": "SW1A 1AA",
"country_iso": "GBR",
"lat": null,
"lon": null
},
"old_pudo_code": "PST001",
"new_address": {
"organisation": null,
"line1": "123 Example Street",
"line2": "Flat 4",
"line3": null,
"line4": null,
"town": "London",
"county": null,
"postcode": "SW1A 1AA",
"country_iso": "GBR",
"lat": null,
"lon": null
},
"new_pudo_code": "PST002",
"changed_at": "2024-01-15T14:30:00.000000+00:00"
}
[{
"image": "https://storage.googleapis.com/example/pod-image.jpg",
"captured_at": "2024-01-15T14:30:00.000000+00:00",
"coordinates": {
"lat": 51.5074,
"lon": -0.1278
}
}, {
"image": "https://storage.googleapis.com/example/pod-image-2.jpg",
"captured_at": "2024-01-15T14:30:00.000000+00:00",
"coordinates": {
"lat": 51.5074,
"lon": -0.1278
}
}]
{
"handover_code": "RELHO12345678",
"handover_qr_code": "https://relay-production.relaytechapis.co/v0/customer-portal/qr-code?collection_code=RELHO12345678",
"pudo_code": "PST001",
"handover_window_begins": "2024-01-15T08:00:00.000000+00:00",
"handover_window_ends": "2024-01-22T18:00:00.000000+00:00"
}
{
"failure_reason": "no_answer_from_customer",
"failure_reason_description": "No Answer from Customer"
}
All webhook requests include an x-relay-signature header containing an HMAC-SHA256 signature of the payload.
Use your webhook signing key to verify the signature and ensure the request is from Relay.
Retailer Code (string) or Retailer Code (null) (Retailer Code) |
Forwarded (string) or Forwarded (null) (Forwarded) |
{- "webhooks": [
- {
- "created_at": "2019-08-24T14:15:22Z",
- "custom_config": {
- "headers": {
- "property1": "string",
- "property2": "string"
}, - "method": "POST"
}, - "custom_presenter": "default",
- "include_event_history": true,
- "subscribed_events": [
- "new_shipment_to_customer"
], - "uid": "07cc67f4-45d6-494b-adac-09b5cbc7e2b5",
- "updated_at": "2019-08-24T14:15:22Z",
}
]
}Forwarded (string) or Forwarded (null) (Forwarded) |
WebhookCustomConfig (object) or null | |
ExternalApiWebhookPresenter (string) or null | |
Include Event History (boolean) or Include Event History (null) (Include Event History) | |
Retailer Code (string) or Retailer Code (null) (Retailer Code) | |
Array of Subscribed Events (strings) or Subscribed Events (null) (Subscribed Events) | |
| webhook_uid required | string <uuid> (Webhook Uid) |
{- "custom_config": {
- "headers": {
- "property1": "string",
- "property2": "string"
}, - "method": "POST"
}, - "custom_presenter": "default",
- "include_event_history": true,
- "retailer_code": "string",
- "subscribed_events": [
- "new_shipment_to_customer"
], - "webhook_uid": "e00a5c66-81c3-4565-a0c1-eaf5f6e2efe1"
}{- "created_at": "2019-08-24T14:15:22Z",
- "custom_config": {
- "headers": {
- "property1": "string",
- "property2": "string"
}, - "method": "POST"
}, - "custom_presenter": "default",
- "detail": "string",
- "include_event_history": true,
- "subscribed_events": [
- "new_shipment_to_customer"
], - "updated_at": "2019-08-24T14:15:22Z",
- "webhook_uid": "e00a5c66-81c3-4565-a0c1-eaf5f6e2efe1",
}Forwarded (string) or Forwarded (null) (Forwarded) |
required | object (WebhookCustomConfig) |
| custom_presenter required | string (ExternalApiWebhookPresenter) Enum: "default" "simple" Allows API consumers to choose between a simplified or more detailed webhook data format. |
Include Event History (boolean) or Include Event History (null) (Include Event History) | |
Retailer Code (string) or Retailer Code (null) (Retailer Code) | |
| subscribed_events required | Array of strings (Subscribed Events) Items Enum: "new_shipment_to_customer" "new_shipment_to_retailer" "new_c2c_shipment" "new_l2l_collection_shipment" "sortation_scan" "pitstop_shipment_checkin" "lm_out_for_delivery" "lm_delivery_failed" "handed_to_customer" "left_in_safe_place" "handed_to_neighbour" "pod_upload" "agent_flagged_as_lost" "automatic_cleanup_lost" "agent_flagged_as_return_to_sender" "sortation_exception_return_to_sender" "sortation_exception_discard" "too_many_attempts_rts" "retailer_cancelled" "sortation_intake_scan" "rts_dispatch_scan" "customer_refused_delivery_rts" "inbound_intake_scan" "handed_to_retailer" "collected_by_customer" "collected_by_sender" "awaiting_customer_collection" "awaiting_sender_collection" "customer_collection_requested" "collection_expiry_reminder" "collection_expired" "assign_to_route" "lm_delivery_did_not_attempt" "rts_intake_scan" "drop_off_expired" "shipment_discarded" "sortation_box_scan_received" "pitstop_destination_redirected" "pitstop_origin_redirected" |
| webhook_url required | string <uri> (Webhook Url) [ 1 .. 2083 ] characters |
{- "custom_config": {
- "headers": {
- "property1": "string",
- "property2": "string"
}, - "method": "POST"
}, - "custom_presenter": "default",
- "include_event_history": true,
- "retailer_code": "string",
- "subscribed_events": [
- "new_shipment_to_customer"
],
}{- "created_at": "2019-08-24T14:15:22Z",
- "custom_config": {
- "headers": {
- "property1": "string",
- "property2": "string"
}, - "method": "POST"
}, - "custom_presenter": "default",
- "detail": "string",
- "include_event_history": true,
- "subscribed_events": [
- "new_shipment_to_customer"
], - "updated_at": "2019-08-24T14:15:22Z",
- "webhook_uid": "e00a5c66-81c3-4565-a0c1-eaf5f6e2efe1",
}| webhook_uid required | string (Webhook Uid) |
Retailer Code (string) or Retailer Code (null) (Retailer Code) |
Forwarded (string) or Forwarded (null) (Forwarded) |
{- "detail": "string",
- "webhook_uid": "e00a5c66-81c3-4565-a0c1-eaf5f6e2efe1"
}