Query Multiple Status
API Overview
Returns the current status and tracking history for a batch of parcels in one call. Each tracking number is resolved independently: those found are returned in Data.Success, those not found in Data.Errors.
Request Information
- Method: POST
- Path:
/api/status/lookup - Authentication: Bearer Token
Request Headers
| Field | Description |
|---|---|
| Content-Type | application/json |
| Authorization | Bearer <token> |
Request Parameters
The request body is in JSON format and includes the following fields:
| Parameter | Type | Required | Description |
|---|---|---|---|
| TrackingNumber | array | Yes | Array of WMG tracking numbers to look up. Must be a JSON array, even for a single number. |
Request Body Example
json
{
"TrackingNumber": [
"C240129142515839830635",
"C240126144626997791271"
]
}Authentication
This endpoint uses Bearer token authentication.
Obtain a token from Get Token and send it as Authorization: Bearer <Token>.
Response Information
The response is in JSON format.
Response Format
| Field | Type | Description |
|---|---|---|
| Code | integer | 0 = success; non-zero = failure |
| Message | string | Human-readable result |
| Data | object | Payload with the per-tracking-number outcome |
Success Response
- Status Code: 200
json
{
"Code": 0,
"Message": "Success",
"Data": {
"Success": [
{
"TrackingNumber": "C240129142515839830635",
"LastStatus": "DR_DR",
"LastStatusDateTime": "2024-01-29T14:27:10+08:00",
"Activities": [
{
"StatusDateTime": "2024-01-29T14:27:10+08:00",
"StatusCode": "DR_DR",
"StatusDesc": "Data Received via API",
"Remarks": "",
"ReceiveBy": ""
}
]
}
],
"Errors": [
{
"TrackingNumber": "C240126144626997791271",
"Remarks": "No Record(s)"
}
]
}
}| Field | Type | Description |
|---|---|---|
| Data.Success | array | Parcels that were resolved. Empty array when none matched. |
| Data.Success[].TrackingNumber | string | The WMG tracking number. |
| Data.Success[].LastStatus | string | Status code of the most recent activity. Empty if the parcel has no publishable status yet. |
| Data.Success[].LastStatusDateTime | string | Timestamp of the most recent activity, ISO 8601 with offset (+08:00). |
| Data.Success[].Activities | array | Tracking history, most recent first. |
| Data.Success[].Activities[].StatusDateTime | string | Timestamp of the activity, ISO 8601 with offset (+08:00). |
| Data.Success[].Activities[].StatusCode | string | Status code — see Delivery Status. |
| Data.Success[].Activities[].StatusDesc | string | Description of the status code. |
| Data.Success[].Activities[].Remarks | string | Additional remark recorded with the activity; empty when there is none. |
| Data.Success[].Activities[].ReceiveBy | string | Reserved. Always returned as an empty string. |
| Data.Errors | array | Tracking numbers that could not be resolved. Empty array when all matched. |
| Data.Errors[].TrackingNumber | string | The tracking number that was submitted. |
| Data.Errors[].Remarks | string | Reason the lookup failed. |
Error Response
- Status Code: 200 (business logic error) or 4xx/5xx (system error)
json
{
"Code": 1,
"Message": "TrackingNumber require",
"Data": []
}Code Reference
| Code | Description |
|---|---|
| 0 | Success |
| 1 | Failure |
Example
Bash
bash
BASE_URL="https://api.postal.test.wmgdelivery.com"
TOKEN="your_access_token"
curl -X POST "$BASE_URL/api/status/lookup" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN" \
-d '{"TrackingNumber":["C240129142515839830635","C240126144626997791271"]}'Windows PowerShell
powershell
$BASE_URL = "https://api.postal.test.wmgdelivery.com"
$TOKEN = "your_access_token"
# Force an array even when there is a single number, so it serialises as a JSON array
$body = @{
TrackingNumber = @("C240129142515839830635", "C240126144626997791271")
} | ConvertTo-Json
$response = Invoke-RestMethod -Uri "$BASE_URL/api/status/lookup" -Method Post `
-ContentType "application/json" -Body $body -Headers @{Authorization = "Bearer $TOKEN"}
$response | ConvertTo-Json -Depth 10Python
python
import requests
BASE_URL = "https://api.postal.test.wmgdelivery.com"
TOKEN = "your_access_token"
resp = requests.post(f"{BASE_URL}/api/status/lookup", json={
"TrackingNumber": [
"C240129142515839830635",
"C240126144626997791271",
],
}, headers={"Authorization": f"Bearer {TOKEN}"}, timeout=30)
payload = resp.json()
# Always inspect both arrays — a per-parcel miss does not change Code
print(payload["Data"]["Success"], payload["Data"]["Errors"])Node.js / TypeScript
typescript
const BASE_URL = "https://api.postal.test.wmgdelivery.com";
const TOKEN = "your_access_token";
const res = await fetch(`${BASE_URL}/api/status/lookup`, {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": `Bearer ${TOKEN}`,
},
body: JSON.stringify({
TrackingNumber: [
"C240129142515839830635",
"C240126144626997791271",
],
}),
});
const payload = await res.json();
// Always inspect both arrays — a per-parcel miss does not change Code
console.log(payload.Data.Success, payload.Data.Errors);PHP
php
<?php
$BASE_URL = 'https://api.postal.test.wmgdelivery.com';
$TOKEN = 'your_access_token';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $BASE_URL . '/api/status/lookup');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Content-Type: application/json',
'Authorization: Bearer ' . $TOKEN,
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
'TrackingNumber' => [
'C240129142515839830635',
'C240126144626997791271',
],
]));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
$response = curl_exec($ch);
curl_close($ch);
$payload = json_decode($response, true);
// Always inspect both arrays — a per-parcel miss does not change Code
print_r([$payload['Data']['Success'], $payload['Data']['Errors']]);
?>Notes
- A partial miss is not a failure. As long as the request itself is valid, the response is
Code: 0withMessage: "Success"— even when every tracking number lands inData.Errors. Always iterate bothData.SuccessandData.Errorsinstead of checkingCodealone. - The two arrays together account for every tracking number you submitted, in the order you submitted them.
- All timestamps are Singapore time (UTC+08:00) and are returned in ISO 8601 form with the offset included.
- Branch your logic on
StatusCode, never onStatusDesc. The description text can differ between carriers and account configurations while the code stays stable. - Internal-only status records are filtered out, so
Activitiescan be shorter than the parcel's full internal history. - Tracking numbers are matched exactly — they are not normalised to upper case, so send them exactly as issued.
- Only parcels belonging to the authenticated account are visible; a number that belongs to another account is reported as
No Record(s), not as a permission error. TrackingNumbermust be a JSON array. A bare string is rejected by validation.- The endpoint applies no server-side cap on the number of entries, but keep batches to a size your own client timeout can absorb — the whole batch is resolved in a single request.
Error Codes
| code | message | Description |
|---|---|---|
1 | TrackingNumber require | TrackingNumber is missing or empty. |
1 | Error encountered, please contact tech@wmg-group.com with screenshot of error page for resolution. | Unexpected server error. |
1003 | Token error | The token is missing, expired, or superseded by a newer login. Call Get Token again. |
Individual tracking numbers that cannot be resolved are not reported here — they are returned in Data.Errors with Remarks: "No Record(s)" while Code stays 0.