About Business Locations

Wix Restaurants (New) enables the management of online orders and menus across multiple restaurant locations by linking the entities in those services to specific business locations. This article outlines the structure and integration of location information within the system, and explains how it's managed.

Integration with the Locations API

Entities in online orders and menus can be associated with specific business locations represented by Location objects.

An entity is associated with a Location if it has that location's ID in its businessLocationId field or businessLocationIds array.

Business location requirements and behavior

In general, a businessLocationId can't be set manually. It's either configured automatically when an entity is created, or updated automatically based on connections between entities. The exceptions are service fee rules and menus, whose businessLocationId can be set once.

Requirements and behavior specific to online orders

Operations, fulfillment methods, menu ordering settings and availability exceptions all have read-only businessLocationId fields.

Service fee rules have a locationId field, which fulfills the same role as businessLocationId. If you create a rule when the restaurant has no locations configured, the rule's locationId is set to "none". When you configure the first location, any rules with a locationId of "none" are assigned the new location. You can change a rule's locationId at any time.

If locations aren't configured on a site, online ordering functionality is limited to testing only, and in some cases may not work as expected.

Operations are created automatically, and their businessLocationId is set automatically. For more information, see operation groups.

Operations also contain a businessLocationDetails object with additional information about the location taken from the Location object.

When an operation group is created on a site with no locations, Wix creates a single operation in that group with a businessLocationId of "none". When the first location is added, the single operation in each group is assigned the new location. (Their businessLocationId is set to the new location's ID.) When a second location is added, a new operation is created for each operation group and assigned the new location.

Fulfillment methods and availability exceptions have the businessLocationId of their connected operation. A fulfillment method is connected to an operation if that operation contains the fulfillment method's ID in its fulfillmentIds array. Availability exceptions are connected to operations by their operationId value.

If either of these entities are updated to connect them with a new operation, their businessLocationId is updated automatically to match the businessLocationId of the new operation.

Menu ordering settings have the businessLocationId of their connected menu. Menu ordering settings are connected to menus by their menuId value. If menu ordering settings are updated to connect them with a new menu, their businessLocationId is updated automatically to match the businessLocationId of the new menu.

Requirements and behavior specific to menus

A menu can only be available at 1 restaurant location, so it can only have 1 businessLocationId. The same is true for sections.

Menus also contain a businessLocationDetails object with additional information about the location taken from the Location object.

Items, item variants, item modifiers, and item modifier groups can be used in multiple menus across multiple restaurant locations, so they each have a businessLocationIds array to hold the businessLocationId of each of their associated locations.

businessLocationIds and businessLocationId properties in Menus entities are read-only, except in menu objects, whose businessLocationId can be specified on creation. If you create a menu when the restaurant has at least 1 location configured and you don't specify a businessLocationId, the menu is assigned the restaurant's default location. If you create a menu when the restaurant has no locations configured, the menu's businessLocationId is set to "none". When you configure the first location, any menus with a businessLocationId of "none" are assigned the new location.

The server automatically maintains the correct businessLocationId for all menus sub-entities based on the menu they're contained in. This includes sections, items, item variants, item modifiers, and item modifier groups. For example, if an item is added to a section in a menu, the businessLocationId of the menu is automatically added to the item's businessLocationIds. Likewise, if the item is removed from a section in a menu, the businessLocationId of the menu is automatically removed from the item's businessLocationIds. These changes propagate with eventual consistency, so there might be a short delay before they're reflected in all parts of the system.

Did this help?