Integrate Menus

To integrate your POS for menus you need to implement:

We recommend that you do these all as seperate endpoints, but you can do it as one endpoint and use the "Type" field to determine the type of data sent to you.

Get Menu

To give us the menu.

Flyt will call this endpoint with a GET, expecting to be able to get any menus that exist for that location for that order type.

As a response, Flyt will expect a response with the full menu JSON payload.

Headers
AccessToken : XXX (provided by POS)

Parameters
{
  "type" : "GetMenu",
  "posLocationId" : "BBBBBBBBB",  // Value stored in Flyt config
}


Response: 200 OK
{
  "baseline_menus": [{
    "name": "Lunch/Dinner menu",  // Name of the menu
    "reference": "2",
    "type": "DELIVERY",           // Can be ANY, COLLECTION, EAT_IN or DELIVERY
    "categories": [{
      "name": "Burger Meals",
      "description": "Will delight burger lovers",
      "items": [{
        "name": "Cheeseburger",
        "description": "Will make you cry with joy",
        "plu": "3",               // Usually item's id
        "price": 159,             // Price in cents (!)
        "modifiers": [{
          "name": "Extra for Cheeseburger",
          "description": "Choose your extras",
          "pick": {
            "range": {   // Use this or exactly or unlimited. Determines if the options are required and how many
              "from": 0,
              "to": 9
            },
            "pick_same_option": false  // Tells if same option can be selected more than once
          },
          "options": [{
            // SAME AS ABOVE, IS ANOTHER ITEM OBJECT, CAN KEEP GOING DOWN
            "name": "Extra Cheese [45.0 Cals]",
            "description": "",
             "plu": "GRILL|15#P0D5",
            "price": 50,
            "modifiers": [],
            "includes": [],
            "ingredients": []
          }],
        }],
        "includes": // Includes are items already included that can be removed
          [{
            "name": "Tomato",
            "plu": "AAAAA",         // PLU To remove this item
            "description": "Juicy", // Not often used
            "modifiers": [{
              // AS ABOVE
            }]
          }],
        "ingredients": [{
          "name": "tomato"
        }]
      }]
    }]
  }]
}

Menu from your endpoint should match our set of typescript interfaces. So whatever your POS returns has to be mapped to this:

Menu class diagram

For sample menu see json above.

Pick options

We have three types of them (they are on MenuModifier):

  • PickExactly – it is allowed to take the exact number of modifiers for an item. E.g. we order coffee and its modifier is size – we pick exactly one size and cannot pick same option multiple times.

    {
    exactly: Integer;
    pick_same_option: Boolean;
    }
  • PickRange – allows to take certain range of modifiers for an item. E.g. we order a toast and one of the modifiers is extras (range from 0 to 3, with pick same option set to true) – so we can order a toast with extra cheese an tomato (no more than 3!) or just bacon strips 3 times.

    {
    range: {
      from: Integer;
      to: Integer;
    }
    pick_same_option: Boolean;
    }
  • PickUnlimited – take as much as you want. The only limitation might be picking same option more than once.

    {
    pick_same_option: Boolean;
    }

Send us your menu

If instead of us polling your POS you want to send us your menu whenever it changes you can do so. The structure of this call is:

Headers
X-Flyt-Api-Key : XXX (provided by Flyt)

POST {host}/pos/{posName}/business/{businessName}/menus
{
    ".... Your menu structure here"
}

In-Stock Out-of-Stock

The following endpoint is still in development and the spec could change

We have an endpoint within Flyt that allows you to tell us when an item goes in-stock or out of stock.

For example for the

Headers
X-Flyt-Api-Key : XXX (provided by Flyt)

POST {host}/stock/{posName}/businesses/{flytBusinessId}/locations/{locationReference}/stock-update
{
    "event": "IN_STOCK|OUT_OF_STOCK", // Required
    "itemReference": "1234-3324332-23423-234", // Required (POS's item ID)
    "happenedAt": "2018-10-11T14:56:98.234284+01:00", // Required
    "menuReference": "345345", // Optional
}

The response in case of a successful response is

SUCCESS: 202 Accepted
// no body

or for failure:

FAILURE: 400 Bad Request
{
    "message": string
}

What is "locationReference"?

Location reference is the value the POS uses to reference itself, that needs to be setup on the location page on Flyt portal.

Why is "itemReference" and not "item.plu"?

In 99% of cases this will be your PLU, but there are some cases where this isn't unique enough and then you can send us other data.

Will I be notified when the menu is reflecting this change?

You can ask our team to setup a webhook to the services providers that are gonna use the menu to receive updates when the new (updated) menu will be available. Read [this page](https://developers.flyt.io/menus/updates-to-menus/ for more information about this functionality.