Skip to content
Bookogsend / Developers
Esc
↑↓navigate↵open⌘Jpreview

Cancel shipment

Cancels a shipment before pickup.

Prerequisites

  • For a new cancellation, the shipment must be PENDING or BOOKED.
  • No package may have progressed beyond its pending delivery state.
  • Any connected return must be PENDING, BOOKED, or FAILED, with no package beyond its pending delivery state.

Behavior

  • Successful cancellation changes the status to CANCELED and retains the shipment record.
  • Canceling an already canceled shipment succeeds without changing its status.
  • 409 CANCELLATION_NOT_ALLOWED includes errors.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.

POST/shipments/{id}/cancel
Authorization
AuthorizationBearer token · headerrequired

Required header: Authorization: Bearer <customer-api-key>. Use a Customer API key with the operation's required permission. Never use a dashboard or webshop token.

Path parameters
idstringrequired

ID of the shipment. Obtain it from a list or create response. Unavailable IDs return 404.

min length 1
Header parameters
Idempotency-Keystringrequired

Unique operation key, at most 255 characters after trimming. Retry the same request with the same key; use a new key for a changed request.

min length 1 · max length 255
Request body
application/json

Empty JSON object ({}). No payload fields are accepted. The shipment ID comes from the URL.

object
Responses
200

Successful result

successanyrequired
messagestringrequired
dataobjectrequired
Show properties
idstringrequired
statusstringrequired
requestIdstringrequired
400

Invalid input or unsupported operation.

successanyrequired
messagestringrequired
dataanyrequired
requestIdstringrequired
errorCodestringrequired
errorsobject | anyrequired
Show properties
Any of:
object
fieldsobject[]
Show properties
Array of object
pathstringrequired
errorCodestringrequired
messagestringrequired
pricePrice
Show properties
currencystringrequired
baseAmountstringrequired
surchargeAmountstringrequired
palletExchangeAmountstringrequired
taxAmountstringrequired
totalAmountstringrequired
currentStatusstring
retryAfterSecondsinteger
min 1
any
any
404

Resource does not exist or belongs to another account.

successanyrequired
messagestringrequired
dataanyrequired
requestIdstringrequired
errorCodestringrequired
errorsobject | anyrequired
Show properties
Any of:
object
fieldsobject[]
Show properties
Array of object
pathstringrequired
errorCodestringrequired
messagestringrequired
pricePrice
Show properties
currencystringrequired
baseAmountstringrequired
surchargeAmountstringrequired
palletExchangeAmountstringrequired
taxAmountstringrequired
totalAmountstringrequired
currentStatusstring
retryAfterSecondsinteger
min 1
any
any
409

State, idempotency, price, or label conflict; inspect errorCode and errors.

successanyrequired
messagestringrequired
dataanyrequired
requestIdstringrequired
errorCodestringrequired
errorsobject | anyrequired
Show properties
Any of:
object
fieldsobject[]
Show properties
Array of object
pathstringrequired
errorCodestringrequired
messagestringrequired
pricePrice
Show properties
currencystringrequired
baseAmountstringrequired
surchargeAmountstringrequired
palletExchangeAmountstringrequired
taxAmountstringrequired
totalAmountstringrequired
currentStatusstring
retryAfterSecondsinteger
min 1
any
any
Request
curl -X POST "https://bookogsend.dk/api/v1/customer/shipments/%3Cshipment-id%3E/cancel" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Idempotency-Key: <unique-operation-key>" \
  -H "Content-Type: application/json" \
  -d '{}'
Response
{
  "success": true,
  "message": "Shipment canceled.",
  "data": {
    "id": "<shipment-id>",
    "status": "CANCELED"
  },
  "requestId": "<request-id>"
}