Sous Chef API
Sous Chef Management API
Documentation

Cancel an order

POST/management/order-intake/cancelOrder

Cancel an order you created.

Idempotent: cancelling an order that is already cancelled, finished or rejected does nothing. A cancellation that arrives before its order is retried until the order exists, not lost. storeCode is required even though platformOrderId alone looks sufficient — it is what keeps one organization from cancelling another's order.

Statuses beyond the common ones: 403, 404 and 422 as on createOrder.

Safe to retry: this operation changes state but is idempotent.

Request

application/json
required
  • storeCodestring

    Required. The store's code. Required so one organization can never cancel another's order.

  • platformOrderIdstring

    Required. The platformOrderId you sent on createOrder.

  • reasonstring

    Why. Defaults to other.

    Possible values: [itemOutOfStock, storeClosed, kitchenBusy, other]
  • detailsstring

    Free-text detail. Personal data.

Responses

200 — The cancellation as received. The result follows as an `order.cancelled` webhook.

Headers

  • x-mealco-tx-idstringoptional

    The correlation id for this call, echoed on every response — a 200 exactly as much as a 400, 401 or 500. Quote it when reporting a problem and we can find every log line for the request, in every service it touched. You may also send your own x-mealco-tx-id on the request and we adopt it, so your correlation id becomes ours. Not marked required for one reason: a request whose JSON body is malformed is rejected before it reaches an operation, so no id exists yet and that single response carries neither this header nor the txId field of the error body. Everything that reaches an operation carries it.

  • platformOrderIdstring

    Your platformOrderId, echoed.

  • storeCodestring

    Your storeCode, echoed.

  • receivedAtstring<date-time>

    When we received the cancellation.

  • statusstring

    What happened to the cancellation: queued or created.

    Possible values: [created, queued]

About Order intake

Send Sous Chef the orders your platform takes for the stores you sell for.

Separate from Orders, which is the read side: this section places, cancels and moves orders along; Orders and the order.* webhooks tell you what became of them. Same api key and x-mealco-org-id header, but the key must also carry the order-intake grant — a key without it is refused with 403 even if it can manage your estate. A different job, and a different route prefix (/management/order-intake) so the url says which.

Stores are addressed by their code from fetchStores. A code that is unknown, retired or another organization's answers 404, indistinguishably. A store whose channel does not take orders through this API answers 422.

200 means we queued the call, not that the restaurant accepted the order. Every operation here is idempotent, so retry on 500 / 503 freely.