Cancel shipment
Cancels a shipment before pickup.
Prerequisites
- For a new cancellation, the shipment must be
PENDINGorBOOKED. - No package may have progressed beyond its pending delivery state.
- Any connected return must be
PENDING,BOOKED, orFAILED, with no package beyond its pending delivery state.
Behavior
- Successful cancellation changes the status to
CANCELEDand retains the shipment record. - Canceling an already canceled shipment succeeds without changing its status.
409 CANCELLATION_NOT_ALLOWEDincludeserrors.currentStatus.- Success confirms committed cancellation. Notifications and fulfillment reconciliation run afterward in the background.
Permission
SHIPMENTS_WRITE
See Troubleshooting for authentication, access, rate-limit, and service errors.
/shipments/{id}/cancelAuthorizationBearer token · headerrequiredRequired header: Authorization: Bearer <customer-api-key>. Use a Customer API key with the operation's required permission. Never use a dashboard or webshop token.
idstringrequiredID of the shipment. Obtain it from a list or create response. Unavailable IDs return 404.
Idempotency-KeystringrequiredUnique operation key, at most 255 characters after trimming. Retry the same request with the same key; use a new key for a changed request.
application/jsonEmpty JSON object ({}). No payload fields are accepted. The shipment ID comes from the URL.
objectSuccessful result
successanyrequiredmessagestringrequireddataobjectrequiredShow propertiesHide properties
idstringrequiredstatusstringrequiredrequestIdstringrequiredInvalid input or unsupported operation.
successanyrequiredmessagestringrequireddataanyrequiredrequestIdstringrequirederrorCodestringrequirederrorsobject | anyrequiredShow propertiesHide properties
fieldsobject[]Show propertiesHide properties
objectpathstringrequirederrorCodestringrequiredmessagestringrequiredpricePriceShow propertiesHide properties
currencystringrequiredbaseAmountstringrequiredsurchargeAmountstringrequiredpalletExchangeAmountstringrequiredtaxAmountstringrequiredtotalAmountstringrequiredcurrentStatusstringretryAfterSecondsintegeranyResource does not exist or belongs to another account.
successanyrequiredmessagestringrequireddataanyrequiredrequestIdstringrequirederrorCodestringrequirederrorsobject | anyrequiredShow propertiesHide properties
fieldsobject[]Show propertiesHide properties
objectpathstringrequirederrorCodestringrequiredmessagestringrequiredpricePriceShow propertiesHide properties
currencystringrequiredbaseAmountstringrequiredsurchargeAmountstringrequiredpalletExchangeAmountstringrequiredtaxAmountstringrequiredtotalAmountstringrequiredcurrentStatusstringretryAfterSecondsintegeranyState, idempotency, price, or label conflict; inspect errorCode and errors.
successanyrequiredmessagestringrequireddataanyrequiredrequestIdstringrequirederrorCodestringrequirederrorsobject | anyrequiredShow propertiesHide properties
fieldsobject[]Show propertiesHide properties
objectpathstringrequirederrorCodestringrequiredmessagestringrequiredpricePriceShow propertiesHide properties
currencystringrequiredbaseAmountstringrequiredsurchargeAmountstringrequiredpalletExchangeAmountstringrequiredtaxAmountstringrequiredtotalAmountstringrequiredcurrentStatusstringretryAfterSecondsintegerany