e.g. {{YourSetwebhookUrl}}/store_status
Purpose
This will be called when a store status changes.
The content of the webhook event provides information on an individual store status change e.g. Store 1 was closed on Channel 2.
To test this out, you can add the webhook URL in the Location settings of your staging environment within the 'Store Status Webhook URL' field.
Store Status
When a store is set as open or closed online, it can come from one of three sources;
- A deliberate user decision to stop taking online orders, either from Deliverect frontend or via and integration using the endpoint Update Store Status (open/closed)
- A deliberate user decision to stop taking online orders, not actioned from Deliverect, but directly from their online ordering application
- An automated action performed by the ordering platform i.e. in response to reaching a threshold of failed orders
When any of the above actions takes place, a webhook event can be sent to a designated endpoint. This event will include information that a POS partner can sync into their platform for reference. If using this endpoint, it should be provided by the POS as part of the registration flow Register POS.
Webhook Content
The expected properties are defined as follows and the webhook payload example is shown as an example underneath;
| Attribute | Definition | Format |
|---|---|---|
eventTime | Time stated in UTC is when the sync occurred in Deliverect or when the store changed status, depending on which timestamp is the more accurate measurement | str |
event | The values will be either "storeClosed" or "storeOpened" | str |
source | The values will be; • "external" = Deliverect identified a change in store status (typically via polling)• "deliverect" = A Deliverect user has changed the store status. | str |
reason | A string specifying any specific reason (if available) e.g. for example noDriversAvailable, closedByUser | str |
averageDeliveryTime | If available, the average delivery time for a store. | str |
locationId | Deliverect's unique ID of the customer location | str |
posLocationId | The ID set for the location by the POS | str |
channelLinkId | Deliverect's unique identifier of an individual store in a location | str |
channel | The global identifier of the channel platform see Get Integrated Channels | str |
{
"storeStatusSyncUpdates": [
{
"eventTime": "2023-02-15T15:32:33Z",
"event": "storeClosed",
"source": "external",
"reason": null,
"averageDeliveryTime": null,
"channelLinkId": "63a34d*******d06fbd72",
"locationId": "63a34d*******d44fbr53",
"posLocationId": "AzyXT****yqprFVo",
"channel": 7
}
]
}{
"storeStatusSyncUpdates": [
{
"eventTime": "2023-02-15T15:32:33Z",
"event": "storeOpened",
"source": "external",
"reason": null,
"averageDeliveryTime": null,
"channelLinkId": "63a34d*******d06fbd72",
"locationId": "63a34d*******d44fbr53",
"posLocationId": "AzyXT****yqprFVo",
"channel": 7
}
]
}Webhook Response
Content-Type: application/json