Skip to content

Powered by Grav CMS + Helios Theme

Parcel tracking (add-on)

A parcel's tracking history, asking the carrier again, and the webhook the aggregator posts to.

Tracking reads take kahunacart.orders.view. The webhook routes are unauthenticated: the secret in the path is the credential, compared in constant time, and a wrong one answers 404. See Tracking.

Read a parcels tracking

GET /api/v1/kahunacart/shipping/labels/{id}/tracking Permission kahunacart.orders.view

Every tracking event recorded for one parcel, oldest first, with the carrier's own wording beside each normalised status and a flag saying whether the event needs somebody to act on it. Reads what has already been written and asks no carrier.

Parameters

Name Type Description
id required integer The label's id.

Ask the carrier for fresh tracking

POST /api/v1/kahunacart/shipping/labels/{id}/tracking/refresh Permission kahunacart.orders.view

Ask the carrier where a parcel is, now, and write anything new. Costs one carrier call. An event already recorded is not written twice, so this is safe to call repeatedly.

Parameters

Name Type Description
id required integer The label's id.

Receive a tracking update

POST /api/v1/kahunacart/shipping/public/webhook/{aggregator}/{secret} No permission

Where the aggregator tells the store a parcel has moved. {aggregator} names the driver and {secret} is the store's own webhook secret. The update is logged and queued, and the job reads the parcel again with the store's own key before anything is recorded. No tool: a carrier posts to this, nobody else.

Probe the tracking webhook

HEAD /api/v1/kahunacart/shipping/public/webhook/{aggregator}/{secret} No permission

Several aggregators check an address with a HEAD before they will save it. Answered 200 with no body.

The webhook caps a body at 256 KB, logs every delivery for thirty days, and makes no outbound call: it checks, logs, queues and answers 200. A body nobody can read still gets a 200, because an aggregator treats a 4xx as a reason to retry for days.

On a store running the demo carrier there is one more public route, GET /kahunacart/shipping/public/demo-track/{number}, the tracking page the simulation serves for itself. See Developers.