Introduction
APIs in Developer Preview are subject to change and are not intended for use in production.
Send us your suggestions for improving this API. Your feedback is valuable to us.
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:
- Increase sales and customer satisfaction with personalized notifications.
- Collect insights on requested items that are currently unavailable.
- Effectively manage inventory and adjust restocking strategy.
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:
javascript | Copy Codeimport { backInStockNotifications } from `wix-ecom-backend`;
Before you begin
It’s important to note the following points before starting to code:
- To start collecting back in stock requests, the
collectionStates
must be set totrue
. UsestartCollectingRequests()
to update collection states, or update in a site’s dashboard. - For emails to send with the
reportItemsBackInStock()
function, automations must be activated in the site’s dashboard first. - Customize the design of the notification email that will be sent.
Terminology
- Notification request: The object that is created when a customer wants to be notified when an out-of-stock item becomes available. The back in stock notification request contains information about the item and an email address to contact when it’s back in stock.
Permissions information
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.
Was this helpful?