...
Webhook type:
MENU_PRICES_AVAILABILITY_UPDATE
Store Menu Version Webhook documented here
This Webhook Event will contain the following message body:
Code Block |
---|
{
"brand": "BK",
"data": {
"created": [],
"updated": [],
"deleted": []
},
"region": "NZ",
"serviceMode": "pickup",
"storeId": "1234",
"version": 20231026212510630,
"eventTime": "2023-03-28T22:41:03.279Z",
"eventType": "MENU_PRICES_AVAILABILITY_UPDATE"
} |
There are two fields that require a deeper explanation here: version
and eventTime
.The version
is a ISO 8601 UTC Date Time without the digits. So on our example the version 20231026212510630
equates the ISO Date Time 2023-10-26T21:25:10.630Z
. For example, if you create PLU 501 at 2023-10-26T21:25:10.630Z
ISO Date, the current menu version received in this webhook will be 20231026212510630
. If another PLU is then updated, a new webhook event will be generated and a new version will be attached to the menu.
The eventTime
is a ISO Date which refers to the moment the webhook event was generated. It is not related in any way to the menu versioning. The arrays within the data object will contain objects relative to the created, updated or deleted in this specific version. Here’s a sample of what one of these objects look like:
Code Block |
---|
{
"availability": true,
"channel": "whitelabel",
"country": "US",
"endDate": 1673872934,
"hours": [
{
"start": "1700",
"end": "2100"
}
],
"plu": "string",
"price": 500,
"priority": 1,
"repetition": [
"Mo",
"Fr"
],
"startDate": 1673872934,
"serviceMode": "delivery",
"storeId": "641234",
"version": 20231026212510630
} |
\uD83D\uDCD8 Webhook Instructions
To see how it works, here is the step-by-step:
Create or update by making a
PUT
call on the following Partners-API endpoint/api/v1/stores/{storeId}/menu/plus
. For the sake of our example, let’s use the following payload:Code Block { "plus": [ { "plu": "502", "prices": [ { "price": { "currency": "USD", "amount": 100 }, "channel": "WHITELABEL_IN_STORE" } ] } ] }
This will asynchronously trigger a few internal processes that will generate the following
MENU_PRICES_AVAILABILITY_UPDATE
webhook event. This also generates aStoreMenuVersion
record in our database, which will be kept for 7 days.
Code Block { "brand": "BK", "channel": "whitelabel", "chunk": 0, "country": "NZ", "data": { "created": [ { "channel": "whitelabel", "country": "NZ", "plu": "502", "price": 100, "serviceMode": "pickup", "startDate": 1680016297075, "storeId": "456471", "version": 20230328151137129 } ], "deleted": [ ], "updated": [ ] }, "serviceMode": "pickup", "storeId": "456471", "eventTime": "2023-03-28T22:41:03.279Z", "eventType": "MENU_PRICES_AVAILABILITY_UPDATE" }
Endpoints
GET Store Menu PLUs
endpoint documented hereGET Store Menu Diff
endpoint documented hereUpdate (PUT) Store Menu PLUs
endpoint documented here
...