Get API key
Authenticated all requests require Authorization: Bearer mk_test_…Learn more
API ReferenceShipmentsCancel a pre-pickup shipment

Cancel a pre-pickup shipment

POST/api/v1/shipments/{shipment_id}/cancel idempotent

Only 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*
stringpath

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

FieldTypeSample
statusnumber200
messagestringOK
dataobject{5 keys}