Integrate Menus

To integrate your POS for menus we have 1 health endpoint that you must integrate and 1 required endpoint to give us the menu. 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" : "main summer menu", // Name of the menu
    "type" : "ANY", //COLLECTION,EAT_IN,DELIVERY
    "categories" :[{
      "name" : "category name",
      "description" : "Description of the cateory",
      "items" :[{
        "name" : "Cheeseburger",
        "description" : "Will make you cry with joy",
        "plu" : "AAAAAA",
        "price" : 525, //Price in cents
        "modifiers" :[{
          "name" : "Cheese choice",
          "description" : "Choose your cheese",
          "pick" : {
            "exactly": 1, // Use this or a range 1-3 or omit for unlimited.  This determines if the options are required
          },
          "options" : [{
            // SAME AS ABOVE IS ANOTHER ITEM OBJECT CAN KEEP GOING DOWN
          }],
        }],
        "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"
        }]

}

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 is 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.