POS - Order Cancellations

Order Cancellations

There are two possible sources of an order cancellation; one is where the ordering channel initiates the cancellation and the other is when this is set from the POS.

1. Channel Cancellations

You can expect to receive cancel requests from ordering channels to the same endpoint which new orders are sent. Normal scenarios would be where an end-customer no longer wants the order, or it has gone through, but a payment provider returns a rejected status.

A CANCEL request will effectively contain the same payload data as the original order. The only means of referencing the original order is via channelOrderId (the _id will be the same).

Every channel cancellation can be identified as including"status":100, which represents the CANCEL status.

When you receive such an order, you should handle the cancellation according to your existing POS workflow for 'Voiding' orders. This typically involves printing an additional check instructing the restaurant to halt preparation.

Once processed, confirm back to Deliverect the status CANCELLED with "status":110 as per documentation on Updating Order Status.

📘

Confirmation of Canceled Order

When updating the status to CANCELED to confirm successful cancellation, always use the original order _id received to your order webhook. The secondary order acts only as a prompt to process cancellation, and secondary cancellation will bear the original _id.

2. POS Cancellations

On receipt of an order, it is an option for a POS to process a cancellation. Typical reasons for applying this status is that the restaurant doesn't have required ingredients in stock or there is no time to prepare the order.

A dependency on supporting this feature is that orders are not configured to be auto-accepted. Only where a POS supports manually accepted orders would a cancellation option be appropriate.

This can be done by setting the status CANCELLED with "status":110 as per sample below via the Updating Order Status endpoint

A cancelled status will be communicated back to the ordering platform who will in most cases directly inform the end-customer.

{
  "orderId": "5d****e3448c290010****53",
  "status": 110,
  "reason": "cancellation",
  "timeStamp": "2023-07-14 07:44:15.000Z",
  "receiptId": "1234"
}

Cancellation of Accepted Orders

It is important to note that where a Channel or a POS initiates a cancellation, there are best practises which should be followed depending on whether an 'Accepted' status (20) or higher has already been set.

If your POS has already accepted an order or is configured to auto-accept orders, a cancellation option should no longer be available to POS users.

In the same sense, when channels receive an accepted status (or higher) from your POS, they should not then be sending cancellation requests.

❗️

Channel Cancellations

Channels should disallow customers from cancelling already accepted orders, but may continue to process these via their customer support. In these cases, Deliverect will continue to relay these cancel requests to the POS, so it is advisable that a cancellation workflow proceeds as normal.