Developers
Get Started
OpenAPI ↗
REST API v1 · Developer previewLive API credentials are not yet generally available. Approved test access uses sandbox-api.parcelxpert.com.

API reference

Shipments

Persistent organisation-scoped synthetic shipments, filtered history, safe replay and realistic cancellation rules. Live booking is disabled. Production is gated: the adapter reuses PX booking and shared account saved-card authority. Cancellation returns 202 cancellation_pending and no automatic refund.

Hosted sandbox developer preview

Set PX_BASE_URL to https://sandbox-api.parcelxpert.com/v1. Intended live host: https://api.parcelxpert.com/v1. Live requests are not released. Set PX_IDEMPOTENCY_KEY to one stored unique value per write; replace all example quote and shipment IDs with returned IDs.

Create shipment

POST/v1/shipments

Available to approved test accounts in the external sandbox. Synthetic side effects only. Live shipping is disabled. Mandatory Idempotency-Key. Account-scoped durable replay across credentials returns the original 201 body and Idempotency-Replayed. Different payload returns 409. International shipments require DAP customs; collection services require a schedule. Intended live billing belongs to the mapped PX shipping account. Live saved-card charges and carrier purchases remain disabled pending certification and a separately approved bounded pilot. Sandbox payment outcomes are simulated. A declined chosen card returns 402; authentication or reconciliation required returns 409. Complete authentication in the authorised PX account and continue the original idempotent booking. Suppliers and their finances are behind the PX abstraction.

Required scope: shipments:write

Parameters

NameLocationMeaning
Idempotency-Key
required
header8–128 ASCII letters, digits, underscore, dot, colon or hyphen. Account/environment/operation scoped; never reuse for a different request. Sandbox retains keys until reset.

Request body

