This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Creates a back in stock notification request.
If a notification request already exists for the same catalogReference
and email
,
then a new one isn't created and the existing request is returned.
function createBackInStockNotificationRequest(
request: BackInStockNotificationRequest,
itemDetails: BackInStockItemDetails,
): Promise<BackInStockNotificationRequest>;
Notification request information.
Includes details for the out of stock item and the email address requesting to be notified when it's back in stock.
Item details to include in the notification when the item is back in stock.
import { backInStockNotifications } from "wix-ecom-backend";
async function createBackInStockNotificationRequest(request, itemDetails) {
try {
const result =
await backInStockNotifications.createBackInStockNotificationRequest(
request,
itemDetails,
);
return result;
} catch (error) {
console.error(error);
// Handle the error
}
}
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.