Â
Note: This module is universal. Functions in this module can run on both the backend and frontend, unless specified otherwise.
The Back In Stock Notifications API allows you to manage customer requests to receive notifications when out-of-stock items become available.
With this API, you can:
Learn more about notifying customers when products are back in stock.
To use the Back In Stock Notifications API, import { backInStockNotifications } from the ‘wix-ecom-backend’ module:
It’s important to note the following points before starting to code:
collectionStates
must be set to true
. Use startCollectingRequests()
to update collection states, or update in a site’s dashboard.reportItemsBackInStock()
function, automations must be activated in the site’s dashboard first.The following functions in Back In Stock Notifications API are restricted and only run if you elevate permissions using the wix-auth
elevate()
function:
deleteBackInStockNotificationRequest()
getBackInStockNotificationRequest()
getBackInStockNotificationRequestsCountByCatalogReferences()
markAsNotificationSent()
queryBackInStockNotificationRequests()
reportItemsBackInStock()
Warning: Elevating a function allows it to be called by any site visitor. Exercise caution to prevent security vulnerabilities.