Track Cainiao parcels through customs clearance and OnTrac final-mile delivery.

Cainiao consolidates cross-border e-commerce parcels under an origin waybill (AP00830954074290) and injects them into OnTrac (1LS729108273411) via LAX / ORD Cainiao linehaul to OnTrac sort center. Querying lastscanned with ?carrier=cainiao returns origin export and linehaul events, while querying the OnTrac tracking number returns domestic final-mile delivery scans.

Try a live tracking number:

Barcode transition: Cainiao to OnTrac

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

Origin / middle-mile carrier
Cainiao (cainiao)
Cainiao Waybill
LP… or AP… alphanumeric waybill
Origin example
AP00830954074290
Final-mile carrier
OnTrac (ontrac)
OnTrac Barcode
1LS… or C/D + 14 digits
Final-mile example
1LS729108273411
Extracted in .message
Handed over to final-mile carrier OnTrac (1LS729108273411) — LAX / ORD Cainiao linehaul to OnTrac sort center

How the Cainiao → OnTrac handoff works

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

1. Origin induction (Cainiao)
The merchant inducts the parcel into Cainiao under origin tracking ID AP00830954074290.
2. Linehaul & customs (LAX / ORD Cainiao linehaul to OnTrac sort center)
The shipment clears customs at LAX / ORD Cainiao linehaul to OnTrac sort center and receives domestic OnTrac barcode 1LS729108273411.
3. Final-mile delivery (OnTrac)
OnTrac completes local regional sortation and doorstep delivery with photo confirmation.
Origin Carrier Slug
cainiao
Destination Carrier Slug
ontrac
Primary Injection Gateway
LAX / ORD Cainiao linehaul to OnTrac sort center

Chain Cainiao → OnTrac in code or MCP

Resolve both legs synchronously in TypeScript, curl, or your AI support agent via Streamable HTTP MCP. Want automatic alerts when this handoff updates? Add the tracking number in Dashboard Watches, or use the Free API (5/day), Pro ($4.99/mo for 1,000 numbers), or an Instant 25-Pack ($0.50).

REST (Synchronous GET)

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

# 2. Query the extracted OnTrac barcode:
curl "https://api.lastscanned.com/v1/track/1LS729108273411" \
  -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 over to final-mile carrier OnTrac (1LS729108273411) — LAX / ORD Cainiao linehaul to OnTrac sort center")
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"

Cainiao to OnTrac Handoff Tracking FAQ

How do I track a Cainiao parcel handed off to OnTrac?
Query GET /v1/track/AP00830954074290?carrier=cainiao for origin and customs milestones, and GET /v1/track/1LS729108273411?carrier=ontrac for OnTrac final-mile delivery scans.
Can I get automatic alerts when Cainiao hands off to OnTrac?
Yes. Add AP00830954074290 or 1LS729108273411 in lastscanned Dashboard Watches at https://app.lastscanned.com/watches or subscribe via webhook.

Other carrier handoff guides

Explore cross-border last-mile barcode extraction and domestic USPS consolidator overrides across all 542 carriers.

All 542 supported carriers

Regional and last mile (241)

+231 more regional and last mile

International posts and couriers (176)

+166 more international posts and couriers

Cross-border (116)

+106 more cross-border