> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> 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`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - 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/back-in-stock-service/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 | validation: format GUID
 Return type: StartCollectingRequestsResponse
  - name: settings | type: BackInStockSettings | description: Back in stock settings info.  
     - name: collectionStates | type: array<BackInStockCollectionState> | 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"`.  | validation: format GUID
        - 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.


```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.ecom.backInStockSettings.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 | validation: format GUID
 Return type: PROMISE<StartCollectingRequestsResponse>
  - name: settings | type: BackInStockSettings | description: Back in stock settings info.  
     - name: collectionStates | type: array<BackInStockCollectionState> | 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"`.  | validation: format GUID
        - 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-managed)
Self-managed 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);
};
```

---