Retrieve a Complete Menu Structure

This article guides you through the recommended process for fetching a complete menu structure, including all sub-entities, using the Menus API.

The Wix Restaurants Menus system is organized hierarchically: menus contain sections, sections contain items, and items can have variants, modifier groups which in turn contain modifiers, and labels.

Copy

To retrieve all the information for a menu and it's sub-entities, you need to follow the relationships between these entities and make multiple API calls.

The end result is a complete, in-memory representation of your menu, ready for display or further processing.

To retrieve an entire menu:

  1. Call List Menus or Query Menus and record the ID of the menu you want to retrieve.
  2. Call Get Menu with the ID from the previous step. The response includes the menu's basic information and a list of section IDs (sectionIds).
  3. Call List Sections with the section IDs to fetch all sections in a single call. Each section contains a list of item IDs (itemIds).
  4. Call List Items with the collected item IDs to fetch all items.
  5. For each item, call the following methods as needed to retrieve sub-entities:
    • Call List Variants with the variant IDs from the item's priceVariants.variants
    • Call List Modifier Groups with the modifier group IDs from the item's modifierGroups array.
    • For each modifier group, call List Modifiers with the modifier IDs to get modifiers.
    • Call List Labels with the label IDs from the item's labels array.

Important considerations

  • Pagination: Each List method supports pagination. For large menus, you may need to make multiple requests.
  • Business locations: Menus and sections are tied to specific business locations, while items, variants, and modifiers can be shared across locations. Pay attention to the businessLocationId or businessLocationIds fields.
  • Performance optimization: Call List or Query methods with multiple IDs instead of individual Get calls. Consider calling methods in parallel to reduce latency.
  • Query API: For some entities, you may find it more efficient to use the Query methods, such as Query Menus, or Query Items, with filters, especially if you need to filter based on specific criteria.

See also

Did this help?