Setup

@wix/stores

To use the Products API, install the @wix/stores package using npm or Yarn:

Copy

or

Copy

Then import { products } from @wix/stores:

Copy
Did this help?

addProductMedia( )


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.

Authentication
  • When developing websites or building an app with Blocks, this method may require elevated permissions, depending on the identity of the user calling it and the calling user’s permissions.
  • When building apps without Blocks or for headless projects, you can only call this method directly when authenticated as a Wix app or Wix user identity. When authenticated as a different identity, you can call this method using elevation.
  • Elevation permits users to call methods they typically cannot access. Therefore, you should only use it intentionally and securely.
Permissions
Manage Stores - all permissions
Manage Products
Learn more about app permissions.
Method Declaration
Copy
Method Parameters
_idstringRequired

Product ID.


mediaArray<MediaDataForWrite>Required

Sources of media items already uploaded to the Wix site.

JavaScript
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?

addProductMediaToChoices( )


Developer Preview

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.

Authentication
  • When developing websites or building an app with Blocks, this method may require elevated permissions, depending on the identity of the user calling it and the calling user’s permissions.
  • When building apps without Blocks or for headless projects, you can only call this method directly when authenticated as a Wix app or Wix user identity. When authenticated as a different identity, you can call this method using elevation.
  • Elevation permits users to call methods they typically cannot access. Therefore, you should only use it intentionally and securely.
Permissions
Manage Stores - all permissions
Manage Products
Learn more about app permissions.
Method Declaration
Copy
Method Parameters
_idstringRequired

Product ID.


mediaArray<MediaAssignmentToChoice>Required

Product media items and the choices to add the media to.

JavaScript
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?

addProductsToCollection( )


Adds products to a specified collection.

Authentication
  • When developing websites or building an app with Blocks, this method may require elevated permissions, depending on the identity of the user calling it and the calling user’s permissions.
  • When building apps without Blocks or for headless projects, you can only call this method directly when authenticated as a Wix app or Wix user identity. When authenticated as a different identity, you can call this method using elevation.
  • Elevation permits users to call methods they typically cannot access. Therefore, you should only use it intentionally and securely.
Permissions
Manage Stores - all permissions
Manage Products
Learn more about app permissions.
Method Declaration
Copy
Method Parameters
_idstringRequired

Collection ID.


productIdsArray<string>Required

IDs of the products to add to the collection, separated by commas.

JavaScript
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?

bulkAdjustProductProperty( )


Developer Preview

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.

Authentication
  • When developing websites or building an app with Blocks, this method may require elevated permissions, depending on the identity of the user calling it and the calling user’s permissions.
  • When building apps without Blocks or for headless projects, you can only call this method directly when authenticated as a Wix app or Wix user identity. When authenticated as a different identity, you can call this method using elevation.
  • Elevation permits users to call methods they typically cannot access. Therefore, you should only use it intentionally and securely.
Permissions
Manage Stores - all permissions
Manage Products
Learn more about app permissions.
Method Declaration
Copy
Method Parameters
adjustAdjustValueRequired

Numerical property to adjust.


idsArray<string>Required

Product IDs.

Returns
Return Type:Promise<BulkAdjustProductPropertiesResponse>
JavaScript
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?

bulkUpdateProductsProperty( )


Developer Preview

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.

Authentication
  • When developing websites or building an app with Blocks, this method may require elevated permissions, depending on the identity of the user calling it and the calling user’s permissions.
  • When building apps without Blocks or for headless projects, you can only call this method directly when authenticated as a Wix app or Wix user identity. When authenticated as a different identity, you can call this method using elevation.
  • Elevation permits users to call methods they typically cannot access. Therefore, you should only use it intentionally and securely.
Permissions
Manage Stores - all permissions
Manage Products
Learn more about app permissions.
Method Declaration
Copy
Method Parameters
idsArray<string>Required

Product IDs.


setSetValueRequired

Field to update.

Returns
Return Type:Promise<BulkUpdateProductsResponse>
JavaScript
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?

createCollection( )


Creates a new collection.

Authentication
  • When developing websites or building an app with Blocks, this method may require elevated permissions, depending on the identity of the user calling it and the calling user’s permissions.
  • When building apps without Blocks or for headless projects, you can only call this method directly when authenticated as a Wix app or Wix user identity. When authenticated as a different identity, you can call this method using elevation.
  • Elevation permits users to call methods they typically cannot access. Therefore, you should only use it intentionally and securely.
Permissions
Manage Stores - all permissions
Manage Products
Learn more about app permissions.
Method Declaration
Copy
Method Parameters
collectionCollectionRequired

Collection info.

Returns
Return Type:Promise<CreateCollectionResponse>
JavaScript
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?

createProduct( )


Creates a new product.

Authentication
  • When developing websites or building an app with Blocks, this method may require elevated permissions, depending on the identity of the user calling it and the calling user’s permissions.
  • When building apps without Blocks or for headless projects, you can only call this method directly when authenticated as a Wix app or Wix user identity. When authenticated as a different identity, you can call this method using elevation.
  • Elevation permits users to call methods they typically cannot access. Therefore, you should only use it intentionally and securely.
Permissions
Manage Stores - all permissions
Manage Products
Learn more about app permissions.
Method Declaration
Copy
Method Parameters
productProductRequired

Product information.

