{{YourSetwebhookUrl}}

Temporarily marking one or more products as unavailable (e.g., they are out of stock, no ingredients) is called snoozing.

What should a snoozed product look like on my channel?

The desired effect of snoozing a product is that it remains visible in the target store but is unavailable at present. One way of doing this would be by greying out a product's entry, making it unselectable. As a snooze request also contains the length of time, it is possible to show an estimate of when the product will become available again.

If your channel does not support this way of handling snoozed products, the next best thing is to temporarily not display snoozed products on the target store. However, note that this is less clear to customers ordering food online. If they cannot see the snoozed product, they may not understand when, if ever, it will become available again. And that is even if they were aware of the product's existence in the first place.

Request format

To snooze one or more products, your channel API will receive requests in the format shown in the request shown on the right. For a combination of accountId, locationId and channelLinkId, the request will contain a list of actions. In this case, the action is snooze.

In general, an action also has a data field. For the snooze action, the data contains items, which is a list of items for snoozing. Note that, for each item in items, you can see the period during which it should be snoozed, with start and end times stored as snoozeStart and snoozeEnd, respectively. The example on the right shows what timestamp format is used for these values.

Note that the _id mentioned in the request is deprecated. The items should be snoozed based on the PLU.

By default, the list of items you will receive in a snooze request from Deliverect will contain only additional items to snooze. If your channel cannot support this, you can change this setting for the channel link of your channel within Deliverect, so each time you receive a snooze request for your channel, you will also receive the complete list of all items (allSnoozedItems) that should be snoozed (previously snoozed items included).

Response format

The response should indicate if snoozing was successful with a 200 OK status code, and the (JSON) body should consist of a list of results that correspond to the required actions in the request. Each result should repeat the snooze action for confirmation.

Like an action, a result also has a data field. For the snooze action, the data should contain the ID of the location, as well as a list containing the PLUs of all items currently snoozed (including products already snoozed). This is also for confirmation. Only use a 200 OK response to indicate that all items listed in the request have been successfully snoozed. Also, make sure to only send this response after having snoozed all items; the moment your channel sends this response, items must already be snoozed in the targeted store.

If the desired snooze action cannot be performed, send back an appropriate response and corresponding status. If any of the issues below manifest themselves, make sure to indicate each of them in an array in your response.

🚧

Work in progress

Before this functionality goes live, we will rework the format that you should report issues to us. However, in any case, we will still require you to send back a list of all products currently snoozed.

Issue

What to do

One or more products used in the request do not exist on your end.

Snooze all products possible, but send back a failure status (as snoozing was not achieved for all products).

The product is already snoozed.

Nothing needs to be done, as the desired effect is already achieved. If this is the only type of issue, you can still send back a success status.

For each product that causes an issue, send back its ID and PLU.

Have a look at the example responses to see what format you should use to communicate issues back.

{
    "accountId":"5b****71c6489f0029****d4",
    "locationId":"5c****ecc6489f0001****b8",
    "channelLinkId":"5e****abc11dec0001****9b",
    "operations":[
        {
            "action":"snooze",
            "data":{
                "items":[
                    {
                        "_id":"5c****43c6489f0001****65",
                        "plu":"PIE1",
                        "snoozeStart":"2020-03-24T16:21:54Z",
                        "snoozeEnd":"2020-03-24T22:21:54Z"
                    },
                    {
                        "_id":"5c****43c6489f0001****3b",
                        "plu":"MSB1",
                        "snoozeStart":"2020-03-24T16:21:54Z",
                        "snoozeEnd":"2020-03-24T22:21:54Z"
                    }
                ]
            }
        }
    ]
}
{
    "accountId":"5b****71c6489f0029****d4",
    "locationId":"5c****ecc6489f0001****b8",
    "channelLinkId":"5e****abc11dec0001****9b",
    "operations":[
        {
            "action":"snooze",
            "data":{
                "items":[
                    {
                        "_id":"5c****43c6489f0001****65",
                        "plu":"PIE1",
                        "snoozeStart":"2020-03-24T16:21:54.955000Z",
                        "snoozeEnd":"2020-03-24T22:21:54.955000Z"
                    },
                    {
                        "_id":"5c****43c6489f0001****3b",
                        "plu":"MSB1",
                        "snoozeStart":"2020-03-24T16:21:54.955000Z",
                        "snoozeEnd":"2020-03-24T22:21:54.955000Z"
                    }
                ]
            }
        }
    ]
}
{
    "accountId":"5b****71c6489f0029****d4",
    "locationId":"5c****ecc6489f0001****b8",
    "channelLinkId":"5e****abc11dec0001****9b",
    "operations":[
        {
            "action":"snooze",
            "data":{
                "items":[
                    {
                        "_id":"5c****43c6489f0001****65",
                        "plu":"PIE1",
                        "snoozeStart":"2020-03-24T16:21:54.955000Z",
                        "snoozeEnd":"2020-03-24T22:21:54.955000Z"
                    },
                    {
                        "_id":"5c****43c6489f0001****3b",
                        "plu":"MSB1",
                        "snoozeStart":"2020-03-24T16:21:54.955000Z",
                        "snoozeEnd":"2020-03-24T22:21:54.955000Z"
                    }
                ]
            }
        }
    ]
}
{
    "accountId":"5b****71c6489f0029****d4",
    "locationId":"5c****ecc6489f0001****b8",
    "channelLinkId":"5e****abc11dec0001****9b",
    "operations":[
        {
            "action":"snooze",
            "data":{
                "items":[
                    {
                        "_id":"5c****43c6489f0001****65",
                        "plu":"PIE1",
                        "snoozeStart":"2020-03-24T16:21:54.955000Z",
                        "snoozeEnd":"2020-03-24T22:21:54.955000Z"
                    }
                ],
                "allSnoozedItems":[
                    {
                        "_id":"5c****43c6489f0001****65",
                        "plu":"PIE1",
                        "snoozeStart":"2020-03-24T16:21:54.955000Z",
                        "snoozeEnd":"2020-03-24T22:21:54.955000Z"
                    },
                    {
                        "_id":"5c****43c6489f0001****3b",
                        "plu":"MSB1",
                        "snoozeStart":"2020-03-24T16:21:54.955000Z",
                        "snoozeEnd":"2020-03-24T22:21:54.955000Z"
                    }
                ]
            }
        }
    ]
}
{
  "results": [
    {
      "action": "snooze",
      "data": {
        "locationId": "5c****ecc6489f0001****b8",
        "allSnoozedItems": [
          "PIE1",
          "MSB1"
        ]
      }
    }
  ]
}