FieldTypeDescription
quote_id
required
stringTenant-owned, unexpired PX quote ID. Pattern: ^qt_[a-f0-9-]{36}$
sender
required
object
sender.name
required
stringContact full name.
sender.company
optional
stringCompany name.
sender.line1
required
stringStreet address.
sender.line2
optional
stringAdditional address line.
sender.city
required
stringTown/city.
sender.postcode
required
stringPostcode matching quote.
sender.country
required
stringISO 3166-1 alpha-2 uppercase country code. Pattern: ^[A-Z]{2}$
sender.email
required
stringContact email.
sender.phone
required
stringInternational contact telephone number.
sender.state
optional
stringOptional address/customs field; selected service may require it. Gated production extension. Not accepted or returned by the current public sandbox; omit it from sandbox requests.
sender.tax_id
optional
stringOptional address/customs field; selected service may require it. Gated production extension. Not accepted or returned by the current public sandbox; omit it from sandbox requests.
sender.eori
optional
stringOptional address/customs field; selected service may require it. Gated production extension. Not accepted or returned by the current public sandbox; omit it from sandbox requests.
sender.is_business
optional
booleanGated production extension. Not accepted or returned by the current public sandbox; omit it from sandbox requests.
recipient
required
object
recipient.name
required
stringContact full name.
recipient.company
optional
stringCompany name.
recipient.line1
required
stringStreet address.
recipient.line2
optional
stringAdditional address line.
recipient.city
required
stringTown/city.
recipient.postcode
required
stringPostcode matching quote.
recipient.country
required
stringISO 3166-1 alpha-2 uppercase country code. Pattern: ^[A-Z]{2}$
recipient.email
required
stringContact email.
recipient.phone
required
stringInternational contact telephone number.
recipient.state
optional
stringOptional address/customs field; selected service may require it. Gated production extension. Not accepted or returned by the current public sandbox; omit it from sandbox requests.
recipient.tax_id
optional
stringOptional address/customs field; selected service may require it. Gated production extension. Not accepted or returned by the current public sandbox; omit it from sandbox requests.
recipient.eori
optional
stringOptional address/customs field; selected service may require it. Gated production extension. Not accepted or returned by the current public sandbox; omit it from sandbox requests.
recipient.is_business
optional
booleanGated production extension. Not accepted or returned by the current public sandbox; omit it from sandbox requests.
parcels
required
arrayMax items: 100
parcels[].weight
required
numberWeight in kilograms.
parcels[].length
required
numberDimension in centimetres.
parcels[].width
required
numberDimension in centimetres.
parcels[].height
required
numberDimension in centimetres.
contents
required
stringDescription of contents.
customs
optional
object
customs.items
required
arrayMax items: 100
customs.items[].description
required
stringSpecific goods description; avoid generic terms.
customs.items[].quantity
required
integerMinimum: 1
customs.items[].value
required
number
customs.items[].weight
required
numberUnit weight in kilograms.
customs.items[].hs_code
required
string6 to 10 tariff digits. Sandbox validates shape only. Pattern: ^\d{6,10}$
customs.items[].country_of_origin
required
stringISO 3166-1 alpha-2 uppercase country code. Pattern: ^[A-Z]{2}$
customs.currency
required
stringValue currency. Pattern: ^[A-Z]{3}$
customs.reason_for_export
required
stringValues: sale, gift, return, sample, personal_effects, other
customs.terms
required
stringSandbox supports DAP only. Live DDP requires service eligibility and duty settlement; unavailable until reviewed. Values: DAP, DDP
customs.eori
optional
stringSender EORI when required.
customs.recipient_eori
optional
stringRecipient EORI when required.
customs.vat_id
optional
stringSender VAT identifier.
customs.ioss_id
optional
stringIOSS identifier when eligible.
collection
optional
object
collection.date
required
stringCollection date in origin local calendar.
collection.ready_time
required
stringOrigin local time HH:mm. Pattern: ^([01]\d|2[0-3]):[0-5]\d$
collection.close_time
required
stringOrigin local closing time HH:mm, later than ready_time. Pattern: ^([01]\d|2[0-3]):[0-5]\d$
merchant_reference
optional
stringYour order/reference for search.
shipment_reference
optional
stringYour shipment reference.
delivery_instructions
optional
stringInstructions; live support varies by service.
order_id
optional
stringOptional imported order owned by this account.
declared_value
optional
numberPositive contents value. Future live billing requirements are not certified.
service_options
optional
objectGated production extension. Not accepted or returned by the current public sandbox; omit it from sandbox requests.
service_options.packaging
optional
stringRequired only for DPD: confirm a compliant box/mailbag. Surcharged packaging is not offered by this API. Values: box_mailbag
Response schema
FieldTypeDescription
id
required
stringStable PX shipment ID.
reference
required
stringStable PX reference; sandbox uses PXTEST- followed by a synthetic identifier.
status
required
stringValues: created, booking_pending, booked, label_ready, collected, in_transit, out_for_delivery, ready_for_collection, delivered, returned, failed, exception, cancellation_pending, cancelled
courier
required
stringCourier name.
service
required
stringService name.
tracking_number
required
string | null
label_available
required
boolean
label_formats
required
array
collection
required
object | null
merchant_reference
required
string | null
shipment_reference
required
string | null
created_at
required
stringISO 8601 UTC timestamp. Database-backed responses may use +00:00; tracking events and signed webhook payloads use Z.
HTTP responses and errors
201Resource created in local sandbox. No live purchase.
400Malformed JSON, cursor or idempotency header.
401Missing, invalid, expired or revoked key.
402Chosen PX account payment method declined. No fallback card or carrier purchase. Live-only gated behavior.
403Required scope not granted.
404Resource unavailable in this account and environment, or label format unavailable.
405Method not supported.
409Idempotency conflict, request in progress, expired/mismatched quote or cancellation unavailable.
413Body exceeds 256 KiB.
422Schema or capability validation failure.
429Enforced sandbox rate limit reached.
500Unexpected PX failure.
502Provider operation not confirmed. No blind booking retry.
503Provider unavailable or live API not released.

Request example

curl --request POST \
  --url "$PX_BASE_URL/shipments" \
  --header "Authorization: Bearer $PX_API_KEY" \
  --header "Content-Type: application/json" \
  --header "Idempotency-Key: $PX_IDEMPOTENCY_KEY" \
  --data '{
  "quote_id": "qt_00000000-0000-4000-8000-000000000001",
  "sender": {
    "name": "Test Sender",
    "line1": "1 Test Street",
    "city": "Northampton",
    "postcode": "NN1 1AA",
    "country": "GB",
    "email": "sender@example.com",
    "phone": "+441234567890"
  },
  "recipient": {
    "name": "Test Recipient",
    "line1": "1 Test Street",
    "city": "London",
    "postcode": "SW1A 1AA",
    "country": "GB",
    "email": "recipient@example.com",
    "phone": "+441234567890"
  },
  "parcels": [
    {
      "weight": 2,
      "length": 30,
      "width": 20,
      "height": 15
    }
  ],
  "contents": "Cotton T-shirts",
  "merchant_reference": "ORDER-1001"
}'

