Catalog Service
About This API
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.
Terminology
- 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
Error handling
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 |
Filter and sort
Query Language
Endpoints that allow querying follow these format guidelines.
Query Products
Fields That Allow Filtering
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
Examples
Query products where price = 10
1curl '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
1curl '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
1curl '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
1curl '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
1curl '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:
1curl '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:
1curl '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.
Query Collections
Fields That Allow Filtering
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
Examples
Query collections where name = my collection
1curl 'https://www.wixapis.com/stores/v1/collections/query' --data-binary '{"query":{"filter":"{\"name\": \"my collection\"}}"}}' -H 'Content-Type: application/json' -H 'Authorization: XXX'
Use Cases
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
1curl 'https://www.wixapis.com/stores/v1/products/<product id>' -H 'Content-Type: application/json' -H 'Authorization: XXX'
1{2 ...3 "productOptions": [4 {5 "optionType": "drop_down",6 "name": "Size",7 "choices": [8 {9 "value": "S",10 "description": "S",11 "inStock": true,12 "visible": true13 },14 {15 "value": "M",16 "description": "M",17 "inStock": true,18 "visible": true19 },20 {21 "value": "L",22 "description": "L",23 "inStock": true,24 "visible": true25 }26 ]27 },28 {29 "optionType": "color",30 "name": "Color",31 "choices": [32 {33 "value": "#FF0000",34 "description": "Red",35 "inStock": true,36 "visible": true37 },38 {39 "value": "#00FF00",40 "description": "Green",41 "inStock": true,42 "visible": true43 },44 {45 "value": "#00000FF",46 "description": "Blue",47 "inStock": true,48 "visible": true49 }50 ]51 }52 ]53}
**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
1curl 'https://www.wixapis.com/stores/v1/products/<product id>/productOptionsAvailability' --data-binary '{"options": {"Size": "S"}}' -H 'Content-Type: application/json' -H 'Authorization: XXX'
1{2 "productOptions": [3 {4 "optionType": "drop_down",5 "name": "Size",6 "choices": [7 {8 "value": "S",9 "description": "S",10 "inStock": true,11 "visible": true12 },13 {14 "value": "M",15 "description": "M",16 "inStock": true,17 "visible": true18 },19 {20 "value": "L",21 "description": "L",22 "inStock": true,23 "visible": true24 }25 ]26 },27 {28 "optionType": "color",29 "name": "Color",30 "choices": [31 {32 "value": "#FF0000",33 "description": "Red",34 "inStock": false,35 "visible": true36 },37 {38 "value": "#00FF00",39 "description": "Green",40 "inStock": true,41 "visible": true42 },43 {44 "value": "#00000FF",45 "description": "Blue",46 "inStock": true,47 "visible": true48 }49 ]50 }51 ],52 "availableForPurchase": false53}
**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
1curl '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'
1{2 "selectedVariant": {3 "price": {4 "currency": "USD",5 "price": 81,6 "discountedPrice": 81,7 "formatted": {8 "price": "$81.00",9 "discountedPrice": "$81.00"10 }11 },12 "weight": 0,13 "sku": "364215376135191",14 "inStock": true,15 "visible": true16 },17 "productOptions": [18 {19 "optionType": "drop_down",20 "name": "Size",21 "choices": [22 {23 "value": "S",24 "description": "S",25 "inStock": true,26 "visible": true27 },28 {29 "value": "M",30 "description": "M",31 "inStock": true,32 "visible": true33 },34 {35 "value": "L",36 "description": "L",37 "inStock": true,38 "visible": true39 }40 ]41 },42 {43 "optionType": "color",44 "name": "Color",45 "choices": [46 {47 "value": "#FF0000",48 "description": "Red",49 "inStock": false,50 "visible": true51 },52 {53 "value": "#00FF00",54 "description": "Green",55 "inStock": true,56 "visible": true57 },58 {59 "value": "#00000FF",60 "description": "Blue",61 "inStock": true,62 "visible": true63 }64 ]65 }66 ],67 "availableForPurchase": true68}
eCommerce Integration
Adding products from your Wix Stores catalog to an eCommerce cart, checkout, or order, must follow the structure of the catalogReference
object.
Pass the catalogReference
object as part of the lineItems
array to eCommerce functions such as:
The catalogReference
object includes the following fields:
catalogItemId
- When passing Wix Stores products, this is theproductId
.appId
- The Wix Stores app ID. When using products from the Stores catalog, this must always be"215238eb-22a5-4c36-9e7b-e7c08025e04e"
.options
- This optional field can hold different key:value pairs, depending on variant management and whether the product/variant has custom text fields.
The examples below detail about the 2 main uses of the catalogReference
object when passing Wix Stores products.
Managed Variants
When a product's variants are managed (product.manageVariants: true
), the catalogReference.options
should hold the variant's variantId
. In the following example, the variant also has customTextFields
:
1{2 "catalogReference": {3 "catalogItemId": "5376f9ec-b92e-efa9-e4a1-f4f480aa0d3a",4 "appId": "215238eb-22a5-4c36-9e7b-e7c08025e04e",5 "options": {6 "variantId": "00000000-0000-0020-0005-ad9cdc10d3b8",7 "customTextFields": {8 "What would you like written on the custom label?": "Hope you enjoy the coffee! :)"9 }10 }11 }12}
Non-Managed Variants
When a product's variants are not managed (product.manageVariants: false
), the options
object should hold the variant's options and choices:
1{2 "catalogReference": {3 "catalogItemId": "4d93fb7e-e612-612f-5c27-81b35b503ad7",4 "appId": "215238eb-22a5-4c36-9e7b-e7c08025e04e",5 "options": {6 "options": {7 "Size": "Medium",8 "Color": "Red"9 }10 }11 }12}
Creates a new product.
Permission Scopes
For app development, you must have one of the following permission scopes:Updates specified fields in a product.
Permission Scopes
For app development, you must have one of the following permission scopes:Deletes a product.
Permission Scopes
For app development, you must have one of the following permission scopes:Updates variants of a specified product.
Permission Scopes
For app development, you must have one of the following permission scopes: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:Adds products to a specified collection.
Permission Scopes
For app development, you must have one of the following permission scopes:This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Deletes products from a specified collection.
Permission Scopes
For app development, you must have one of the following permission scopes: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: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:This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
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:This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
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:This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
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:Deletes a product's brand.
Permission Scopes
For app development, you must have one of the following permission scopes:Creates a new collection.
Permission Scopes
For app development, you must have one of the following permission scopes:This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
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:This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Deletes a collection.
Permission Scopes
For app development, you must have one of the following permission scopes:Deletes a product's ribbon.
Permission Scopes
For app development, you must have one of the following permission scopes:This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
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:This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
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: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:Retrieves a product with the provided ID.
Permission Scopes
For app development, you must have one of the following permission scopes: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:This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
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: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:This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
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:This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
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.
Permission Scopes
For app development, you must have one of the following permission scopes:Triggered when a product is changed.
Permission Scopes
For app development, you must have one of the following permission scopes:Triggered when a product is deleted.
Permission Scopes
For app development, you must have one of the following permission scopes:Triggered when a collection is created.
Permission Scopes
For app development, you must have one of the following permission scopes:Triggered when a collection is changed.
Permission Scopes
For app development, you must have one of the following permission scopes:Triggered when a collection is deleted.
Permission Scopes
For app development, you must have one of the following permission scopes:Triggered when a product variant is changed.