Returns
Return Type:Promise<CreateProductResponse>
JavaScript
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?

deleteCollection( )


Developer Preview

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.

Authentication
  • When developing websites or building an app with Blocks, this method may require elevated permissions, depending on the identity of the user calling it and the calling user’s permissions.
  • When building apps without Blocks or for headless projects, you can only call this method directly when authenticated as a Wix app or Wix user identity. When authenticated as a different identity, you can call this method using elevation.
  • Elevation permits users to call methods they typically cannot access. Therefore, you should only use it intentionally and securely.
Permissions
Manage Stores - all permissions
Manage Products
Learn more about app permissions.
Method Declaration
Copy
Method Parameters
_idstringRequired

ID of the collection to delete.

JavaScript
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?

deleteProduct( )


Deletes a product.

Authentication
  • When developing websites or building an app with Blocks, this method may require elevated permissions, depending on the identity of the user calling it and the calling user’s permissions.
  • When building apps without Blocks or for headless projects, you can only call this method directly when authenticated as a Wix app or Wix user identity. When authenticated as a different identity, you can call this method using elevation.
  • Elevation permits users to call methods they typically cannot access. Therefore, you should only use it intentionally and securely.
Permissions
Manage Stores - all permissions
Manage Products
Learn more about app permissions.
Method Declaration
Copy
Method Parameters
_idstringRequired

ID of the product to delete.

JavaScript
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?

deleteProductOptions( )


Developer Preview

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.

Authentication
  • When developing websites or building an app with Blocks, this method may require elevated permissions, depending on the identity of the user calling it and the calling user’s permissions.
  • When building apps without Blocks or for headless projects, you can only call this method directly when authenticated as a Wix app or Wix user identity. When authenticated as a different identity, you can call this method using elevation.
  • Elevation permits users to call methods they typically cannot access. Therefore, you should only use it intentionally and securely.
Permissions
Manage Stores - all permissions
Manage Products
Learn more about app permissions.
Method Declaration
Copy
Method Parameters
_idstringRequired

ID of the product with options to delete.

JavaScript
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?

getCollectionBySlug( )


Retrieves a collection with the provided slug.

Permissions
Manage Stores - all permissions
Read Stores - all read permissions
Manage Orders
Manage Products
Read Products
Manage Restaurants - all permissions
Learn more about app permissions.
Method Declaration
Copy
Method Parameters
slugstringRequired

Slug of the collection to retrieve.

Returns
Return Type:Promise<GetCollectionBySlugResponse>
JavaScript
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?

getProduct( )


Retrieves a product with the provided ID.

Permissions
Manage Stores - all permissions
Read Stores - all read permissions
Manage Orders
Manage Products
Read Products
Manage Restaurants - all permissions
Learn more about app permissions.
Method Declaration
Copy
Method Parameters
_idstringRequired

Requested product ID.


optionsGetProductOptions
Returns
Return Type:Promise<GetProductResponse>
JavaScript
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?

getProductOptionsAvailability( )


Gets the availability of relevant product variants based on the product ID and selections provided. See Use Cases for an example.

Permissions
Manage Stores - all permissions
Read Stores - all read permissions
Manage Orders
Manage Products
Read Products
Manage Restaurants - all permissions
Learn more about app permissions.
Method Declaration
Copy
Method Parameters
_idstringRequired

Requested product ID.


optionsRecord<string, string>Required

Array containing the selected options. For example, ["color": "Blue", "size": "Large"].

Returns
Return Type:Promise<ProductOptionsAvailabilityResponse>
JavaScript
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?

getStoreVariant( )


Retrieves a store variant with the provided ID.

Permissions
Manage Stores - all permissions
Read Stores - all read permissions
Manage Orders
Manage Products
Read Products
Manage Restaurants - all permissions
Learn more about app permissions.
Method Declaration
Copy
Method Parameters
_idstringRequired

Store variant ID. Comprised of the productId and the variantId, separated by a hyphen. For example, {productId}-{variantId}.

Returns
Return Type:Promise<GetStoreVariantResponse>
JavaScript
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?

queryProductVariants( )


Retrieves product variants, based on either choices (option-choice key-value pairs) or variant IDs. See Stores Pagination for more information.

Permissions
Manage Stores - all permissions
Read Stores - all read permissions
Manage Orders
Manage Products
Read Products
Manage Restaurants - all permissions
Learn more about app permissions.
Method Declaration
Copy
Method Parameters
_idstringRequired

Requested product ID.


optionsQueryProductVariantsOptions
Returns
Return Type:Promise<QueryProductVariantsResponse>
JavaScript
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?

queryProducts( )


Permissions
Manage Stores - all permissions
Read Stores - all read permissions
Manage Orders
Manage Products
Read Products
Manage Restaurants - all permissions
Learn more about app permissions.
Method Declaration
Copy
Request
This method does not take any parameters
Returns
JavaScript
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?

queryStoreVariants( )


Retrieves up to 100 store variants, given the provided paging, filtering, and sorting.

Permissions
Manage Stores - all permissions
Read Stores - all read permissions
Manage Orders
Manage Products
Read Products
Manage Restaurants - all permissions
Learn more about app permissions.
Method Declaration
Copy
Method Parameters
queryPlatformQueryRequired

Query options.

Returns
Return Type:Promise<QueryStoreVariantsResponse>
JavaScript
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?