Pricing Menu
Sometimes, integrators may wish to generate a version of their menu that includes only a list of menu items and their pricing data. The Menu Engine API allows integrators to generate a pricing menu for exactly this purpose.
Similarly to a standard menu, a pricing menu includes all available menu items for a specified site over a specific time frame. However, a pricing menu excludes the hierarchical and relational structures of a standard menu, such as the nesting of child items within a bundle or the connections between products and modifier collections. A pricing menu is essentially a catalog of menu items and their associated prices.
Time Period-Specific Pricing Menus
Integrators can generate both general and time period-specific versions of a pricing menu. Time periods are configured in Data Management, and are defined in three dimensions: days of the week, times of day, and calendar date ranges. By assigning time periods to menus and/or specific menu items, integrators can set up menus with items that change in price in any of those three dimensions. The Menu Engine API can accommodate these changes in price by creating multiple versions of a pricing menu, each corresponding to a different time period.
Note
If a menu or menu item is assigned to overlapping time periods, a pricing menu generated for that menu will prioritize the prices associated with the latest of the time periods.
Generating a Pricing Menu
Integrators can generate pricing menus with the same process used for generating standard menus. To create a pricing menu, simply include the menu_type field with a value of "price" in the request body of the create menu request, as shown in the following sample:
curl --location --request PUT 'localhost:3000/v1/menu' \
--header 'X-Company-Id: 9999999999999999' \
--header 'X-Site-Ids: 9999999999999999' \
--header 'Authorization: Bearer 9999999999999999' \
--header 'Content-Type: application/json' \
--data-raw '{
"include_default_bundle_products": true,
"include_inactive": false,
"menu_type": "price"
}'To generate a pricing menu with time period-specific versions, simply include the create_time_period_menus flag with a value of "true," as shown below:
curl --location --request PUT 'localhost:3000/v1/menu' \
--header 'X-Company-Id: 9999999999999999' \
--header 'X-Site-Ids: 9999999999999999' \
--header 'Authorization: Bearer 9999999999999999' \
--header 'Content-Type: application/json' \
--data-raw '{
"include_default_bundle_products": true,
"include_inactive": false,
"menu_type": "price"
"create_time_period_menus": true
}'Example Pricing Menu
The example below shows the format of a pricing menu:
{
"company_id": '9999999999999999",
"site_id": '9999999999999999",
"server_timestamp": "20XX-09-06T13:48:46.359Z",
"version": "X.X.XX",
"menu_timestamp": "20XX-09-06T13:48:46.079Z",
"menu_type": "Price",
"mcid": '99999999-9999-9999-9999-999999999999",
"items": [
{
"products": [
{
"name": "Toasted",
"product_id": "MOD-Toasted",
"product_type": "modifier",
"unit_price": 0
},
{
"name": "Sample Appetizer",
"product_id": "Sample Appetizer",
"product_type": "standard",
"unit_price": 4.99
},
{
"name": "Sample Kids Item",
"product_id": "Sample Kids Item",
"product_type": "standard",
"unit_price": 12.99
},
{
"name": "Comment",
"product_id": "16",
"product_type": "comment",
"unit_price": 0
},
{
"name": "Default Gift Card",
"product_id": "defaultGiftCard",
"product_type": "gift_card",
"unit_price": 0
},
{
"name": "Sample Burger",
"product_id": "Sample Burger",
"product_type": "standard",
"unit_price": 8.95
},
{
"name": "Add Ice",
"product_id": "Add MOD-Ice",
"product_type": "modifier",
"unit_price": 2
},
{
"name": "Sample Side",
"product_id": "Sample Side",
"product_type": "standard",
"unit_price": 6.8
},
{
"name": "Sample Beverage",
"product_id": "Sample Beverage",
"product_type": "standard",
"unit_price": 2.99
},
{
"name": "hot tea combo",
"product_id": "hot_tea_combo_id",
"product_type": "standard",
"is_bundle": true,
"unit_price": 5
},
{
"name": "bottled water",
"product_id": "bottled_water_id",
"product_type": "standard",
"variant_entity_id": '9999999999999999",
"unit_price": 12
},
{
"name": "cake",
"product_id": "cake_id",
"product_type": "standard",
"variant_entity_id": '9999999999999999",
"unit_price": 2
},
{
"name": "6253 product",
"product_id": "6253_product_id",
"product_type": "standard",
"is_bundle": true,
"default_bundle_product_ids": [
"hot_tea_id"
],
"variant_entity_id": '9999999999999999",
"unit_price": 30,
"prices": [
{
"unit_price": 11,
"parent_product_ids": [
"bottled_water_id",
"kasha_malasha_id_123",
"6253_product_id",
"kotletka_id"
]
}
]
},
{
"name": "6440_product",
"product_id": "6440_product_id",
"product_type": "standard",
"is_bundle": true,
"default_bundle_product_ids": [
"Sample Soup"
],
"unit_price": 12
}
]
}
]
}