The Item Variants API allows you to manage the pricing options applied to menu items. Item variants are determined by specific parameters like size, base ingredient, quantity and other customizable attributes. For example, you can have a raspberry lemonade with sizes "small", "medium", and "large", where pricing for each size is different.
The same item variant can be used across various menu items for better flexibility and consistency.
With the Item Variants API, you can:
It's important to note the following point before starting to code:
This article presents possible use cases and corresponding sample flows that your app can support. It provides a useful starting point as you plan your app's implementation.
If you have several pizzeria sites that use your app you might need to sync menu across those sites. For example, if there are new variants for a drink called "Small", "Medium", and "Large", this change also needs to be reflected on other sites.
To sync the pizza menu across all sites:
name
field on the site where you updated the menu.variant.name
field values.item.priceVariants.variants
array.The following table shows field support for filters and sorting for the item variants object:
Field | Supported Filters | Sortable |
---|---|---|
id | $eq , $ne , $in , $nin | Sortable |
createdDate | $eq , $ne , $gt , $lt , $gte , $lte | Sortable |
updatedDate | $eq , $ne , $gt , $lt , $gte , $lte | Sortable |
name | $eq , $ne , $in , $nin | Sortable |
Related content: API Query Language, Query Variants.
Item variant ID.
Revision number, which increments by 1 each time the item variant is updated. To prevent conflicting changes, the current revision must be passed when updating the item variant. Ignored when creating an item variant.
Date and time the item variant was created.
Date and time the item variant was updated.
Item variant name.
Extended fields.
This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Note: The Item Variants API only works with the Wix Restaurants Menus (New) app. Make sure you have installed this app from the Wix App Market.
Retrieves a list of up to 100 item variants.
Item variant IDs.
Number of items to load.
Pointer to the next or previous page in the list of results.
You can get the relevant cursor token
from the pagingMetadata
object in the previous call's response.
Not relevant for the first request.
The retrieved item variants.
The metadata of the paginated results.
curl -X GET https://www.wixapis.com/restaurants/item-variants/v1/variants \
-H 'Authorization: <AUTH>'
{
"variants": [
{
"id": "02042f01-58ab-441c-b5db-55f51c855a62",
"revision": "1",
"createdDate": "2023-12-03T21:23:33.861Z",
"updatedDate": "2023-12-03T21:23:33.861Z",
"name": "Small"
},
{
"id": "0517e5d4-8fd3-4b28-a743-68cf631e534a",
"revision": "1",
"createdDate": "2023-12-03T21:23:33.861Z",
"updatedDate": "2023-12-03T21:23:33.861Z",
"name": "Medium"
},
{
"id": "1c1ca051-b460-4064-b7a2-5f9df47f2d3c",
"revision": "1",
"createdDate": "2023-12-03T21:23:33.861Z",
"updatedDate": "2023-12-03T21:23:33.861Z",
"name": "Large"
}
],
"pagingMetadata": {
"count": 3,
"cursors": {},
"hasNext": false
}
}
This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Note: The Item Variants API only works with the Wix Restaurants Menus (New) app. Make sure you have installed this app from the Wix App Market.
Creates an item variant.
To create multiple item variants at once, use Bulk Create Variants.
You can only call this method when authenticated as a Wix app or Wix user identity.
Item variant info.
Item variant.
curl -X POST https://www.wixapis.com/restaurants/item-variants/v1/restaurants-menus-item-variant \
-H 'Authorization: <AUTH>' \
--data-binary '{
"variant": {
"name": "Small"
}'
{
"variant": {
"id": "8046df3c-7575-4098-a5ab-c91ad8f33c47",
"revision": 1,
"createdDate": "2019-10-30T17:22:10.299Z",
"updatedDate": "2019-10-30T17:22:10.299Z",
"name": "Small"
}
}
This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Note: The Item Variants API only works with the Wix Restaurants Menus (New) app. Make sure you have installed this app from the Wix App Market.
Retrieves an item variant by ID.
ID of the item variant to retrieve.
Item variant.
curl -X GET https://www.wixapis.com/restaurants/item-variants/v1/variants/02042f01-58ab-441c-b5db-55f51c855a62
-H 'Authorization: <AUTH>'
{
"variant": {
"id": "02042f01-58ab-441c-b5db-55f51c855a62",
"revision": "1",
"createdDate": "2023-12-03T21:23:33.861Z",
"updatedDate": "2023-12-03T21:23:33.861Z",
"name": "Small"
}
}
This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Note: The Item Variants API only works with the Wix Restaurants Menus (New) app. Make sure you have installed this app from the Wix App Market.
Permanently deletes an item variant.
You can only call this method when authenticated as a Wix app or Wix user identity.
Item variant ID.
curl -X DELETE https://www.wixapis.com/restaurants/item-variants/v1/variants/cbbf4358-292c-4e9e-a820-7e75b4551120 \
-H 'Authorization: <AUTH>'
{}
This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Note: The Item Variants API only works with the Wix Restaurants Menus (New) app. Make sure you have installed this app from the Wix App Market.
Updates an item variant.
To update multiple item variants at once, use Bulk Update Variants.
Each time an item variant is updated, its revision increments by 1. The existing revision must be included when updating the variant. This ensures you're working with the latest variant information, and it prevents unintended overwrites.
You can only call this method when authenticated as a Wix app or Wix user identity.
Item variant ID.
Item variant to update.
Updated item variant.
curl -X PATCH https://www.wixapis.com/restaurants/item-variants/v1/variants/02042f01-58ab-441c-b5db-55f51c855a11?variantId=02042f01-58ab-441c-b5db-55f51c855a11 \
-H 'Authorization: <AUTH>' \
--data-binary '{
"variant": {
"id": "02042f01-58ab-441c-b5db-55f51c855a11",
"revision": "1",
"name": "Medium"
},
"mask": {
"paths": [
"name"
]
}
}'
{
"variant": {
"id": "02042f01-58ab-441c-b5db-55f51c855a11",
"revision": "2",
"createdDate": "2023-12-04T08:12:01.896Z",
"updatedDate": "2023-12-04T08:38:47.940Z",
"name": "Medium"
}
}
This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Note: The Item Variants API only works with the Wix Restaurants Menus (New) app. Make sure you have installed this app from the Wix App Market.
Creates multiple item variants.
You can only call this method when authenticated as a Wix app or Wix user identity.
Item variants details.
Whether to receive the created item variants in the response.
Information about the created item variants.
Metadata for the API call.
curl -X POST https://www.wixapis.com/restaurants/item-variants/v1/bulk/variants/create \
-H 'Authorization: <AUTH>'
--data-binary '{
"variants": [
{
"name": "Small"
},
{
"name": "Medium"
},
{
"name": "Large"
}
],
"returnEntity": false
}'
{
"results": [
{
"itemMetadata": {
"id": "02042f01-58ab-441c-33db-55221c855c11",
"originalIndex": 0,
"success": true
}
},
{
"itemMetadata": {
"id": "02022fe1-58ab-ee1c-33db-45521c855e11",
"originalIndex": 1,
"success": true
}
}
],
"bulkActionMetadata": {
"totalSuccesses": 3,
"totalFailures": 0,
"undetailedFailures": 0
}
}
This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Note: The Item Variants API only works with the Wix Restaurants Menus (New) app. Make sure you have installed this app from the Wix App Market.
Updates multiple item variants.
Each time an item variant is updated, its revision increments by 1. The existing revision must be included when updating variant. This ensures you're working with the latest item information, and it prevents unintended overwrites.
Up to 100 item variants can be returned per request.
You can only call this method when authenticated as a Wix app or Wix user identity.
Item variants to be updated.
Whether to receive the updated item variants in the response.
Information about the updated item variants.
Metadata for the API call.
This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Note: The Item Variants API only works with the Wix Restaurants Menus (New) app. Make sure you have installed this app from the Wix App Market.
Retrieves a list of item variants given the provided paging, filtering, and sorting. Up to 100 item variants can be returned per request.
For a detailed list of supported operations, see the Supported Filters and Sorting article. To learn how to query item variants, see API Query Language
Query options.
Retrieved item variants.
Metadata of the paginated results.
curl -X POST https://www.wixapis.com/restaurants/item-variants/v1/variants/query \
-H 'Authorization: <AUTH>'
--data-binary '{
"query": {
"sort": [],
"filter": {
"name": "Small"
}
}
}'
{
"variants": [
{
"id": "02042f01-58ab-441c-b5db-55f51c855a10",
"revision": "1",
"createdDate": "2023-12-04T08:12:10.571Z",
"updatedDate": "2023-12-04T08:12:10.571Z",
"name": "Small"
}
],
"pagingMetadata": {
"count": 1,
"cursors": {},
"hasNext": false
}
}
This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Note: The Item API only works with the Wix Restaurants Menus (New) app. Make sure you have installed this app from the Wix App Market.
Retrieves the number of item variants that match a specified filter.
If a filter isn't passed in the request, the endpoint returns the count of all item variants.
Filter for counting variants.
Counted variants.
There is 1 error with this status code:
See the entire list and learn more about Wix errors.
This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Unique event ID. Allows clients to ignore duplicate webhooks.
Fully qualified domain name of the entity associated with the event. Expected wix.restaurants.menus.v1.item_variant
.
Event name. Expected created
.
ID of the entity associated with the event.
Event timestamp.
Whether the event was triggered as a result of a privacy regulation application (for example, GDPR).
If present, indicates the action that triggered the event.
Event information.
The data payload will include the following as an encoded JWT:
{
"data": {
"eventType": "wix.restaurants.menus.v1.item_variant_created",
"instanceId": "<app-instance-id>",
"data": "<stringified-JSON>",
// The identity field is sent as a stringified JSON
"identity": {
"identityType": "<identityType>", // ANONYMOUS_VISITOR, MEMBER, WIX_USER, APP
"anonymousVisitorId": "<anonymousVisitorId>", // in case of ANONYMOUS_VISITOR
"memberId": "<memberId>", // in case of MEMBER
"wixUserId": "<wixUserId>", // in case of WIX_USER
"appId": "<appId>" // in case of APP
}
}
}
{
"id": "52269077-05f2-4b59-ba4f-36ef8c4c1e11",
"entityFqdn": "wix.restaurants.menus.v1.item_variant",
"slug": "created",
"entityId": "8046df3c-7575-4098-a5ab-c91ad8f33c47",
"createdEvent": {
"entity": {
"id": "8046df3c-7575-4098-a5ab-c91ad8f33c47",
"revision": 1,
"createdDate": "2019-10-30T17:22:10.299Z",
"updatedDate": "2019-10-30T17:22:10.299Z",
"name": "Small"
}
},
"eventTime": "2020-10-18T13:40:58.304800Z",
"triggeredByAnonymizeRequest": false
}
This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Unique event ID. Allows clients to ignore duplicate webhooks.
Fully qualified domain name of the entity associated with the event. Expected wix.restaurants.menus.v1.item_variant
.
Event name. Expected deleted
.
ID of the entity associated with the event.
Event timestamp.
Whether the event was triggered as a result of a privacy regulation application (for example, GDPR).
If present, indicates the action that triggered the event.
Event information.
The data payload will include the following as an encoded JWT:
{
"data": {
"eventType": "wix.restaurants.menus.v1.item_variant_deleted",
"instanceId": "<app-instance-id>",
"data": "<stringified-JSON>",
// The identity field is sent as a stringified JSON
"identity": {
"identityType": "<identityType>", // ANONYMOUS_VISITOR, MEMBER, WIX_USER, APP
"anonymousVisitorId": "<anonymousVisitorId>", // in case of ANONYMOUS_VISITOR
"memberId": "<memberId>", // in case of MEMBER
"wixUserId": "<wixUserId>", // in case of WIX_USER
"appId": "<appId>" // in case of APP
}
}
}
This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Unique event ID. Allows clients to ignore duplicate webhooks.
Fully qualified domain name of the entity associated with the event. Expected wix.restaurants.menus.v1.item_variant
.
Event name. Expected updated
.
ID of the entity associated with the event.
Event timestamp.
Whether the event was triggered as a result of a privacy regulation application (for example, GDPR).
If present, indicates the action that triggered the event.
Event information.
The data payload will include the following as an encoded JWT:
{
"data": {
"eventType": "wix.restaurants.menus.v1.item_variant_updated",
"instanceId": "<app-instance-id>",
"data": "<stringified-JSON>",
// The identity field is sent as a stringified JSON
"identity": {
"identityType": "<identityType>", // ANONYMOUS_VISITOR, MEMBER, WIX_USER, APP
"anonymousVisitorId": "<anonymousVisitorId>", // in case of ANONYMOUS_VISITOR
"memberId": "<memberId>", // in case of MEMBER
"wixUserId": "<wixUserId>", // in case of WIX_USER
"appId": "<appId>" // in case of APP
}
}
}
{
"id": "52269077-05f2-4b59-ba4f-36ef8c4c1e11",
"entityFqdn": "wix.restaurants.menus.v1.item_variant",
"slug": "updated",
"entityId": "8046df3c-7575-4098-a5ab-c91ad8f33c47",
"updatedEvent": {
"currentEntity": {
"id": "8046df3c-7575-4098-a5ab-c91ad8f33c47",
"revision": "2",
"createdDate": "2024-01-14T12:41:35.833Z",
"updatedDate": "2024-01-14T12:42:53.067Z",
"name": "Medium"
}
},
"eventTime": "2020-10-18T13:40:58.304800Z",
"triggeredByAnonymizeRequest": false,
"entityEventSequence": "2"
}