POST Cancel Order

​

Cancels an order the customer has just placed, within the brand's regret window, and refunds it automatically — every payment is reverted, loyalty accrual is undone, the kitchen ticket is voided and any delivery job is cancelled.

Cancellation is only possible while all of these hold:

  • The order is still in Init, SendDelayed, SendTried or Sent. Once the kitchen has started it, cancellation is over.
  • The regret window has not expired. Brands configure its length, and it can be disabled entirely — in which case only catering orders can be cancelled.
  • For catering, the brand's cancellation deadline before the event has not passed.
  • Delivery has not been picked up or completed.
  • The original payment can still be reverted.

Every refusal returns 400 with code: 1013 in the body, so surface the message rather than trying to distinguish causes yourself. Check whether cancelling is possible before offering the button.

Note that once the customer has been marked as arrived, the regret window closes immediately and cancellation is no longer possible.

Send Content-Type: application/json even though there is no request body.

Path Parameters

  • UUID of the order to cancel

Headers

  • Type of content accepted by the API (application/json in most cases)

  • Application key for specific client app

  • Content-Type header

  • Version of the API to be used

  • Authorization header

  • Unique request identifier

Body

application/json

No request body.

Responses

  • application/json
  • Too late to cancel, or cancellation is not permitted for this order. code: 1013 in the body carries the reason.

  • Missing or invalid application key.

  • No such order.

Request Example for post/orders/{order_uuid}/cancel
curl https://api-public-demo.menu.app/api/orders/9f1c0f3a-2b7c-4a66-9f1e-2c9a1c9a1c9a/cancel \
  --request POST \
  --header 'Accept: application/json' \
  --header 'Application: application-key' \
  --header 'Content-Type: application/json' \
  --header 'API-VERSION: ' \
  --header 'X-Request-ID: c10b4a70-6274-490d-80a0-03e7bb826937'
{
  "status": "OK",
  "code": 200,
  "data": {
    "order": {
      "id": 55231,
      "uuid": "9f1c0f3a-2b7c-4a66-9f1e-2c9a1c9a1c9a",
      "code": "A7F2K",
      "status": "Canceled",
      "payment_status": "Unpaid"
    }
  }
}