Wix Stores creates a catalog of store owners’ items for purchase and allows store owners to create smaller collections of products by type or theme. A catalog organizes the store’s products and collections and facilitates inventory management. With the Wix Stores Catalog API you can query individual products, collections or the entire catalog, as well as create products and add their media.
Querying the products and collections in the catalog enables you to coordinate a store’s inventory across other sales platforms (e.g., Facebook marketplace), or inventory management tools (e.g., NetSuite, TradeGecko), among other uses.
- The catalog is a complete list of all the store’s products.
- Collections are themed groupings of items for purchase that a store owner can create to organize their products (e.g., Spring 2019, Running shoes, etc.). Products can belong to multiple collections.
- Options are property types that customers can select within the specific product - e.g., color and size.
- Choices are the available selections within each option - e.g., red and green choices under the Color option.
- Variants are combinations of different product options and choices - e.g., a red shirt in size large.
A variant can override the following values from the parent product:
- Price
- SKU
- Weight
- Inventory
Status code | Description |
---|---|
200 | Success |
400 | Invalid input (e.g., when the filter format is not valid or when providing invalid options when calling productOptionsAvailability) |
401 | Invalid authorization token, or Wix stores is not installed |
404 | Requested product or collection is not found |
500 | Unexpected error |
Endpoints that allow querying follow these format guidelines.
Field | Operators | Sorting Allowed |
---|---|---|
name | $eq,$ne,$hasSome,$contains,$startsWith | Allowed |
description | $eq,$ne,$hasSome,$contains,$startsWith | |
sku | $eq,$ne,$hasSome,$contains,$startsWith | Allowed |
id | $eq,$ne,$hasSome | Allowed |
price | $eq,$ne,$hasSome,$lt,$lte,$gt,$gte | Allowed |
numericId | $eq,$ne,$hasSome,$lt,$lte,$gt,$gte | Allowed |
productType | $eq,$ne,$hasSome | Allowed |
slug | $eq,$ne,$hasSome,$contains,$startsWith | Allowed |
collections.id | $eq,$ne,$hasSome,$hasAll | |
options.<option name> | $eq,$ne,$hasSome,$hasAll | |
inventoryStatus | $eq,$ne,$hasSome | |
lastUpdated | $eq,$ne,$hasSome,$lt,$lte,$gt,$gte | Allowed |
createdDate | $eq,$ne,$hasSome,$lt,$lte,$gt,$gte | Allowed |
** Note that "HasSome" is same as the operator "IN" in SQL
Query products where price = 10
Copy Code
curl 'https://www.wixapis.com/stores/v1/products/query' --data-binary '{"query":{"filter":"{\"price\": \"10\"}"}}' -H 'Content-Type: application/json' -H 'Authorization: XXX'
Query products, order by price descending
Copy Code
curl 'https://www.wixapis.com/stores/v1/products/query' --data-binary '{"query":{"sort":"[{\"price\": \"desc\"}]"}}' -H 'Content-Type: application/json' -H 'Authorization: XXX'
Getting all products for a given collection
Copy Code
curl 'https://www.wixapis.com/stores/v1/products/query' --data-binary '{"query":{"filter":"{\"collections.id\": { \"$hasSome\": [\"your_collection_id_here\"]} }"}}' -H 'Content-Type: application/json' -H 'Authorization: XXX'
Getting multiple products by IDs
Copy Code
curl 'https://www.wixapis.com/stores/v1/products/query' --data-binary '{"query":{"filter":"{\"id\": {\"$hasSome\": [\"YOUR_PRODUCT_ID_HERE\", \"YOUR_PRODUCT_ID_HERE\"]}}"}}' -H 'Content-Type: application/json' -H 'Authorization: XXX'
Getting all products with a specific choice
Copy Code
curl 'https://www.wixapis.com/stores/v1/products/query' --data-binary '{"query":{"filter":"{\"productOptions.size\": \"L\"}}"}}' -H 'Content-Type: application/json' -H 'Authorization: XXX'
Getting all products in a store
- Get the first page:
Copy Code
curl 'https://www.wixapis.com/stores/v1/products/query' --data-binary '{"query":{"sort":"[{\"numericId\": \"asc\"}]"}}' -H 'Content-Type: application/json' -H 'Authorization: XXX'
- Take the numericId of the last returned item and run the following query:
Copy Code
curl 'https://www.wixapis.com/stores/v1/products/query' --data-binary '{"query":{"sort":"[{\"numericId\": \"asc\"}]","filter":"{\"numericId\": {\"$gt\": LAST_NUMERIC_ID}}"}}' -H 'Content-Type: application/json' -H 'Authorization: XXX'
- Continue until no more records are returned.
Field | Operators | Sorting Allowed |
---|---|---|
name | $eq,$ne,$hasSome,$contains,$startsWith | Allowed |
id | $eq,$ne,$hasSome,$contains,$startsWith | Allowed |
** Note that "HasSome" is same as the operator "IN" in SQL
Query collections where name = my collection
Copy Code
curl 'https://www.wixapis.com/stores/v1/collections/query' --data-binary '{"query":{"filter":"{\"name\": \"my collection\"}}"}}' -H 'Content-Type: application/json' -H 'Authorization: XXX'
In this example we will query a product variant:
- The product is a shirt
- The shirt has 2 options - size and color
- The size option has 3 choices - S/M/L
- The color option has 3 choices - Red/Green/Blue
- The product variant S+Red is out of stock
The product's options field
Copy Code
curl 'https://www.wixapis.com/stores/v1/products/<product id>' -H 'Content-Type: application/json' -H 'Authorization: XXX'
Copy Code
{..."productOptions": [{"optionType": "drop_down","name": "Size","choices": [{"value": "S","description": "S","inStock": true,"visible": true},{"value": "M","description": "M","inStock": true,"visible": true},{"value": "L","description": "L","inStock": true,"visible": true}]},{"optionType": "color","name": "Color","choices": [{"value": "#FF0000","description": "Red","inStock": true,"visible": true},{"value": "#00FF00","description": "Green","inStock": true,"visible": true},{"value": "#00000FF","description": "Blue","inStock": true,"visible": true}]}]}
**Now let's query the availability of S **
Notice in the response that:
- Red is out of stock, because S+Red is out of stock
availableForPurchase
is false, because both size and color must be given for this product
Copy Code
curl 'https://www.wixapis.com/stores/v1/products/<product id>/productOptionsAvailability' --data-binary '{"options": {"Size": "S"}}' -H 'Content-Type: application/json' -H 'Authorization: XXX'
Copy Code
{"productOptions": [{"optionType": "drop_down","name": "Size","choices": [{"value": "S","description": "S","inStock": true,"visible": true},{"value": "M","description": "M","inStock": true,"visible": true},{"value": "L","description": "L","inStock": true,"visible": true}]},{"optionType": "color","name": "Color","choices": [{"value": "#FF0000","description": "Red","inStock": false,"visible": true},{"value": "#00FF00","description": "Green","inStock": true,"visible": true},{"value": "#00000FF","description": "Blue","inStock": true,"visible": true}]}],"availableForPurchase": false}
**Now let's query the availability of S+Green **
Notice in the response that:
- We get the selected variant, with proper values for price, weight, SKU and inventory
availableForPurchase
is true
Copy Code
curl 'https://www.wixapis.com/stores/v1/products/<product id>/productOptionsAvailability' --data-binary '{"options": {"Size": "S","Color": "Green"}}' -H 'Content-Type: application/json' -H 'Authorization: XXX'
Copy Code
{"selectedVariant": {"price": {"currency": "USD","price": 81,"discountedPrice": 81,"formatted": {"price": "$81.00","discountedPrice": "$81.00"}},"weight": 0,"sku": "364215376135191","inStock": true,"visible": true},"productOptions": [{"optionType": "drop_down","name": "Size","choices": [{"value": "S","description": "S","inStock": true,"visible": true},{"value": "M","description": "M","inStock": true,"visible": true},{"value": "L","description": "L","inStock": true,"visible": true}]},{"optionType": "color","name": "Color","choices": [{"value": "#FF0000","description": "Red","inStock": false,"visible": true},{"value": "#00FF00","description": "Green","inStock": true,"visible": true},{"value": "#00000FF","description": "Blue","inStock": true,"visible": true}]}],"availableForPurchase": true}
Product details passed from the Stores catalog to an eCommerce cart, checkout, or order, must follow a certain structure in the form of the catalogReference
object.
catalogItemId
- in the context of Wix Stores products, this is theproductId
appId
- the Stores app ID. When using products from the Stores catalog, this must always be"215238eb-22a5-4c36-9e7b-e7c08025e04e"
options
- this field can hold different key-value pairs, depending on variant management and whether the product/variant has custom text fields.
Refer to the following catalogReference
object examples for more detail:
When a product's variants are managed (product.manageVariants: true
), the options
object should hold the variant's variantId
. In the following example, the variant also has customTextFields
:
Copy Code
{"catalogReference": {"catalogItemId": "5376f9ec-b92e-efa9-e4a1-f4f480aa0d3a","appId": "215238eb-22a5-4c36-9e7b-e7c08025e04e","options": {"variantId": "00000000-0000-0020-0005-ad9cdc10d3b8","customTextFields": {"What would you like written on the custom label?": "Hope you enjoy the coffee! :)"}}}}
When a product's variants are not managed (product.manageVariants: false
), the options
object should hold the variant's options and choices
Copy Code
{"catalogReference": {"catalogItemId": "4d93fb7e-e612-612f-5c27-81b35b503ad7","appId": "215238eb-22a5-4c36-9e7b-e7c08025e04e","options": {"options": {"Size": "Medium","Color": "Red"}}}}
Creates a new product.
Permission Scopes
For app development, you must have one of the following permission scopes:Syntax
Updates specified fields in a product.
Permission Scopes
For app development, you must have one of the following permission scopes:Syntax
Deletes a product.
Permission Scopes
For app development, you must have one of the following permission scopes:Syntax
Updates variants of a specified product.
Permission Scopes
For app development, you must have one of the following permission scopes:Syntax
Resets the data (such as the price and the weight) of all variants for a given product to their default values.
Permission Scopes
For app development, you must have one of the following permission scopes:Syntax
Adds products to a specified collection.
Permission Scopes
For app development, you must have one of the following permission scopes:Syntax
Deletes products from a specified collection.
Permission Scopes
For app development, you must have one of the following permission scopes:Syntax
Adds media items to a specified product, either via URL or existing media ID.
Permission Scopes
For app development, you must have one of the following permission scopes:Syntax
Removes specified media items from a product. Pass an empty array to remove all media items.
Permission Scopes
For app development, you must have one of the following permission scopes:Syntax
Links media items that are already associated with a specific product to a choice within the same product.
Media items can only be set for choices within one option at a time - e.g., if you set media items for some or all of the choices within the Colors option (blue, green, and red), you won't be able to also assign media items to choices within the Size option (S, M, and L).
To remove all existing media items, call the Remove Product Media From Choices endpoint.
Permission Scopes
For app development, you must have one of the following permission scopes:Syntax
Removes media items from all or some of a product's choices. (Media items can only be set for choices within one option at a time - e.g., if you set media items for some or all of the choices within the Colors option (blue, green, and red), you won't be able to also assign media items to choices within the Size option (S, M, and L).)
Permission Scopes
For app development, you must have one of the following permission scopes:Syntax
Delete all options from a specific product. Only available when variant management is disabled.
Permission Scopes
For app development, you must have one of the following permission scopes:Syntax
Deletes a product's brand.
Permission Scopes
For app development, you must have one of the following permission scopes:Syntax
Creates a new collection.
Permission Scopes
For app development, you must have one of the following permission scopes:Syntax
Updates specified properties of a collection. To add products to a collection, call the Add Products to Collection endpoint.
Permission Scopes
For app development, you must have one of the following permission scopes:Syntax
Deletes a collection.
Permission Scopes
For app development, you must have one of the following permission scopes:Syntax
Deletes a product's ribbon.
Permission Scopes
For app development, you must have one of the following permission scopes:Syntax
Updates a specified property for up to 100 products at a time.
Permission Scopes
For app development, you must have one of the following permission scopes:Syntax
Adjusts a specified numerical property for up to 100 products at a time. The property can be increased or decreased either by percentage or amount.
Permission Scopes
For app development, you must have one of the following permission scopes:Syntax
Returns a list of up to 100 products, given the provided paging, sorting and filtering. See Stores Pagination for more information.
Permission Scopes
For app development, you must have one of the following permission scopes:Syntax
Retrieves a product with the provided ID.
Permission Scopes
For app development, you must have one of the following permission scopes:Syntax
Retrieves a list of up to 100 collections, given the provided paging, sorting and filtering. See Stores Pagination for more information.
Permission Scopes
For app development, you must have one of the following permission scopes:Retrieves a collection with the provided ID.
Permission Scopes
For app development, you must have one of the following permission scopes:Retrieves a collection with the provided slug.
Permission Scopes
For app development, you must have one of the following permission scopes:Gets the availability of relevant product variants based on the product ID and selections provided. See Use Cases for an example.
Permission Scopes
For app development, you must have one of the following permission scopes:Syntax
Retrieves product variants, based on either choices (option-choice key-value pairs) or variant IDs. See Stores Pagination for more information.
Permission Scopes
For app development, you must have one of the following permission scopes:Syntax
Retrieves up to 100 store variants, given the provided paging, filtering, and sorting.
Permission Scopes
For app development, you must have one of the following permission scopes:Retrieves a store variant with the provided ID.
Permission Scopes
For app development, you must have one of the following permission scopes:Triggered when a product is created.
Event Body
Triggered when a product is changed.
Event Body
Triggered when a product is deleted.
Event Body
Triggered when a collection is created.
Event Body
Triggered when a collection is changed.
Event Body
Triggered when a collection is deleted.
Event Body
Triggered when a product variant is changed.