> 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

# ReportItemsBackInStock

# Package: backInStock

# Namespace: BackInStockNotificationRequestService

# Method link: https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/other-services/back-in-stock/back-in-stock-notifications/report-items-back-in-stock.md

## Permission Scopes:
Manage Stores - all permissions: SCOPE.DC-STORES-MEGA.MANAGE-STORES

## Introduction

Sends notifications for back in stock requests.

> **Important:**
> Automations must be turned on in a [Wix user's dashboard](https://www.wix.com/my-account/site-selector/?buttonText=Go%20to%20Back-in-Stock&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https://www.wix.com/dashboard/{{metaSiteId}}/store/back-in-stock) for notifications to send.

This endpoint triggers notifications for requests in 1 of 2 ways:
1. For a specific item, with the `catalogReference` information.
2. For specific requests, with `requestIds`.

`itemDetails` are required and may populate dynamic values in the notification template, as follows:
+ `itemDetails.name` passes to the template as `item.name`
+ `itemDetails.price` passes to the template as `item.price`
+ `itemDetails.image.url` passes to the template as `item.image.url`

If the notification template doesn't include `item.price`, `item.name`, or `item.image.url`, values should
be passed in `extraAutomationTemplateParameters`.

After this endpoint is called, the `status` for the request will update to `NOTIFICATION_SENT` if it sends
successfully, or to `FAILED` if it fails to send.

---

## REST API

### Schema

```
 Method: reportItemsBackInStock
 Description: Sends notifications for back in stock requests.  > **Important:** > Automations must be turned on in a [Wix user's dashboard](https://www.wix.com/my-account/site-selector/?buttonText=Go%20to%20Back-in-Stock&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https://www.wix.com/dashboard/{{metaSiteId}}/store/back-in-stock) for notifications to send.  This endpoint triggers notifications for requests in 1 of 2 ways: 1. For a specific item, with the `catalogReference` information. 2. For specific requests, with `requestIds`.  `itemDetails` are required and may populate dynamic values in the notification template, as follows: + `itemDetails.name` passes to the template as `item.name` + `itemDetails.price` passes to the template as `item.price` + `itemDetails.image.url` passes to the template as `item.image.url`  If the notification template doesn't include `item.price`, `item.name`, or `item.image.url`, values should be passed in `extraAutomationTemplateParameters`.  After this endpoint is called, the `status` for the request will update to `NOTIFICATION_SENT` if it sends successfully, or to `FAILED` if it fails to send.
 URL: https://www.wixapis.com/back-in-stock-service/v1/back-in-stock-notification-requests/report-items-back-in-stock
 Method: POST
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  itemDetails, itemDetails.name, itemDetails.price
 Method parameters: 
   param name: catalogReference | type: CatalogReference | description: Used for grouping line items. Sent when an item is added to a cart, checkout, or order.  
        - name: catalogItemId | type: string | description: GUID of the item within the catalog it belongs to.  | validation: minLength 1, maxLength 36
        - name: appId | type: string | description: GUID of the app providing the catalog.  You can get your app's GUID from its page in the [app dashboard](https://dev.wix.com/dc3/my-apps/).  For items from Wix catalogs, the following values always apply: + Wix Stores: `"215238eb-22a5-4c36-9e7b-e7c08025e04e"` + Wix Bookings: `"13d21c63-b5ec-5912-8397-c3a5ddb27a97"` + Wix Restaurants: `"9a5d83fd-8570-482e-81ab-cfa88942ee60"`  | validation: minLength 1
        - name: options | type: object | description: Additional item details in `key:value` pairs.  Use this optional field for more specificity with item selection. The values of the `options` field differ depending on which catalog is providing the items.  For Wix Stores products, learn more about integrating with [Catalog V3](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration.md) or [Catalog V1](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v1/catalog/e-commerce-integration.md), depending on [the version the site uses](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-versioning/introduction.md).  
   param name: extraAutomationTemplateParameters | type: extraAutomationTemplateParameters | description: Additional key-value pairs to pass to the back in stock notification template.  | validation: format map
        - name: key | type: string | description: none  
        - name: value | type: string | description: none  
   param name: itemDetails | type: BackInStockItemDetails   | required: true 
        - name: name | type: string | description: Item name. | required: true 
        - name: price | type: string | description: Item price. | required: true | validation: decimalValue {"gte":"0"}
        - name: image | type: Image | description: Item image.  
           - name: id | type: string | description: WixMedia image GUID.  
           - name: url | type: string | description: Image URL.  
           - name: altText | type: string | description: Image alt text.  
   param name: requestIds | type: array<requestIds> | description: IDs of requests to send notifications for.  Cannot be used with `catalogReference`.  
 Return type: ReportItemsBackInStockResponse
  EMPTY-OBJECT {}

 Possible Errors:
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: INVALID_ITEM_IMAGE_URL | Description: The `itemDetails.image.url` field contains an invalid URL.
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: REQUEST_CONTAINS_BOTH_CATALOG_REFERENCE_AND_REQUEST_IDS | Description: Request can't contain both `catalogReference` and `requestIds`. Use one or the other.


```

### Examples

### Report items back in stock by request IDs
```curl
curl -X POST \
  'https://www.wixapis.com/back-in-stock-service/v1/back-in-stock-notification-requests/report-items-back-in-stock' \
  -H 'Content-type: application/json' \
  -H 'Authorization: <AUTH>' \
  -d '{
    "requestIds": [
      "40d0ffe7-b8fa-40c8-adf4-f3b3760b4b8b"
    ],
    "itemDetails": {
      "name": "No. 06 Sumatra Gayo",
      "price": "19.00",
      "image": {
        "url": "https://static.wixstatic.com/media/8ed784_9ce8256e2d27495bb4c59813ef63604c~mv2.png",
        "id": "8ed784_9ce8256e2d27495bb4c59813ef63604c~mv2.png"
      }
    },
    "extraAutomationTemplateParameters": {
      "checkoutUrl": "https://www.wixsite.com/ecom-s1/product-page/no-06-sumatra-gayo"
    }
  }'
```

### Report items back in stock by catalog reference
```curl
curl -X POST \
  'https://www.wixapis.com/back-in-stock-service/v1/back-in-stock-notification-requests/report-items-back-in-stock' \
  -H 'Content-type: application/json' \
  -H 'Authorization: <AUTH>' \
  -d '{
    "catalogReference": {
      "catalogItemId": "11ce8c82-1936-4219-8678-4eb009d006dc",
      "appId": "215238eb-22a5-4c36-9e7b-e7c08025e04e",
      "options": {
        "variantId": "786b8f4e-b0d1-4851-a9cf-ef38ece5d72e"
      }
    },
    "itemDetails": {
      "name": "No. 07 Sidamo Natural",
      "price": "22.00",
      "image": {
        "url": "https://static.wixstatic.com/media/8ed784_63d2210db7d24cad85cec2f592dc0ee2~mv2.png",
        "id": "8ed784_63d2210db7d24cad85cec2f592dc0ee2~mv2.png"
      }
    },
    "extraAutomationTemplateParameters": {
      "checkoutUrl": "https://www.wixsite.com/ecom-s1/product-page/no-07-sidamo-natural"
    }
  }'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.ecom.backInStockNotifications.reportItemsBackInStock(itemDetails, options)
 Description: Sends notifications for back in stock requests.  > **Important:** > Automations must be turned on in a [Wix user's dashboard](https://www.wix.com/my-account/site-selector/?buttonText=Go%20to%20Back-in-Stock&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https://www.wix.com/dashboard/{{metaSiteId}}/store/back-in-stock) for notifications to send.  This endpoint triggers notifications for requests in 1 of 2 ways: 1. For a specific item, with the `catalogReference` information. 2. For specific requests, with `requestIds`.  `itemDetails` are required and may populate dynamic values in the notification template, as follows: + `itemDetails.name` passes to the template as `item.name` + `itemDetails.price` passes to the template as `item.price` + `itemDetails.image.url` passes to the template as `item.image.url`  If the notification template doesn't include `item.price`, `item.name`, or `item.image.url`, values should be passed in `extraAutomationTemplateParameters`.  After this endpoint is called, the `status` for the request will update to `NOTIFICATION_SENT` if it sends successfully, or to `FAILED` if it fails to send.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  itemDetails, itemDetails.name, itemDetails.price
 Method parameters: 
   param name: itemDetails | type: BackInStockItemDetails   | required: true 
        - name: name | type: string | description: Item name. | required: true 
        - name: price | type: string | description: Item price. | required: true | validation: decimalValue {"gte":"0"}
        - name: image | type: string | description: Item image.  
   param name: options | type: ReportItemsBackInStockOptions  none  
        - name: catalogReference | type: CatalogReference | description: `catalogReference` item to send notifications for.  Cannot be used with `requestIds`.  
           - name: catalogItemId | type: string | description: GUID of the item within the catalog it belongs to.  | validation: minLength 1, maxLength 36
           - name: appId | type: string | description: GUID of the app providing the catalog.  You can get your app's GUID from its page in the [app dashboard](https://dev.wix.com/dc3/my-apps/).  For items from Wix catalogs, the following values always apply: + Wix Stores: `"215238eb-22a5-4c36-9e7b-e7c08025e04e"` + Wix Bookings: `"13d21c63-b5ec-5912-8397-c3a5ddb27a97"` + Wix Restaurants: `"9a5d83fd-8570-482e-81ab-cfa88942ee60"`  | validation: minLength 1
           - name: options | type: object | description: Additional item details in `key:value` pairs.  Use this optional field for more specificity with item selection. The values of the `options` field differ depending on which catalog is providing the items.  For Wix Stores products, learn more about integrating with [Catalog V3](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration.md) or [Catalog V1](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v1/catalog/e-commerce-integration.md), depending on [the version the site uses](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-versioning/introduction.md).  
        - name: requestIds | type: array<string> | description: IDs of requests to send notifications for.  Cannot be used with `catalogReference`.  
        - name: extraAutomationTemplateParameters | type: object | description: Additional key-value pairs to pass to the back in stock notification template.  | validation: format map
 Return type: PROMISE<ReportItemsBackInStockResponse>
  EMPTY-OBJECT {}

 Possible Errors:
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: INVALID_ITEM_IMAGE_URL | Description: The `itemDetails.image.url` field contains an invalid URL.
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: REQUEST_CONTAINS_BOTH_CATALOG_REFERENCE_AND_REQUEST_IDS | Description: Request can't contain both `catalogReference` and `requestIds`. Use one or the other.


```

### Examples

### reportItemsBackInStock
```javascript
import { backInStockNotifications } from '@wix/ecom';

async function reportItemsBackInStock(itemDetails,options) {
  const response = await backInStockNotifications.reportItemsBackInStock(itemDetails,options);
};
```

### reportItemsBackInStock (with elevated permissions)
```javascript
import { backInStockNotifications } from '@wix/ecom';
import { auth } from '@wix/essentials';

async function myReportItemsBackInStockMethod(itemDetails,options) {
  const elevatedReportItemsBackInStock = auth.elevate(backInStockNotifications.reportItemsBackInStock);
  const response = await elevatedReportItemsBackInStock(itemDetails,options);
}
```

### reportItemsBackInStock (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 { backInStockNotifications } from '@wix/ecom';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

const myWixClient = createClient ({
  modules: { backInStockNotifications },
  // Include the auth strategy and host as relevant
});


async function reportItemsBackInStock(itemDetails,options) {
  const response = await myWixClient.backInStockNotifications.reportItemsBackInStock(itemDetails,options);
};
```

---