Cancel order
Cancel an order before it ships.
POST
/ bigblue.storeapi.v1.PublicAPI/ CancelOrderCancels an order and returns an empty object.
You can cancel an order while it's PENDING or BACKORDER. Once it's picked or
handed to a carrier, cancelling fails with failed_precondition. Create a
return instead.
A cancelled order can't be restored. Create a new order instead.
Request body
idstringrequiredBigblue order ID.
Pattern
^([A-Za-z0-9]{12}|)$reasonstringWhy the order was cancelled. Shown in the Bigblue app.
After cancelling
- Reserved stock becomes available again.
- The status changes to
CANCELLED. See Order statuses. - If you have an order status webhook, it receives the new status.
Responses
{}Get the order to confirm the new status.
{
"code": "invalid_argument",
"msg": "id value does not match regex pattern `^([[:alnum:]]{12}|)$`",
"meta": { "argument": "id" }
}{ "code": "not_found", "msg": "order not found" }{ "code": "failed_precondition", "msg": "order already handed over to the carrier" }POST
/ bigblue.storeapi.v1.PublicAPI/ CancelOrder{ "id": "BGBL0K3M9XQ2", "reason": "Customer cancelled" }{}try {
await call('CancelOrder', { id, reason: 'Customer cancelled' });
} catch (e) {
if (e.code === 'failed_precondition') {
// Already shipped: start a return instead.
return startReturn(id);
}
throw e;
}