1. Get your API key
Ask the site administrator or contact customer@4px.it.com. There is no public key in these docs.
Retrieve status, estimated delivery, and tracking history as JSON. This API serves the same shipment data as the tracking page, with no animation delay.
Ask the site administrator or contact customer@4px.it.com. There is no public key in these docs.
Store the key as TRACKING_API_KEY. Your backend calls this API and passes the tracking result to your frontend. Keep the key out of browser code, URLs, and repositories.
Show the status, ETA, and events. Link customers to trackingUrl. Poll no more than once per minute per shipment and cache results on your server.
Read-only endpoint. Supply a stored tracking number in the path and Authorization: Bearer YOUR_API_KEY in the header. Tracking numbers are case-insensitive, and older number formats remain supported.
curl --request GET \ 'https://4px.it.com/api/v1/tracking/4PX0123456789ABCDEF' \ --header "Authorization: Bearer $TRACKING_API_KEY"
The number in these examples is illustrative. Replace it with a shipment created in admin.
{
"number": "4PX0123456789ABCDEF",
"origin": "Shenzhen, China",
"destination": "London, United Kingdom",
"carrier": "4PX",
"estimatedDelivery": "2026-10-12T16:00:00.000Z",
"status": "In transit",
"stage": 1,
"progressStage": 1,
"events": [
{
"at": "2026-10-02T09:00:00.000Z",
"location": "Shenzhen",
"description": "Shipment picked up",
"stage": 1
}
],
"trackingUrl": "https://4px.it.com/track?number=4PX0123456789ABCDEF",
"lastEventAt": "2026-10-02T09:00:00.000Z"
}All timestamps use ISO 8601 in UTC. Events are ordered newest first.
| Field | Meaning |
|---|---|
number | The shipment’s tracking number. |
status / stage | Current status and its numeric stage; see the mapping below. |
progressStage | Latest logistics progress, from −1 to 5. Exceptions and cancellations do not imply delivery. |
origin / destination | City and country display labels. |
carrier | Carrier assigned to the shipment. |
estimatedDelivery | Estimated arrival timestamp; an estimate, not a delivery guarantee. |
events | Visible tracking updates, newest first. Each includes at, location, description, and stage. |
lastEventAt | Timestamp of the newest visible event; null when no update is visible. |
trackingUrl | Direct customer-facing link at /track?number=… |
Customer names, email addresses, street addresses, Shopify order references, internal revisions, and planned future updates are excluded. Hidden events, paused future generated events, and generated stages beyond the administrator’s selected stop stage are excluded too. Manual admin changes appear on the next lookup; future-dated manual events appear only when due.
// Run on your server. Store TRACKING_API_KEY in an environment variable.
export async function getTracking(number) {
const key = process.env.TRACKING_API_KEY;
if (!key) throw new Error('TRACKING_API_KEY is not configured');
const response = await fetch(
'https://4px.it.com/api/v1/tracking/' + encodeURIComponent(number),
{
headers: { Authorization: 'Bearer ' + key },
cache: 'no-store',
signal: AbortSignal.timeout(10000)
}
);
const data = await response.json();
if (!response.ok) {
const error = new Error(data.error || 'Tracking request failed');
error.status = response.status;
error.retryAfter = response.headers.get('Retry-After');
throw error;
}
return data; // status, estimatedDelivery, events, trackingUrl…
}<?php
// Run on your PHP server; never send the API key to the browser.
$key = getenv('TRACKING_API_KEY');
if (!$key) { throw new RuntimeException('API key is not configured'); }
$number = '4PX0123456789ABCDEF'; // Replace with a stored tracking number.
$ch = curl_init('https://4px.it.com/api/v1/tracking/' . rawurlencode($number));
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $key],
CURLOPT_TIMEOUT => 10
]);
$body = curl_exec($ch);
if ($body === false) {
$message = curl_error($ch);
curl_close($ch);
throw new RuntimeException($message);
}
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
$data = json_decode($body, true, 512, JSON_THROW_ON_ERROR);
if ($status !== 200) {
throw new RuntimeException($data['error'] ?? 'Tracking request failed', $status);
}
// Use $data['status'], $data['estimatedDelivery'], and $data['events'].
Use your own backend route to serve the response to your website. Apply your own authentication and request limits there. The API supports CORS preflight, but the secret must remain on your server.
Errors use {"error":"error_code"}. Inspect the HTTP status before using the response as shipment data.
| HTTP | Error code | What to do |
|---|---|---|
| 400 | invalid_tracking_number | Check the number format. |
| 401 | unauthorized | Check the Bearer key; do not retry with the same invalid credentials. |
| 404 | not_found | Number is unknown, in Trash, or permanently deleted. |
| 429 | rate_limited | Wait the number of seconds in the Retry-After header. |
| 503 | temporarily_unavailable / api_not_configured | Retry temporary failures with increasing delays; contact support if persistent. |
The limit is 120 requests per minute per IP address, shared across tracking numbers. Failed requests also count. Responses include Cache-Control: no-store and X-API-Version: 1. Cache on your own server for up to 60 seconds if appropriate.
This version provides on-demand lookup and polling. Webhooks and bulk lookup are not available. API keys grant read access to tracking data and cannot create or edit shipments.