Developers
Get Started
OpenAPI ↗
REST API v1 · Developer previewLive API credentials are not yet generally available. Hosted test access is not enabled.

API reference

Shipments

Create one simulated booking, list your shipments, retrieve current state or request cancellation. POST creation requires an idempotency key. Live funding and carrier booking remain unavailable.

Local sandbox only

Set PX_BASE_URL to http://127.0.0.1:4010/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

Creates one simulated booking with a PX-TEST reference and void A4 PDF. Route and parcels must exactly match the quote. International shipments require customs. Collection services require collection details. Live creation is blocked pending account billing and fenced domain adapter. Production access remains disabled. Unreleased server adapters and database controls are under certification; hosted test credentials are unavailable.

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.
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.
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
numberDeclared contents value in quote currency. Required by the unreleased live domestic PX booking adapter; optional in the local fixture sandbox. International API creation remains disabled pending customs certification.
Response schema
FieldTypeDescription
id
required
stringStable PX shipment ID.
reference
required
stringPX reference; sandbox uses PX-TEST-000001.
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 timestamp with timezone. Responses use UTC 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.
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

Account and environment scoped; creation descending with ID tiebreaker. Cursors are filter-bound. No total count is promised. Production access remains disabled. Unreleased server adapters and database controls are under certification; hosted test credentials are unavailable.

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
stringPX reference; sandbox uses PX-TEST-000001.
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 timestamp with timezone. Responses use UTC 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}

Returns the current normalized PX shipment. Foreign-account IDs return 404. Production access remains disabled. Unreleased server adapters and database controls are under certification; hosted test credentials are unavailable.

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
stringPX reference; sandbox uses PX-TEST-000001.
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 timestamp with timezone. Responses use UTC 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

Sandbox confirms cancellation only before transit. Provider failures are 502; they never become success. Live cancellation may require 202 cancellation_pending/manual processing and does not imply a Stripe refund. Live handler remains unavailable. Production access remains disabled. Unreleased server adapters and database controls are under certification; hosted test credentials are unavailable.

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"
}