Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Current »

The main goal of this document is to explain how the Late Night Pricing capability works from the Partners API perspective, as a guide for FZs and partners.

\uD83D\uDCD8 Instructions

To set up a lateNight plu, the following process is required:

  1. Make a PUT request to /stores/menu/plus endpoint. Our example payload will be:

    {
      "plus": [
        {
          "availability": true,
          "overrides": [
            {
              "id": "lateNight",
              "price": 500
            }
          ],
          "plu": "101",
          "price": 500,
        }
      ],
      "channel": "whitelabel",
      "region": "ES",
      "serviceMode": "delivery",
      "storeIds": [
        "100"
      ]
    }

This endpoint will update the PLUs for the provided storeIds. For lateNight pricing, set an element within the override array with the lateNight id.

This lateNight pricing will be used for the provided storeId / serviceMode / channel combination if the following conditions are met:

  • LateNight pricing is enabled for the market

  • The store has lateNight hours enabled and the timeslots set in Sanity

  • The request for the menu happens during the lateNight timeslots defined in sanity.

How to set lateNight timeslots in sanity will be discussed further bellow.

More information on the endpoint can be found on https://euc1-dev-plk-partners-api.rbictg.com/docs/market/#tag/MenuAPI/operation/updateMenuPlus

  1. To check the lateNight prices defined for a store, the new GET /stores/{storeId}/menu/{serviceMode}/{channel}/menu/plus endpoint can be used.
    It will return the following payload for a given store/channel/serviceMode combination.

    {
      "data": [
        {
          "availability": true,
          "channel": "string",
          "country": "ES",
          "overrides": [
            {
              "id": "lateNight",
              "price": 500
            }
          ],
          "endDate": 1673872934,
          "plu": "string",
          "price": 500,
          "serviceMode": "delivery",
          "storeId": "641234",
          "version": 1673872934
        }
      ],
      "meta": {
        "version": 1673872934
      }
    }

More information can be found on https://euc1-dev-plk-partners-api.rbictg.com/docs/market/#tag/MenuAPI/operation/getStoreMenuPlus

Keep in mind that the PUT operation to update the PLUs happens asynchronously, so it may take a few minutes to reflect.

  1. To enable the restaurant LateNight pricing on sanity, go to the restaurant document and enable the Late Night Pricing option under Restaurant Availability menu.

  2. Once enabled, you’ll be able to set the timeslots per day.

It’s possible to define multiple timeslots per day. For example, you can have late night pricing on Monday from 20:00 to 21:00 and from 22:00 to 23:00.

There’s no default timeslots, so if you don’t set the timeslots for a given day, the lateNight pricing won’t be used that day.

  1. Click the button ‘Add Item’ to create a new timeslot.

It’s imperative to use the 24h format.

You don’t need to worry about timezones when setting these hours. The restaurant timezone information will be considered when calculating which prices to serve.

  • No labels