> 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 # StartCollectingRequests # Package: backInStock # Namespace: BackInStockSettingsService # Method link: https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/other-services/back-in-stock/back-in-stock-settings/start-collecting-requests.md ## Permission Scopes: Manage Stores - all permissions: SCOPE.DC-STORES-MEGA.MANAGE-STORES ## Introduction Sets `settings.collectionStates.collectingRequests` to `true` for given `appId`. When the collection state is set to `true`, collecting requests is enabled and customers may request notifications for out of stock products. While collecting is enabled, customers see a "Notify When Available" button on out-of-stock items. Customers can click the button to enter their email address, which creates the notification request. --- ## REST API ### Schema ``` Method: startCollectingRequests Description: Sets `settings.collectionStates.collectingRequests` to `true` for given `appId`. When the collection state is set to `true`, collecting requests is enabled and customers may request notifications for out of stock products. While collecting is enabled, customers see a "Notify When Available" button on out-of-stock items. Customers can click the button to enter their email address, which creates the notification request. URL: https://www.wixapis.com/v1/back-in-stock-notification-requests/settings/start-collecting Method: POST # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: appId Method parameters: param name: appId | type: appId | description: GUID of the app to start accepting notification requests for. Back in stock notifications only work for [Wix Stores](https://support.wix.com/en/article/wix-stores-about-wix-stores). The `appId` for Wix Stores is `"215238eb-22a5-4c36-9e7b-e7c08025e04e"`. | required: true Return type: StartCollectingRequestsResponse - name: settings | type: BackInStockSettings | description: Back in stock settings info. - name: collectionStates | type: array | description: Information about collecting customer requests to receive back in stock notifications. - name: appId | type: string | description: GUID of the app to receive notification requests for. Back in stock notifications only work for [Wix Stores](https://support.wix.com/en/article/wix-stores-about-wix-stores). The `appId` for Wix Stores is `"215238eb-22a5-4c36-9e7b-e7c08025e04e"`. - name: collectingRequests | type: boolean | description: Whether to collect requests for items from this app. Possible Errors: HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: NOT_SUPPORTED_APP_DEF_ID | Description: The specified `appId` isn't supported. Back in stock notifications only work for Wix Stores. ``` ### Examples ### Start collecting back in stock notification requests ```curl curl -X POST \ 'https://www.wixapis.com/back-in-stock-service/v1/back-in-stock-notification-requests/settings/start-collecting' \ -H 'Content-type: application/json' \ -H 'Authorization: ' \ -d '{ "appId": "1380b703-ce81-ff05-f115-39571d94dfcd" }' ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.backInStock.BackInStockSettingsService.startCollectingRequests(appId) Description: Sets `settings.collectionStates.collectingRequests` to `true` for given `appId`. When the collection state is set to `true`, collecting requests is enabled and customers may request notifications for out of stock products. While collecting is enabled, customers see a "Notify When Available" button on out-of-stock items. Customers can click the button to enter their email address, which creates the notification request. # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: appId Method parameters: param name: appId | type: string | description: GUID of the app to start accepting notification requests for. Back in stock notifications only work for [Wix Stores](https://support.wix.com/en/article/wix-stores-about-wix-stores). The `appId` for Wix Stores is `"215238eb-22a5-4c36-9e7b-e7c08025e04e"`. | required: true Return type: PROMISE - name: settings | type: BackInStockSettings | description: Back in stock settings info. - name: collectionStates | type: array | description: Information about collecting customer requests to receive back in stock notifications. - name: appId | type: string | description: GUID of the app to receive notification requests for. Back in stock notifications only work for [Wix Stores](https://support.wix.com/en/article/wix-stores-about-wix-stores). The `appId` for Wix Stores is `"215238eb-22a5-4c36-9e7b-e7c08025e04e"`. - name: collectingRequests | type: boolean | description: Whether to collect requests for items from this app. Possible Errors: HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: NOT_SUPPORTED_APP_DEF_ID | Description: The specified `appId` isn't supported. Back in stock notifications only work for Wix Stores. ``` ### Examples ### startCollectingRequests ```javascript import { backInStockSettings } from '@wix/ecom'; async function startCollectingRequests(appId) { const response = await backInStockSettings.startCollectingRequests(appId); }; ``` ### startCollectingRequests (with elevated permissions) ```javascript import { backInStockSettings } from '@wix/ecom'; import { auth } from '@wix/essentials'; async function myStartCollectingRequestsMethod(appId) { const elevatedStartCollectingRequests = auth.elevate(backInStockSettings.startCollectingRequests); const response = await elevatedStartCollectingRequests(appId); } ``` ### startCollectingRequests (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 { backInStockSettings } from '@wix/ecom'; // Import the auth strategy for the relevant access type // Import the relevant host module if needed const myWixClient = createClient ({ modules: { backInStockSettings }, // Include the auth strategy and host as relevant }); async function startCollectingRequests(appId) { const response = await myWixClient.backInStockSettings.startCollectingRequests(appId); }; ``` ---