reportItemsBackInStock( )


Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Sends notifications for back in stock requests.

Important: Automations must be turned on in a site's dashboard 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.

Authentication
  • When developing websites or building an app with Blocks, this method may require elevated permissions, depending on the identity of the user calling it and the calling user’s permissions.
  • When building apps without Blocks or for headless projects, you can only call this method directly when authenticated as a Wix app or Wix user identity. When authenticated as a different identity, you can call this method using elevation.
  • Elevation permits users to call methods they typically cannot access. Therefore, you should only use it intentionally and securely.
Permissions
Manage Stores - all permissions
Learn more about app permissions.
Method Declaration
Copy
function reportItemsBackInStock(
  itemDetails: BackInStockItemDetails,
  options: ReportItemsBackInStockOptions,
): Promise<void>;
Method Parameters
itemDetailsBackInStockItemDetailsRequired

Item details to use in notifications.

itemDetails may populate dynamic valyes 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

Use extraAutomationTemplateParameters to pass additional dynamic values.


optionsReportItemsBackInStockOptions

Report options.

JavaScript
import { backInStockNotifications } from "@wix/ecom"; async function reportItemsBackInStock(itemDetails, options) { const response = await backInStockNotifications.reportItemsBackInStock( itemDetails, options, ); }
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?