Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The main goal of this document is to explain how to use the Channel Extension (channel-level P&A management) from a partner and FZ perspective.

Table of Contents

\uD83D\uDCD8 Notes

  1. To be notified about changes regarding Channels, you will need to subscribe to the MENU_PRICES_AVAILABILITY_UPDATE webhook /wiki/spaces/TRX/pages/4404314113. This webhook contains information about which Channel P&A has been updated.

  2. Channels P&A can be changed either through Partners API or FZ Portal, but they must be configured in Sanity first.

  3. Content is not handled for Channels, only P&A.

  4. To consume and edit data through partners-api, you must use the newer APIs
    GET /api/v1/stores/{storeId}/menu/{serviceMode}/{channel}/plus - getStoreMenuPlus
    PUT /api/v1/stores/menu/plus - updateMenuPlus
    GET /api/v1/stores/{storeId}/menu/{serviceMode}/{channel}/plus/diff/{version} - getStoreMenuDiff

\uD83D\uDCD8 Step by Step -

...

The Digital Operations Portal

For this example we’re going to use the Channel Uber.

...

  1. Similarly, if subscribed to the MENU_PRICES_AVAILABILITY_UPDATE webhook, the partner(s) will be notified of this change with the following payload.

    Code Block
    {
      "brand": "PLK",
      "channel": "uber",
      "chunk": 0,
      "data": {
        "deleted": [],
        "created": [],
        "updated": [
          {
            "country": "ES",
            "serviceMode": "delivery",
            "price": 500,
            "draft": "approved",
            "plu": "942214",
            "channel": "uber",
            "availability": true,
            "overrides": [
              {
                "price": 1500,
                "id": "lateNight"
              }
            ],
            "priority": 1,
            "storeId": "1111",
            "version": 20231215172229464,
            "sanityId": "item_50929"
          }
        ]
      },
      "eventTime": "2023-12-15T17:23:07.597Z",
      "eventType": "MENU_PRICES_AVAILABILITY_UPDATE",
      "region": "ES",
      "serviceMode": "delivery",
      "storeId": "1111",
      "version": 20231215172229464
    }
  2. Partners can also use the Get Store Menu Diff API to sync with the latest changes GET /api/v1/stores/{storeId}/menu/{serviceMode}/{channel}/plus/diff/{version} - Get Store Menu Diff
    Make a call to GET /api/v1/stores/1111/menu/delivery/uber/plus/diff/20231215164756576, the version number being the previously received version in the webhook.
    It will return the following payload with the latest changes:

    Code Block
    {
      "data": {
        "20231215172229464": {
          "created": [],
          "deleted": [],
          "updated": [
            {
              "country": "ES",
              "serviceMode": "delivery",
              "price": 500,
              "draft": "approved",
              "plu": "942214",
              "channel": "uber",
              "availability": true,
              "overrides": [
                {
                  "price": 1500,
                  "id": "lateNight"
                }
              ],
              "priority": 1,
              "storeId": "1111",
              "version": 20231215172229464,
              "sanityId": "item_50929"
            }
          ]
        }
      }
    }

...