Response example

{
  "id": "shp_00000000-0000-4000-8000-000000000002",
  "reference": "PX-TEST-000001",
  "status": "booked",
  "courier": "PX Sandbox Courier",
  "service": "Test drop-off",
  "tracking_number": "TEST001",
  "label_available": true,
  "label_formats": [
    "a4"
  ],
  "collection": null,
  "merchant_reference": "ORDER-1001",
  "shipment_reference": null,
  "created_at": "2026-10-04T10:25:00Z"
}

List shipments

GET/v1/shipments

Available to approved test accounts in the external sandbox. Synthetic side effects only. Live shipping is disabled. Mandatory Idempotency-Key. Account-scoped durable replay across credentials returns the original 201 body and Idempotency-Replayed. Different payload returns 409. International shipments require DAP customs; collection services require a schedule.

Required scope: shipments:read

Parameters

NameLocationMeaning
limit
optional
queryPage size. Default 20; maximum 100.
cursor
optional
queryOpaque signed next_cursor. Preserve filters between pages.
status
optional
queryExact normalized status.
created_from
optional
queryInclusive creation timestamp.
created_to
optional
queryInclusive creation timestamp.
courier
optional
queryExact courier match.
tracking_number
optional
queryExact tracking_number match.
merchant_reference
optional
queryExact merchant_reference match.
Response schema
FieldTypeDescription
data
required
array
data[].id
required
stringStable PX shipment ID.
data[].reference
required
stringStable PX reference; sandbox uses PXTEST- followed by a synthetic identifier.
data[].status
required
stringValues: created, booking_pending, booked, label_ready, collected, in_transit, out_for_delivery, ready_for_collection, delivered, returned, failed, exception, cancellation_pending, cancelled
data[].courier
required
stringCourier name.
data[].service
required
stringService name.
data[].tracking_number
required
string | null
data[].label_available
required
boolean
data[].label_formats
required
array
data[].collection
required
object | null
data[].merchant_reference
required
string | null
data[].shipment_reference
required
string | null
data[].created_at
required
stringISO 8601 UTC timestamp. Database-backed responses may use +00:00; tracking events and signed webhook payloads use Z.
pagination
required
object
pagination.limit
required
integerMinimum: 1
pagination.next_cursor
required
string | null
pagination.has_more
required
boolean
HTTP responses and errors
200Success.
400Malformed JSON, cursor or idempotency header.
401Missing, invalid, expired or revoked key.
403Required scope not granted.
404Resource unavailable in this account and environment, or label format unavailable.
405Method not supported.
409Idempotency conflict, request in progress, expired/mismatched quote or cancellation unavailable.
413Body exceeds 256 KiB.
422Schema or capability validation failure.
429Enforced sandbox rate limit reached.
500Unexpected PX failure.
502Provider operation not confirmed. No blind booking retry.
503Provider unavailable or live API not released.

Request example

curl --request GET \
  --url "$PX_BASE_URL/shipments" \
  --header "Authorization: Bearer $PX_API_KEY"

Response example

{
  "data": [
    {
      "id": "shp_00000000-0000-4000-8000-000000000002",
      "reference": "PX-TEST-000001",
      "status": "booked",
      "courier": "PX Sandbox Courier",
      "service": "Test drop-off",
      "tracking_number": "TEST001",
      "label_available": true,
      "label_formats": [
        "a4"
      ],
      "collection": null,
      "merchant_reference": "ORDER-1001",
      "shipment_reference": null,
      "created_at": "2026-10-04T10:25:00Z"
    }
  ],
  "pagination": {
    "limit": 20,
    "next_cursor": null,
    "has_more": false
  }
}

Retrieve shipment

GET/v1/shipments/{id}

Available to approved test accounts in the external sandbox. Synthetic side effects only. Live shipping is disabled.

