> 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 # QueryBackInStockNotificationRequests # 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/query-back-in-stock-notification-requests.md ## Permission Scopes: Manage Stores - all permissions: SCOPE.DC-STORES-MEGA.MANAGE-STORES ## Introduction Retrieves a list of notification requests, given the provided paging, filtering, and sorting. To learn about working with _Query_ endpoints, see [API Query Language](https://dev.wix.com/docs/rest/articles/get-started/api-query-language.md), [Sorting and Paging](https://dev.wix.com/docs/rest/articles/get-started/sorting-and-paging.md), and [Field Projection](https://dev.wix.com/docs/rest/articles/get-started/field-projection.md). --- ## REST API ### Schema ``` Method: queryBackInStockNotificationRequests Description: Retrieves a list of notification requests, given the provided paging, filtering, and sorting. To learn about working with _Query_ endpoints, see [API Query Language](https://dev.wix.com/docs/rest/articles/get-started/api-query-language.md), [Sorting and Paging](https://dev.wix.com/docs/rest/articles/get-started/sorting-and-paging.md), and [Field Projection](https://dev.wix.com/docs/rest/articles/get-started/field-projection.md). URL: https://www.wixapis.com/v1/back-in-stock-notification-requests/query Method: POST Method parameters: param name: query | type: PlatformQuery - name: cursorPaging | type: CursorPaging | description: Cursor pointing to page of results. Cannot be used together with `paging`. `cursorPaging.cursor` can not be used together with `filter` or `sort`. - name: limit | type: integer | description: Maximum number of items to return in the results. - name: cursor | type: string | description: Pointer to the next or previous page in the list of results. Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response. Not relevant for the first request. - name: filter | type: object | description: Filter object. - name: sort | type: array | description: Sorting options. For example, `[{"fieldName":"sortField1"},{"fieldName":"sortField2","direction":"DESC"}]`. - name: fieldName | type: string | description: Name of the field to sort by. - name: order | type: SortOrder | description: Sort order. - enum: ASC, DESC Return type: QueryBackInStockNotificationRequestsResponse - name: requests | type: array | description: Retrieved back in stock requests. - name: id | type: string | description: Notification request GUID. - name: catalogReference | type: CatalogReference | description: Catalog and item reference that the notification request is for. Includes GUIDs for the catalog and item it came from, as well as additional, optional information. 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: 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: email | type: string | description: Email address to send notification to about item being back in stock. - name: contactId | type: string | description: Contact GUID for the contact with this `email`. If a contact does not already exist with the email address submitted when creating this notification request, then a new contact is created. For more information about contacts, see the Contacts API. - name: status | type: Status | description: Status of the notification. `status` is set to `RECEIVED` when the notification request is created. The `status` changes once a notification email is sent for this request object: + When a notification email is sent through the site, either automatically or with the Report Items Back In Stock method, then the `status` is briefly set to `PROCESSING` and then set to `NOTIFICATION_SENT` if the email is successful, and `FAILED` if it fails. + When a notification email is sent offline, use the Mark As Notification Sent method to set `status` to `NOTIFICATION_SENT`. - enum: UNSPECIFIED, RECEIVED, PROCESSING, NOTIFICATION_SENT, FAILED - name: autoNotified | type: boolean | description: Whether a notification was sent automatically. `autoNotified` is empty when the notification request is created and is not returned until the field has a value. `autoNotified` receives a value when a notification email is sent for this request object. `autoNotified` sets to `TRUE` if the notification is sent through the site, either automatically or with the Report Items Back In Stock method. If the notification email is sent offline but the `status` is updated with the Mark As Notification Sent method, then `autoNotified` sets to `FALSE`. - name: createdDate | type: string | description: Date and time the notification request was created. - name: itemUrl | type: string | description: Item URL for this notification request. - name: metadata | type: PlatformPagingMetadata | description: Details on the paged set of results returned. - name: count | type: integer | description: The number of items returned in this response. - name: offset | type: integer | description: The offset which was requested. Returned if offset paging was used. - name: total | type: integer | description: The total number of items that match the query. Returned if offset paging was used. - name: cursors | type: Cursors | description: Cursors to navigate through result pages. Returned if cursor paging was used. - name: next | type: string | description: Cursor string pointing to the next page in the list of results. - name: prev | type: string | description: Cursor pointing to the previous page in the list of results. ``` ### Examples ### Query back in stock notification requests by status ```curl curl -X POST \ 'https://www.wixapis.com/back-in-stock-service/v1/back-in-stock-notification-requests/query' \ -H 'Content-type: application/json' \ -H 'Authorization: ' \ -d '{ "query": { "filter": { "status": "RECEIVED" }, "sort": [ { "fieldName": "createdDate", "order": "ASC" } ], "paging": { "limit": 2 } } }' ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.backInStock.BackInStockNotificationRequestService.queryBackInStockNotificationRequests(query) Description: Retrieves a list of notification requests, given the provided paging, filtering, and sorting. To learn about working with _Query_ endpoints, see [API Query Language](https://dev.wix.com/docs/rest/articles/get-started/api-query-language.md), [Sorting and Paging](https://dev.wix.com/docs/rest/articles/get-started/sorting-and-paging.md), and [Field Projection](https://dev.wix.com/docs/rest/articles/get-started/field-projection.md). # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: query Method parameters: param name: query | type: BackInStockNotificationRequestQuery | required: true - name: cursorPaging | type: CursorPaging | description: Cursor pointing to page of results. Cannot be used together with `paging`. `cursorPaging.cursor` can not be used together with `filter` or `sort`. - name: limit | type: integer | description: Maximum number of items to return in the results. - name: cursor | type: string | description: Pointer to the next or previous page in the list of results. Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response. Not relevant for the first request. - name: filter | type: object | description: Filter object. - name: sort | type: array | description: Sorting options. For example, `[{"fieldName":"sortField1"},{"fieldName":"sortField2","direction":"DESC"}]`. - name: fieldName | type: string | description: Name of the field to sort by. - name: order | type: SortOrder | description: Sort order. - enum: ASC, DESC Return type: PROMISE - name: requests | type: array | description: Retrieved back in stock requests. - name: _id | type: string | description: Notification request GUID. - name: catalogReference | type: CatalogReference | description: Catalog and item reference that the notification request is for. Includes GUIDs for the catalog and item it came from, as well as additional, optional information. 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: 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: email | type: string | description: Email address to send notification to about item being back in stock. - name: contactId | type: string | description: Contact GUID for the contact with this `email`. If a contact does not already exist with the email address submitted when creating this notification request, then a new contact is created. For more information about contacts, see the Contacts API. - name: status | type: Status | description: Status of the notification. `status` is set to `RECEIVED` when the notification request is created. The `status` changes once a notification email is sent for this request object: + When a notification email is sent through the site, either automatically or with the Report Items Back In Stock method, then the `status` is briefly set to `PROCESSING` and then set to `NOTIFICATION_SENT` if the email is successful, and `FAILED` if it fails. + When a notification email is sent offline, use the Mark As Notification Sent method to set `status` to `NOTIFICATION_SENT`. - enum: UNSPECIFIED, RECEIVED, PROCESSING, NOTIFICATION_SENT, FAILED - name: autoNotified | type: boolean | description: Whether a notification was sent automatically. `autoNotified` is empty when the notification request is created and is not returned until the field has a value. `autoNotified` receives a value when a notification email is sent for this request object. `autoNotified` sets to `TRUE` if the notification is sent through the site, either automatically or with the Report Items Back In Stock method. If the notification email is sent offline but the `status` is updated with the Mark As Notification Sent method, then `autoNotified` sets to `FALSE`. - name: _createdDate | type: Date | description: Date and time the notification request was created. - name: itemUrl | type: string | description: Item URL for this notification request. - name: metadata | type: PlatformPagingMetadata | description: Details on the paged set of results returned. - name: count | type: integer | description: The number of items returned in this response. - name: offset | type: integer | description: The offset which was requested. Returned if offset paging was used. - name: total | type: integer | description: The total number of items that match the query. Returned if offset paging was used. - name: cursors | type: Cursors | description: Cursors to navigate through result pages. Returned if cursor paging was used. - name: next | type: string | description: Cursor string pointing to the next page in the list of results. - name: prev | type: string | description: Cursor pointing to the previous page in the list of results. ``` ### Examples ### queryBackInStockNotificationRequests ```javascript import { backInStockNotifications } from '@wix/ecom'; async function queryBackInStockNotificationRequests(query) { const response = await backInStockNotifications.queryBackInStockNotificationRequests(query); }; ``` ### queryBackInStockNotificationRequests (with elevated permissions) ```javascript import { backInStockNotifications } from '@wix/ecom'; import { auth } from '@wix/essentials'; async function myQueryBackInStockNotificationRequestsMethod(query) { const elevatedQueryBackInStockNotificationRequests = auth.elevate(backInStockNotifications.queryBackInStockNotificationRequests); const response = await elevatedQueryBackInStockNotificationRequests(query); } ``` ### queryBackInStockNotificationRequests (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 queryBackInStockNotificationRequests(query) { const response = await myWixClient.backInStockNotifications.queryBackInStockNotificationRequests(query); }; ``` ---