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

Guides

Webhook verification and retries

Verify exact bytes, then deduplicate the stable event ID.

REST API v1 · Sandbox developer preview

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.

Register a URL with POST /webhook-endpoints using webhooks:write and an Idempotency-Key. Use a public HTTPS host on port 443. Private IPs, localhost, IP literals, encoded host bypasses and redirects are rejected. DNS is checked at registration and pinned again for every delivery. Existing portal-only disabled configurations are not automatically activated.

The signing_secret is displayed once on registration or rotation. Store it securely. PX-Signature has t=unix_seconds,v1=hex_hmac_sha256. Sign ASCII(timestamp) + "." + exact UTF-8 body using HMAC-SHA256; compare in constant time and reject timestamps outside 300 seconds. Parse JSON only after verification.

import {createHmac,timingSafeEqual} from "node:crypto";
function verify(secret, raw, header) {
  const parts=String(header).split(",");
  const timestamps=parts.filter(p=>p.startsWith("t="));
  if(timestamps.length!==1 || !/^t=\d+$/.test(timestamps[0])) return false;
  const t=Number(timestamps[0].slice(2));
  if(!Number.isSafeInteger(t) || Math.abs(Date.now()/1000-t)>300) return false;
  const expected=createHmac("sha256",secret).update(t+".").update(raw).digest();
  return parts.filter(p=>/^v1=[a-f0-9]{64}$/.test(p)).some(p=>{
    const actual=Buffer.from(p.slice(3),"hex");
    return actual.length===expected.length && timingSafeEqual(actual,expected);
  });
}

Envelope: id, type, created_at, shipment_id, reference and data. Deduplicate id with a database unique constraint and process idempotently. A replay retains its event ID. Signatures use a new timestamp each attempt. Fetch current shipment state if delivery order matters.

Persistent outbox delivery occurs outside shipping transactions. Timeout: five seconds. Non-2xx/network failures retry after 1 minute, 5 minutes, 30 minutes, 2 hours, 6 hours and 24 hours; seven total attempts, then dead. Endpoint disable prevents claims. Automatic worker polls each minute; authenticated POST /webhook-endpoints/{id}/dispatch can process one due delivery for your endpoint without bypassing retry timing.

GET deliveries returns up to 100 recent records and safe attempt history. POST test accepts a same-application shipment_id; POST replay accepts an owned event_id and deliberately queues the same ID. PATCH {enabled:false} disables an endpoint. POST rotate-secret changes future signatures immediately; consumers may retain both secrets for 24 hours to finish already in-flight deliveries. No dual-signature guarantee or live delivery SLA exists.

Production delivery

Production configurations in the console are disabled. The persistent outbox records only attributable API lifecycle events; a protected worker delivers outside the booking transaction. It signs the same event envelope and uses seven attempts with delays 1 minute, 5 minutes, 30 minutes, 2 hours, 6 hours and 24 hours. Enablement, server encryption-key configuration and controlled receiver certification are activation prerequisites. Do not assume sandbox webhook registration activates a production receiver.