Cancel order
Use this endpoint to cancel an order that has not yet been picked up by the fulfillment partner. Use this when the recipient or sender requests a cancellation before the shipment is in transit.
Required fields:
orderId- the order identifier, passed as a path parameter.
Optional parameters:
Snappy-Account-Idheader - optional account scoping.Snappy-Company-Idheader - optional company scoping.
Behavior Notes:
- On success, returns the full Order object with
status: "cancelled",fulfillmentStatus: "cancelled", and a populatedcancellationDetailsobject containingcancelledAtandcancellationReason. cancellationReasonis currently hardcoded to “customer_requested”. Caller-supplied reasons may be added in a future release.cancellationReasonis currently hardcoded tocustomer_requested. Caller-supplied reasons may be added in a future release.- Returns
404if no order exists for the suppliedorderId, or if it exists but belongs to a different Company. Existence is intentionally hidden across Companies. - Returns
422when the order cannot be cancelled - typically because it is already in transit, already delivered, or already cancelled. The error envelope identifies which case fired. - Cancellation is terminal. A cancelled order cannot be re-activated; if the recipient still needs a gift, place a new order via
POST /v3/orders.
Permissions
- Requires:
orders:cancel
Authorizations
Company Level Authentication
Include your API key in the X-Api-Key header for every request:
X-Api-Key: YOUR_API_KEYHeaders
Optional account identifier for swag validation/filtering.
"acc123456"
Optional company identifier for swag validation/filtering.
"cmp123456"
Path Parameters
The unique identifier of the order to cancel. Obtained from POST /v3/orders or GET /v3/orders.
^[A-Za-z0-9]{8,}$"G7nR4bD9mK"
Response
Cancelled order.
JSON:API single-resource envelope for an order.
Order details including line items, recipient, shipping address, fulfillments, and tracking information.