To use the Products API, install the @wix/stores
package using npm or Yarn:
or
Then import { products }
from @wix/stores
:
Adds media items to a specified product, either via URL or existing media ID.
NOTE: The URL is not validated and no event is triggered to indicate if the media was added successfully.
Product ID.
Sources of media items already uploaded to the Wix site.
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.
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.
Product ID.
Product media items and the choices to add the media to.
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.
Adds products to a specified collection.
Collection ID.
IDs of the products to add to the collection, separated by commas.
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.
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.
Numerical property to adjust.
Product IDs.
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.
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.
Product IDs.
Field to update.
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.
Creates a new collection.
Collection info.
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.
Creates a new product.
Product information.
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.
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.
ID of the collection to delete.
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.
Deletes a product.
ID of the product to delete.
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.
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.
ID of the product with options to delete.
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.
Retrieves a collection with the provided slug.
Slug of the collection to retrieve.
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.
Retrieves a product with the provided ID.
Requested product ID.
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.
Gets the availability of relevant product variants based on the product ID and selections provided. See Use Cases for an example.
Requested product ID.
Array containing the selected options. For example, ["color": "Blue", "size": "Large"]
.
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.
Retrieves a store variant with the provided ID.
Store variant ID. Comprised of the productId
and the variantId
, separated by a hyphen. For example, {productId}-{variantId}
.
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.
Retrieves product variants, based on either choices (option-choice key-value pairs) or variant IDs. See Stores Pagination for more information.
Requested product ID.
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.
Returns a list of up to 100 products, given the provided paging, sorting and filtering.
PROPERTY | SUPPORTED FILTERS & SORTING |
---|---|
_id | eq() ,ne() ,exists() ,in() ,hasSome() ,startsWith() ,ascending() ,descending() |
name | eq() ,ne() ,exists() ,in() ,hasSome() ,startsWith() ,ascending() ,descending() |
slug | eq() ,ne() ,exists() ,in() ,hasSome() ,startsWith() ,ascending() ,descending() |
productType | eq() ,ne() ,exists() ,in() ,hasSome() ,ascending() ,descending() |
description | eq() ,ne() ,exists() ,in() ,hasSome() ,startsWith() |
sku | eq() ,ne() ,exists() ,in() ,hasSome() ,startsWith() ,ascending() ,descending() |
price | eq() ,ne() ,exists() ,in() ,hasSome() ,ascending() ,descending() |
priceData.price | eq() ,ne() ,exists() ,in() ,hasSome() ,lt() ,le() ,gt() ,ge() ,ascending() ,descending() |
numericId | eq() ,ne() ,exists() ,in() ,hasSome() ,lt() ,le() ,gt() ,ge() ,ascending() ,descending() |
collectionIds | eq() ,ne() ,exists() ,in() ,hasSome() ,hasAll() |
lastUpdated | eq() ,ne() ,exists() ,in() ,hasSome() ,lt() ,le() ,gt() ,ge() ,ascending() ,descending() |
_createdDate | eq() ,ne() ,exists() ,in() ,hasSome() ,lt() ,le() ,gt() ,ge() |
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.
Retrieves up to 100 store variants, given the provided paging, filtering, and sorting.
Query options.
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.