API ReferenceShipmentsCancel a pre-pickup shipment
Cancel a pre-pickup shipment
POST
/api/v1/shipments/{shipment_id}/cancel idempotentOnly label_created (and draft if any exist) are cancellable; anything past first carrier scan returns 400 INVALID_FIELD(status). Idempotent — cancel-then-cancel returns the existing snapshot with refund_hkd=0. Live mode refunds the wallet by the original total; test mode does not (test create skipped the deduction).
Parameters
shipment_id*
Responses
Success body
{ "status": 200, "message": "OK", "data": { "cancelled_at": "2026-05-28T07:48:17.607Z", "id": "IM-2026-0528-9ZNCP3-1", "refund_hkd": 0, "status": "label_created", "tracking_number": "IM-2026-0528-9ZNCP3-1" } }
Returned object
| Field | Type | Sample |
|---|---|---|
| status | number | 200 |
| message | string | OK |
| data | object | {5 keys} |