Required scope: shipments:read

Parameters

NameLocationMeaning
id
required
pathPX resource ID, scoped to account and environment.
Response schema
FieldTypeDescription
id
required
stringStable PX shipment ID.
reference
required
stringStable PX reference; sandbox uses PXTEST- followed by a synthetic identifier.
status
required
stringValues: created, booking_pending, booked, label_ready, collected, in_transit, out_for_delivery, ready_for_collection, delivered, returned, failed, exception, cancellation_pending, cancelled
courier
required
stringCourier name.
service
required
stringService name.
tracking_number
required
string | null
label_available
required
boolean
label_formats
required
array
collection
required
object | null
merchant_reference
required
string | null
shipment_reference
required
string | null
created_at
required
stringISO 8601 UTC timestamp. Database-backed responses may use +00:00; tracking events and signed webhook payloads use Z.
HTTP responses and errors
200Success.
400Malformed JSON, cursor or idempotency header.
401Missing, invalid, expired or revoked key.
403Required scope not granted.
404Resource unavailable in this account and environment, or label format unavailable.
405Method not supported.
409Idempotency conflict, request in progress, expired/mismatched quote or cancellation unavailable.
413Body exceeds 256 KiB.
422Schema or capability validation failure.
429Enforced sandbox rate limit reached.
500Unexpected PX failure.
502Provider operation not confirmed. No blind booking retry.
503Provider unavailable or live API not released.

Request example

curl --request GET \
  --url "$PX_BASE_URL/shipments/$PX_SHIPMENT_ID" \
  --header "Authorization: Bearer $PX_API_KEY"

Response example

{
  "id": "shp_00000000-0000-4000-8000-000000000002",
  "reference": "PX-TEST-000001",
  "status": "booked",
  "courier": "PX Sandbox Courier",
  "service": "Test drop-off",
  "tracking_number": "TEST001",
  "label_available": true,
  "label_formats": [
    "a4"
  ],
  "collection": null,
  "merchant_reference": "ORDER-1001",
  "shipment_reference": null,
  "created_at": "2026-10-04T10:25:00Z"
}

Request cancellation

POST/v1/shipments/{id}/cancel

Available to approved test accounts in the external sandbox. Synthetic side effects only. Live shipping is disabled. Production accepts an eligible cancellation request through the existing PX customer cancellation workflow. It does not confirm a carrier cancellation or refund.

Required scope: shipments:write

Parameters

NameLocationMeaning
id
required
pathPX resource ID, scoped to account and environment.
Idempotency-Key
required
header8–128 ASCII letters, digits, underscore, dot, colon or hyphen. Account/environment/operation scoped; never reuse for a different request. Sandbox retains keys until reset.

Request body

FieldTypeDescription
reason
optional
stringOptional cancellation reason.
Response schema
FieldTypeDescription
shipment_id
required
stringPX shipment ID.
reference
required
stringPX reference.
status
required
stringOnly confirmed cancellation is cancelled; manual requests are pending. Refund is separate. Values: cancelled, cancellation_pending
HTTP responses and errors
200Success.
202Reserved live outcome: cancellation request accepted for manual handling, not confirmed. Not emitted by sandbox.
400Malformed JSON, cursor or idempotency header.
401Missing, invalid, expired or revoked key.
403Required scope not granted.
404Resource unavailable in this account and environment, or label format unavailable.
405Method not supported.
409Idempotency conflict, request in progress, expired/mismatched quote or cancellation unavailable.
413Body exceeds 256 KiB.
422Schema or capability validation failure.
429Enforced sandbox rate limit reached.
500Unexpected PX failure.
502Provider operation not confirmed. No blind booking retry.
503Provider unavailable or live API not released.

Request example

curl --request POST \
  --url "$PX_BASE_URL/shipments/$PX_SHIPMENT_ID/cancel" \
  --header "Authorization: Bearer $PX_API_KEY" \
  --header "Content-Type: application/json" \
  --header "Idempotency-Key: $PX_IDEMPOTENCY_KEY" \
  --data '{
  "reason": "Order cancelled"
}'

Response example

{
  "shipment_id": "shp_00000000-0000-4000-8000-000000000002",
  "reference": "PX-TEST-000001",
  "status": "cancelled"
}