API reference/Logistics
POST/api/v1/logistics/shipments/{id}/cancel

Cancel 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

FieldTypeDescription
id
required
stringShipment CUID.
e.g. shp_2k8h1mv9c3xq

Body parameters

FieldTypeDescription
reason
optional
stringOptional 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.