Getting started
Complete sandbox integration guide
Develop against simulated shipping with real authentication, isolation and durable request semantics.
Use approved test credentials at https://sandbox-api.parcelxpert.com/v1. Quotes, bookings, labels and carrier events are simulated. Live credentials, carrier purchasing and billing remain disabled.
Get authorised test access
Signup, email verification and password recovery are certified. Verify your email, then request staff approval for test access. Sandbox approval does not grant production access.
- Create your account at Sign up and verify the email.
- Sign in, create a developer organisation and application.
- Ask PX staff to approve the organisation for test access. Existing customer membership does not grant developer access.
- In API Keys, create a test bearer key with only the required scopes. Copy it once into your backend secret manager; later only a masked fingerprint is available. Revoke or rotate it in the console.
For the shipping journey use quotes:read, shipments:write, shipments:read, labels:read and tracking:read. Add collections:write or webhooks:write for those features. Never put bearer keys into browser JavaScript.
One PX shipping and billing account
Your developer organisation, applications and credentials map to an authorised PX shipping account through staff-reviewed server-side authority. Email matching and a caller-supplied shipping account do not grant access. Website and live API bookings share its pricing, service permissions, shipment records and payment preferences. Manage shipping history and saved cards in your authenticated PX account. The Developer Portal manages integrations and an API-filtered view of those same records.
Saved cards use Stripe-hosted collection, an explicit default and recorded consent. Live charges remain gated. The shared PX prepaid wallet is deferred; there is no developer wallet or separate financial history. Sandbox records and simulated payments never alter live PX balances. Supplier funding, cancellation and refunds are internal PX operations.
Configure your backend
export PX_BASE_URL="https://sandbox-api.parcelxpert.com/v1"
export PX_API_KEY="YOUR_TEST_KEY_FROM_THE_CONSOLE"PowerShell: use $env:PX_BASE_URL and $env:PX_API_KEY. The API is reachable over public HTTPS without a personal Vercel session.
Quote → shipment → label → tracking
- POST /quotes with collection_country GB, collection_postcode NN1 1AA, delivery_country GB, delivery_postcode SW1A 1AA and parcels [{weight:2,length:30,width:20,height:15}].
- Choose a returned quote with handover drop_off; keep its quote ID and the exact route/parcels.
- POST /shipments with quote_id, sender and recipient (name, line1, city, postcode, country, email and phone), parcels, contents and merchant_reference. Save your request and an 8–128 character Idempotency-Key before sending.
- GET /shipments/{id}; GET /shipments?merchant_reference=your-reference for history.
- GET /shipments/{id}/label?format=a4 or format=thermal. Both are valid PDF files prominently marked TEST / VOID — NOT VALID FOR POSTAGE.
- GET /shipments/{id}/tracking. Exercise progress using the sandbox control below.
- Configure a public HTTPS webhook receiver and register it through the API. Verify signatures before parsing and deduplicate event IDs.
Each API reference has copyable cURL, Node.js, Python and PHP examples. IDs in examples are placeholders: use returned IDs.
Runnable independent verification
curl --fail --output verify-sandbox.mjs https://developer.parcelxpert.com/tools/verify-sandbox.mjs
node verify-sandbox.mjsNode 22 or later; no dependencies, CLI login or privileged database access. It writes a recovery journal before booking and downloads both void PDFs. Rerun with the same journal/key after an uncertain response. Do not delete the journal to solve a failed booking.
Deterministic sandbox scenarios
Set PX-Sandbox-Scenario on POST /quotes. The returned quote retains that scenario for booking. This header is a sandbox control; omit it when separately approved for live.
| Scenario | Expected result |
|---|---|
| success (default) | Two synthetic services; drop-off Economy and collection Express. |
| no_service | 422 unsupported_route, no quote. |
| expired_quote | Quotes already expired; booking 409 quote_expired. |
| provider_rejection | Booking 422 provider_rejected; no shipment. Same-key rejection is retained. |
| temporary_failure | First booking 503 provider_unavailable, identical same-key retry 201. |
| provider_delay | Booking waits approximately one second before returning. |
| uncertain_outcome | First booking returns 503 booking_verification_required after durable creation. Identical same-key retry returns the original 201 shipment. |
| cancellation_rejection | Booking succeeds; cancellation returns 409 cancellation_not_allowed. |
Invalid GB postcode: INVALID. Invalid parcels: nonpositive dimensions/weight, weight above 70 kg or any side above 150 cm. Country codes outside GB, FR, DE, IE, US, CA and AU are not served. Use NN1 1AA → SW1A 1AA for GB, or GB → FR / 75001 with DAP customs for international fixtures.
Tracking progression
POST /sandbox/shipments/{id}/events with {"status":"in_transit"}, then out_for_delivery, then delivered. exception can be followed by in_transit/out_for_delivery or returned. collected is allowed from label_ready. Terminal shipments cannot be advanced. Requires shipments:write, ownership and an Idempotency-Key; repeats do not duplicate tracking events. Timestamps are ISO 8601 UTC. These controls cannot operate on live shipments.
Limits, retention and reset
Database authority enforces each credential’s configured fixed-minute limit; the default is 60 requests per minute. Read X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset and Retry-After on 429 rate_limit_exceeded. Do not change credentials to evade the quota. A bounded test may send up to 72 read-only requests, stop at the first 429 and wait Retry-After plus one second.
List limit is 1–100 (default 20). Cursors are signed and bound to the organisation, environment, resource and filters. Shipment filters: status, created_from, created_to, courier, tracking_number and merchant_reference. Dates need an explicit timezone. Quotes expire in 15 minutes. Maximum 100 parcels and 256 KiB request body; at most 20 webhook configurations per organisation.
There is currently no automatic retention deletion or self-service database reset. Use synthetic names/addresses only. Create a new merchant reference/idempotency key for a new test; preserve old journals for recovery. Contact PX for a coordinated reset: clearing idempotency while retrying old requests would invalidate duplicate protection.
Switch to live only after separate approval
- Complete account, billing, provider, webhook and production certification.
- Obtain an approved live bearer credential and confirmed live base URL.
- Change only PX_BASE_URL and PX_API_KEY in your integration configuration; remove sandbox scenario/progression controls.
- Use quote capabilities and runtime errors; synthetic prices, services and timings are not carrier guarantees.
Intended live base: https://api.parcelxpert.com/v1. It is disabled. Contract parity describes the common facade; live side effects and every carrier capability are not certified.
Company integration handoff
Each company needs its own verified developer owner, organisation, application and approved test credential. Never share a key between companies or link their PX shipping accounts solely by email. Your application owner creates the integration in the console; contact PX with the organisation/application IDs for test approval. Use your company backend secret manager for the one-time key.
Download the Postman collection, empty private environment template and client acceptance checklist. Import both Postman JSON files, select the environment and enter PX_API_KEY locally as a secret. Run folders 01 then 02. Optional collection/cancellation/webhook/lifecycle recipes need their stated prerequisites and are not an automatic whole-collection test. Never export a populated environment or send keys to PX by email.
The collection and standalone Node verifier are intentionally restricted to the sandbox. A passing verifier covers the core synthetic shipping journey; it does not prove email onboarding, another tenant, revocation, webhook delivery or a live payment. Use the acceptance checklist to record those separately with request IDs and actual results.
Keep the original request and Idempotency-Key during recovery. For a new shipment, archive the previous outcome before deliberately creating a new key and fresh quote. Live service identifiers, account billing and approval may differ from fixtures: inspect capabilities rather than hard-coding synthetic prices/services. Core REST paths and data structures remain the integration boundary; production access is separately gated.
Current sandbox field boundary
The core requests in the examples and client kit work across the documented integration boundary. The gated production extensions Address.state, tax_id, eori, is_business, ShipmentRequest.service_options and Quote.requirements are not accepted/returned by the current public sandbox. Omit them from sandbox requests. OpenAPI marks these with x-sandbox-availability: unavailable; their live behaviour is not certified. This is an intentional current environment difference, not a claim of complete live parity.