> 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 # 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/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. - 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"` - 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. - 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 - 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 | 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: ' \ -d '{ "requestIds": [ "cb294eb5-537f-4096-9319-9cb9c6e660cf", "18649693-1ac0-40d0-8741-21a01197f60a" ], "itemDetails": { "name": "Orchid Collection", "price": "65.00", "image": { "url": "https://static.wixstatic.com/media/example_orchid.jpg", "id": "example_orchid_id" } }, "extraAutomationTemplateParameters": { "checkoutUrl": "https://www.orchidsandbeyond.com/shop" } }' ``` ### 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: ' \ -d '{ "catalogReference": { "catalogItemId": "1111efc7-a323-458a-b71a-55a162cbf693", "appId": "1380b703-ce81-ff05-f115-39571d94dfcd", "options": { "variantId": "41f14880-0a1b-49e3-ac41-2e3880ca1896" } }, "itemDetails": { "name": "Blue Orchid", "price": "75.00", "image": { "url": "https://static.wixstatic.com/media/example5.jpg", "id": "example_image_id_5" } }, "extraAutomationTemplateParameters": { "checkoutUrl": "https://www.orchidsandbeyond.com/product-page/blue-orchid" } }' ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.backInStock.BackInStockNotificationRequestService.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 - 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. - 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"` - 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 | 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. Return type: PROMISE 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-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 { 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); }; ``` ---