Skip to content

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

FieldDescription
Content-Typeapplication/json
AuthorizationBearer <token>

Request Parameters

The request body is in JSON format and includes the following fields:

ParameterTypeRequiredDescription
TrackingNumberarrayYesArray 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

FieldTypeDescription
Codeinteger0 = success; non-zero = failure
MessagestringHuman-readable result
DataobjectPayload 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)"
      }
    ]
  }
}
FieldTypeDescription
Data.SuccessarrayParcels that were resolved. Empty array when none matched.
Data.Success[].TrackingNumberstringThe WMG tracking number.
Data.Success[].LastStatusstringStatus code of the most recent activity. Empty if the parcel has no publishable status yet.
Data.Success[].LastStatusDateTimestringTimestamp of the most recent activity, ISO 8601 with offset (+08:00).
Data.Success[].ActivitiesarrayTracking history, most recent first.
Data.Success[].Activities[].StatusDateTimestringTimestamp of the activity, ISO 8601 with offset (+08:00).
Data.Success[].Activities[].StatusCodestringStatus code — see Delivery Status.
Data.Success[].Activities[].StatusDescstringDescription of the status code.
Data.Success[].Activities[].RemarksstringAdditional remark recorded with the activity; empty when there is none.
Data.Success[].Activities[].ReceiveBystringReserved. Always returned as an empty string.
Data.ErrorsarrayTracking numbers that could not be resolved. Empty array when all matched.
Data.Errors[].TrackingNumberstringThe tracking number that was submitted.
Data.Errors[].RemarksstringReason 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

CodeDescription
0Success
1Failure

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 10

Python

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: 0 with Message: "Success" — even when every tracking number lands in Data.Errors. Always iterate both Data.Success and Data.Errors instead of checking Code alone.
  • 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 on StatusDesc. The description text can differ between carriers and account configurations while the code stays stable.
  • Internal-only status records are filtered out, so Activities can 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.
  • TrackingNumber must 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

codemessageDescription
1TrackingNumber requireTrackingNumber is missing or empty.
1Error encountered, please contact tech@wmg-group.com with screenshot of error page for resolution.Unexpected server error.
1003Token errorThe 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.