Track 4PX (4PX…CN) cross-border shipments and extract the destination USPS tracking number.

4PX Worldwide Express (4PX + 13 digits + CN) is a major cross-border fulfillment provider whose US-bound parcels are inducted into USPS (or regional couriers) after clearing customs. Querying GET /v1/track/4PX...CN on lastscanned returns the international scan history and extracts the final-mile USPS tracking number in the top-level message field.

Barcode transition: 4PX to USPS

When 4PX clears customs and hands off to USPS, lastscanned surfaces the secondary tracking number in the top-level message field.

Origin / middle-mile carrier
4PX (4px)
4PX Waybill
4PX + 13 digits + CN (/^4PX\d{13}CN$/)
Origin example
4PX3000956712345CN
Final-mile carrier
USPS (usps)
USPS Domestic IMpb
92… / 94… (22 digits) or 420+ZIP+92… (30 digits)
Final-mile example
9261290100130612345678
Extracted in .message
Handed to USPS as 9261290100130612345678

How the 4PX → USPS handoff works

Follow the parcel across both networks without waiting on asynchronous webhooks or losing visibility at the handoff boundary.

1. Query the 18-character 4PX…CN waybill
Call GET /v1/track/4PX3000956712345CN. lastscanned auto-detects 4px in Pass 1 and returns origin warehouse and air transit events.
2. Read the secondary barcode from message
When 4PX assigns a destination barcode (such as USPS, Royal Mail, or Australia Post), lastscanned surfaces 'Handed to USPS as 92...' in message.
3. Query the USPS barcode for final delivery
Call GET /v1/track/92... to track domestic postal sorting through to doorstep delivery.
4PX auto-detection
/^4PX\d{13}CN$/ matches 4px in Pass 1.
Other 4PX formats
Non-4PX…CN shipper references can be queried explicitly with ?carrier=4px.
Handoff field
Top-level message string ('Handed to <carrier> as <number>').

Chain 4PX → USPS in code or MCP

Resolve both legs synchronously in TypeScript, curl, or your AI support agent via Streamable HTTP MCP.

REST (Synchronous GET)

# 1. Query 4PX origin waybill (extracts final-mile barcode in .message):
curl "https://api.lastscanned.com/v1/track/4PX3000956712345CN" \
  -H "Authorization: Bearer lsk_live_YOUR_API_KEY"

# 2. Query the extracted USPS barcode:
curl "https://api.lastscanned.com/v1/track/9261290100130612345678" \
  -H "Authorization: Bearer lsk_live_YOUR_API_KEY"

TypeScript (Automatic Handoff Chaining)

const headers = { Authorization: `Bearer ${process.env.LASTSCANNED_API_KEY}` };
const originRes = await fetch(`https://api.lastscanned.com/v1/track/${encodeURIComponent(number)}`, { headers });
const originPkg = await originRes.json();

// Extract secondary barcode from top-level message ("Handed to USPS as 9261290100130612345678")
const handoff = originPkg.message?.match(/^Handed to (.+?) as ([A-Z0-9-]+)$/i);
if (handoff) {
  const [, , lastMileNumber] = handoff;
  const destRes = await fetch(`https://api.lastscanned.com/v1/track/${encodeURIComponent(lastMileNumber)}`, { headers });
  const destPkg = await destRes.json();
}

Remote MCP (Claude Code / Cursor / ChatGPT)

claude mcp add --transport http lastscanned https://mcp.lastscanned.com \
  --header "Authorization: Bearer lsk_live_YOUR_API_KEY"

4PX to USPS Last-Mile Handoff Tracking FAQ

How do I get the USPS tracking number for a 4PX shipment?
Look up your 4PX…CN tracking number above or call GET /v1/track/4PX...CN on lastscanned. The top-level message field contains the handed-off USPS tracking number.
What if my 4PX tracking number does not start with 4PX…CN?
Pass ?carrier=4px to GET /v1/track/:number (or select 4PX from the dropdown above) to force routing to 4PX.

All 31 supported carriers