Skip to content

GetTrackingEvents

Use webhooks for updates, and GET /api/tracking/{orderLineId} when you need the full history.

  • Track by order line. Use the OrderLineId from the create-order response where you used ShipmentId. It’s a GET with the ID in the path. You can also track by courier tracking number and postcode with GET /api/tracking/{reference}/{postcode}.
  • One normalised stage, not a status on every event. Parcel Monkey put a harmonised PARENT__SUB status on every event. Parcel2Go gives you the courier’s own events in Results, plus a single Stage for the whole delivery and an IsInError flag. See Tracking statuses for how they line up.
  • Fewer fields per event. There’s no location or carrier_url. TODO(verify) T8: Is event location included anywhere, for example in Description or Details?
  • One call per order line. An order with several items needs one tracking call per order line.
  • History limit. Tracking returns 404 for order lines paid more than 18 months ago.

Parcel2Go can post a Tracking event to your endpoint each time a delivery enters a new stage. This replaces polling GetTrackingEvents on a timer.

  1. In your Parcel2Go account, go to My Account > Account > API Clients and choose Manage on your client.
  2. In Webhooks, enter your endpoint URL and a secret.
  3. Your endpoint must return 200. If it doesn’t, Parcel2Go retries with a backoff until it gets a 200 or reaches its retry limit.

Set up webhooks on your sandbox client to test, and again on your live client when you go live.

Tracking webhook (from the Parcel2Go webhooks guide)
{
"Id": "e0363b4a-aead-4dd5-bcc5-73793ad49974",
"Timestamp": "2018-08-30T11:37:03.6386334+00:00",
"Signature": "ac6cff923966b1dfcb4560e32d9a6683ea9b1c1f41aa3ad9c8e36658f7389703",
"Type": "Tracking",
"Payload": {
"OrderLineId": 1234567,
"Timestamp": "2018-08-28T09:36:07.4805536+00:00",
"StatusCode": "ABC",
"StatusDescription": "Handed to Customer",
"TrackingStage": "Delivered"
}
}

TrackingStage is one of DroppedOff, Collected, InTransit, AtDepot, DeliveryScheduled or Delivered. Parcel2Go also sends Case events for enquiries and claims.

Each webhook is signed with HMAC-SHA256 of Id:Timestamp:Type, using your webhook secret, with the timestamp formatted as yyyy-MM-dd HH:mm:ss. Check it before you trust the payload. Also reject repeated Ids and timestamps outside a sensible window.

webhook.php
<?php
$secret = getenv('P2G_WEBHOOK_SECRET');
$event = json_decode(file_get_contents('php://input'), true);
$timestamp = (new DateTimeImmutable($event['Timestamp']))->format('Y-m-d H:i:s');
$expected = hash_hmac('sha256', "{$event['Id']}:{$timestamp}:{$event['Type']}", $secret);
if (!hash_equals($expected, strtolower($event['Signature'] ?? ''))) {
http_response_code(401);
exit;
}
// Reject replays: store $event['Id'] and ignore any Id you've already processed.
if ($event['Type'] === 'Tracking') {
$orderLineId = $event['Payload']['OrderLineId'];
$stage = $event['Payload']['TrackingStage'];
// Update your shipment record here, or queue it and return straight away.
}
http_response_code(200);
TODO(verify) T14: Is the signed timestamp in UTC or in the payload’s own offset? Test this with a real signed webhook before relying on it.
curl -X GET "https://sandbox.parcel2go.com/api/tracking/115030194" \
-H "Authorization: Bearer $P2G_TOKEN" \
-H "Accept: application/json"
Response
{
"Stage": "Delivered",
"UsesStages": true,
"IsInError": false,
"Collected": "2026-12-07T14:53:00+00:00",
"Delivered": "2026-12-09T12:20:00+00:00",
"Results": [
{
"Timestamp": "2026-12-09T12:20:00+00:00",
"Description": "Delivered, signed for",
"StatusCode": "<courier code>",
"ParcelNumber": "<courier tracking number>",
"DeliveryType": "Delivery"
},
{
"Timestamp": "2026-12-07T14:53:00+00:00",
"Description": "Collected",
"StatusCode": "<courier code>",
"ParcelNumber": "<courier tracking number>",
"DeliveryType": "Collection"
}
]
}

Abridged. Descriptions and status codes come from the courier.

Compare with the Parcel Monkey GetTrackingEvents call
curl -X POST "https://api.parcelmonkey.co.uk/GetTrackingEvents" \
-H "Content-Type: application/json" \
-H "apiversion: 3.3" \
-H "userid: $PM_USER_ID" \
-H "token: $PM_API_KEY" \
-d '{
"ShipmentId": "4749253"
}'
Response
[
{
"ShipmentId": "4749253",
"time": "2026-12-09 12:20:00+0000",
"status": "DELIVERED__SIGNED_FOR_BY_RECIPIENT",
"location": "NEW YORK",
"carrier_message": "Delivered, signed for",
"carrier_reference": "123123123132",
"carrier_url": "https://carrier.example.com/track/?reference=123123123132"
},
{
"ShipmentId": "4749253",
"time": "2026-12-07 14:53:00+0000",
"status": "COLLECTED_OR_DROPPED_OFF__COLLECTED",
"location": "LEEDS",
"carrier_message": "Collected",
"carrier_reference": "123123123132",
"carrier_url": "https://carrier.example.com/track/?reference=123123123132"
}
]
GetTrackingEvents request field mapping
Parcel MonkeyParcel2GoRequiredNotes
ShipmentIdYes / NoUse the OrderLineId (e.g. P2G1234567 or 1234567). GET, not POST. Postcode is optional.
(alternative)YesTrack by courier tracking number + collection or delivery postcode.
GetTrackingEvents response field mapping
Parcel MonkeyParcel2GoRequiredNotes
[] (top-level array of events)
Results[]
NoEvents are wrapped in a TrackingResult that also carries the overall Stage and stage dates.
ShipmentIdNo equivalentNot repeated on each event; you requested by OrderLineId.
time
Results[].Timestamp
NoISO 8601 (PM used 'YYYY-MM-DD HH:MM:SS+0000').
status
Stage
IsInError
Results[].StatusCode
Results[].StatusCodeType
NoNo harmonised status per event. Stage is the normalised stage of the whole delivery; IsInError flags problems; StatusCode is the courier's own code. See the tracking status mapping.
locationNo equivalentNo dedicated location field. TODO(verify) T8: Is event location included anywhere (Description / Details)?
carrier_message
Results[].Description
NoDetails may hold more text.
carrier_reference
Results[].ParcelNumber
NoAlso available from POST /api/orders/{orderId}/parcelnumbers and labels/separate CourierTrackingNumbers.
carrier_urlNo equivalentNo courier tracking URL.
New in Parcel2Go
EstimatedDeliveryDate
Delivered
Results[].SignatureImageUrl
NoStage timestamps, ETA and proof of delivery.