> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # BulkAddProductsToStore # Package: suppliersHub # Namespace: MarketplaceProduct # Method link: https://dev.wix.com/docs/api-reference/business-solutions/suppliers-hub/products/bulk-add-products-to-store.md ## Permission Scopes: Read Marketplace: SCOPE.SUPPLIERS_HUB.READ_MARKETPLACE ## Introduction Adds multiple Marketplace products to the caller's Wix store in a single request. Call this method to adopt products from the Marketplace into a Wix Stores catalog for selling. The target store is determined by the calling identity, so there's no need to specify a store ID in the request. Supports partial success. Some products may be added successfully while others fail. Each result includes an `itemMetadata` object indicating success or failure with error details. When handling failures, distinguish between validation errors, which shouldn't be retried, and transient errors, which can be retried. Retry only failed items, not the entire batch. --- ## REST API ### Schema ``` Method: bulkAddProductsToStore Description: Adds multiple Marketplace products to the caller's Wix store in a single request. Call this method to adopt products from the Marketplace into a Wix Stores catalog for selling. The target store is determined by the calling identity, so there's no need to specify a store GUID in the request. Supports partial success. Some products may be added successfully while others fail. Each result includes an `itemMetadata` object indicating success or failure with error details. When handling failures, distinguish between validation errors, which shouldn't be retried, and transient errors, which can be retried. Retry only failed items, not the entire batch. URL: https://www.wixapis.com/suppliershub/marketplace-product/v1/bulk/add-products-to-store Method: POST # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: productReferences, productReferences.productId Method parameters: param name: productReferences | type: array | description: References to the Marketplace products to add to the store. Each reference must include a `productId` identifying an existing Marketplace product. | required: true - name: productId | type: string | description: Product GUID. | required: true - name: options | type: object | description: Additional metadata for the product reference. For example, internal identifiers on the provider's platform. - name: visibleInStore | type: boolean | description: Whether the product is visible in the store. Default: `false` Return type: BulkAddProductsToStoreResponse - name: results | type: array | description: Results of the bulk add-to-store operation, one per input product reference. - name: itemMetadata | type: ItemMetadata | description: Metadata for the individual add-to-store operation, including success or failure status and error details. - name: id | type: string | description: Item GUID. Should always be available, unless it's impossible. For example, when failing to create an item. - name: originalIndex | type: integer | description: Index of the item within the request array. Allows for correlation between request and response items. - name: success | type: boolean | description: Whether the requested action was successful for this item. When `false`, the `error` field is populated. - name: error | type: ApplicationError | description: Details about the error in case of failure. - name: code | type: string | description: Error code. - name: description | type: string | description: Description of the error. - name: data | type: object | description: Data related to the error. - name: item | type: ProductReference | description: Reference to the product added to the store. - name: productId | type: string | description: Product GUID. - name: appId | type: string | description: Provider app GUID. - name: options | type: object | description: Additional metadata for the product reference. For example, internal identifiers on the provider's platform. - name: visibleInStore | type: boolean | description: Whether the product is visible in the store. Default: `false` - name: bulkActionMetadata | type: BulkActionMetadata | description: Metadata about the bulk operation, including success and failure counts. - name: totalSuccesses | type: integer | description: Number of items that were successfully processed. - name: totalFailures | type: integer | description: Number of items that couldn't be processed. - name: undetailedFailures | type: integer | description: Number of failures without details because detailed failure threshold was exceeded. ``` ### Examples ### Bulk Add Products To Store Imports selected marketplace products into a Wix store in bulk ```curl curl -X POST \ 'https://www.wixapis.com/suppliers-hub/v1/bulk/add-products-to-store' \ -H 'Authorization: ' \ -H 'Content-Type: application/json' \ -d '{ "productReferences": [ { "productId": "e61fdfc3-8cc9-434c-b4b3-c1bf39275fc8", "visibleInStore": true }, { "productId": "6affe02b-5088-4af6-865d-662c714c45b5", "visibleInStore": true }, { "productId": "740164a3-d5c9-496b-844a-0d6a7b5f20fe", "visibleInStore": false } ] }' ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.suppliersHub.MarketplaceProduct.bulkAddProductsToStore(productReferences) Description: Adds multiple Marketplace products to the caller's Wix store in a single request. Call this method to adopt products from the Marketplace into a Wix Stores catalog for selling. The target store is determined by the calling identity, so there's no need to specify a store GUID in the request. Supports partial success. Some products may be added successfully while others fail. Each result includes an `itemMetadata` object indicating success or failure with error details. When handling failures, distinguish between validation errors, which shouldn't be retried, and transient errors, which can be retried. Retry only failed items, not the entire batch. # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: productReferences, productReferences.productId Method parameters: param name: productReferences | type: array | description: References to the Marketplace products to add to the store. Each reference must include a `productId` identifying an existing Marketplace product. | required: true - name: productId | type: string | description: Product GUID. | required: true - name: options | type: object | description: Additional metadata for the product reference. For example, internal identifiers on the provider's platform. - name: visibleInStore | type: boolean | description: Whether the product is visible in the store. Default: `false` Return type: PROMISE - name: results | type: array | description: Results of the bulk add-to-store operation, one per input product reference. - name: itemMetadata | type: ItemMetadata | description: Metadata for the individual add-to-store operation, including success or failure status and error details. - name: _id | type: string | description: Item GUID. Should always be available, unless it's impossible. For example, when failing to create an item. - name: originalIndex | type: integer | description: Index of the item within the request array. Allows for correlation between request and response items. - name: success | type: boolean | description: Whether the requested action was successful for this item. When `false`, the `error` field is populated. - name: error | type: ApplicationError | description: Details about the error in case of failure. - name: code | type: string | description: Error code. - name: description | type: string | description: Description of the error. - name: data | type: object | description: Data related to the error. - name: item | type: ProductReference | description: Reference to the product added to the store. - name: productId | type: string | description: Product GUID. - name: appId | type: string | description: Provider app GUID. - name: options | type: object | description: Additional metadata for the product reference. For example, internal identifiers on the provider's platform. - name: visibleInStore | type: boolean | description: Whether the product is visible in the store. Default: `false` - name: bulkActionMetadata | type: BulkActionMetadata | description: Metadata about the bulk operation, including success and failure counts. - name: totalSuccesses | type: integer | description: Number of items that were successfully processed. - name: totalFailures | type: integer | description: Number of items that couldn't be processed. - name: undetailedFailures | type: integer | description: Number of failures without details because detailed failure threshold was exceeded. ``` ### Examples ### bulkAddProductsToStore ```javascript import { products } from '@wix/suppliers-hub'; async function bulkAddProductsToStore(productReferences) { const response = await products.bulkAddProductsToStore(productReferences); }; ``` ### bulkAddProductsToStore (with elevated permissions) ```javascript import { products } from '@wix/suppliers-hub'; import { auth } from '@wix/essentials'; async function myBulkAddProductsToStoreMethod(productReferences) { const elevatedBulkAddProductsToStore = auth.elevate(products.bulkAddProductsToStore); const response = await elevatedBulkAddProductsToStore(productReferences); } ``` ### bulkAddProductsToStore (self-hosted) Self-hosted SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md). ```javascript import { createClient } from '@wix/sdk'; import { products } from '@wix/suppliers-hub'; // Import the auth strategy for the relevant access type // Import the relevant host module if needed const myWixClient = createClient ({ modules: { products }, // Include the auth strategy and host as relevant }); async function bulkAddProductsToStore(productReferences) { const response = await myWixClient.products.bulkAddProductsToStore(productReferences); }; ``` ---