POST
/api/v1/logistics/shipments/{id}/cancelCancel a shipment
Cancels a shipment that hasn't been picked up yet. Only allowed when status is `pending` or `assigned`. If the shipment is already with a carrier, we fire a best-effort cancel upstream — the local row flips to `cancelled` regardless so your state machine never gets stuck.
Authorization
Requires the logistics:write scope. See the auth guide for how to mint a token with the right scopes.
Parameters
Path parameters
| Field | Type | Description |
|---|---|---|
id required | string | Shipment CUID. e.g. shp_2k8h1mv9c3xq |
Body parameters
| Field | Type | Description |
|---|---|---|
reason optional | string | Optional cancellation reason — persisted on the audit log. e.g. Customer changed delivery address |
Response
A successful call returns 200 OK with the body shown to the right. Errors follow the standard envelope.