BigblueDevelopers

Cancel order

Cancel an order before it ships.

POST/bigblue.storeapi.v1.PublicAPI/CancelOrder

Cancels 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

idstringrequired
Bigblue order ID.
Pattern^([A-Za-z0-9]{12}|)$
reasonstring
Why the order was cancelled. Shown in the Bigblue app.

After cancelling

Responses

200The cancellation was accepted.
{}

Get the order to confirm the new status.

400The ID doesn't match the order ID pattern.
{
  "code": "invalid_argument",
  "msg": "id value does not match regex pattern `^([[:alnum:]]{12}|)$`",
  "meta": { "argument": "id" }
}
404No order with this ID exists.
{ "code": "not_found", "msg": "order not found" }
412The order has already been picked or shipped.
{ "code": "failed_precondition", "msg": "order already handed over to the carrier" }
POST/bigblue.storeapi.v1.PublicAPI/CancelOrder
Request
{ "id": "BGBL0K3M9XQ2", "reason": "Customer cancelled" }
200
{}
Cancel or create a return
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;
}