*This will be the same webhook endpoint set by the POS for Order Notifications
When a customer orders from a Deliverect integrated channel, it will immediately deliver a webhook to a specified Order Notification webhook endpoint provided by the POS.
If a channel subsequently processes a cancellation, this same webhook will receive the order a second time with "status":100
included, this status 'Cancel' indicates the order is to be cancelled.
Upon receipt of orders with this status, the original order can be referenced either via the "channelOrderId"
or the "_id"
which will both remain the same.
A POS should handle the cancellation according to your existing POS workflow e.g. as per 'Voided' orders which 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.
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.
Order Model
For a full list of all order attributes and their definition, see the link below;
Example order cancellation payload
{
"_created": "YYYY-MM-DDTHH:mm:ss.SSSSSSZ",
"_updated": "YYYY-MM-DDT08:36:46.SSSSSSZ",
"_id": "62********************7c",
"account": "61********************a1",
"channelOrderId": "TEST******4206",
"channelOrderDisplayId": "T**4206",
"posId": "",
"posReceiptId": "",
"posLocationId": "",
"location": "61********************b4",
"channelLink": "61********************c3",
"status": 100,
"statusHistory": [
{
"timeStamp": "YYYY-MM-DDTHH:mm:ss.SSSSSSZ",
"status": 4,
"response": "",
"source": 2
},
{
"timeStamp": "YYYY-MM-DDTHH:mm:ss.SSSSSSZ",
"status": 1,
"response": "",
"source": 5
}
],
"packaging": {
"includeCutlery": false
},
"by": "Deliverect",
"orderType": 2,
"channel": 1,
"pos": 10000,
"rating": [],
"pickupTime": "YYYY-MM-DDTHH:mm:ss.SSSSSSZ",
"deliveryTime": "YYYY-MM-DDTHH:mm:ss.SSSSSSZ",
"deliveryIsAsap": true,
"courier": {
"firstName": "",
"lastName": "",
"phoneNumber": "",
"deliveryBy": "restaurant"
},
"courierUpdateHistory": [
{
"status": 72,
"received": "YYYY-MM-DDTHH:mm:ss.SSSSSSZ",
"courier": {},
"arrivalTime": "YYYY-MM-DDTHH:mm:ss.SSSSSSZ",
"deliveryTime": "YYYY-MM-DDTHH:mm:ss.SSSSSSZ",
"source": 5
}
],
"customer": {
"name": "Jack",
"companyName": "Deliverect",
"phoneNumber": "+31615887898",
"phoneAccessCode": "0020",
"email": "[email protected]",
"note": "call me when you arrive",
"tin": ""
},
"deliveryAddress": {
"street": "",
"postalCode": "",
"area": "",
"city": "",
"country": "",
"extraAddressInfo": "",
"coordinates": {
"coordinates": [
80.9,
-90.3
]
}
},
"orderIsAlreadyPaid": true,
"taxes": [],
"payment": {
"amount": 650,
"type": 0,
"due": 0,
"rebate": 0,
"commissionType": ""
},
"note": "",
"items": [
{
"plu": "P-BRGR",
"name": "Burger Combo (Drink not Included)",
"sortOrder": 0,
"price": 500,
"quantity": 1,
"productType": 1,
"isCombo": true,
"subItems": [
{
"plu": "DRK-01",
"name": "Diet Soda",
"sortOrder": 0,
"price": 100,
"quantity": 1,
"productType": 1,
"subItems": []
},
{
"plu": "P-BURG-CHE",
"name": "Cheeseburger",
"sortOrder": 0,
"price": 0,
"quantity": 1,
"productType": 1,
"inBundle": true,
"subItems": [
{
"plu": "P-GHRK",
"name": "Extra Gherkin",
"sortOrder": 0,
"price": 50,
"quantity": 2,
"productType": 1,
"subItems": [],
"productTags": []
}
],
"productTags": []
}
],
"productTags": [
14
]
}
],
"decimalDigits": 2,
"numberOfCustomers": 1,
"channelOrderRawId": "62********************73",
"channelOrderHistoryRawIds": [],
"serviceCharge": 0,
"deliveryCost": 0,
"bagFee": 0,
"tip": 0,
"driverTip": 0,
"discountTotal": -50,
"discounts": [
{
"type": "order_flat_off",
"provider": "channel",
"name": "Discount",
"channelDiscountCode": "50OFF",
"referenceId": "1",
"value": 50,
"amount": 50
}
],
"capacityUsages": [],
"recent": true,
"resolvedBy": "",
"brandId": "61********************60",
"testOrder": true,
"timezone": "Europe/Amsterdam",
"date": 20230414,
"tags": [
"BRAND X"
]
}
Response
The initial response to the order notification webhook should be a HTTP 200
or 201
received within 30 seconds.
Content-Type: application/json