getBackInStockNotificationRequest( )
Retrieves a back in stock notification request.
Syntax
function getBackInStockNotificationRequest(_id: string): Promise<BackInStockNotificationRequest>
getBackInStockNotificationRequest Parameters
NAME
TYPE
DESCRIPTION
ID of the notification request to retrieve.
Returns
Retrieved back in stock notification request.
Return Type:
NAME
TYPE
DESCRIPTION
Date and time the notification request was created.
Request ID.
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 reportItemsBackInStock()
function. If the notification email is sent offline but the status
is updated with the markAsNotificationSent()
function, then autoNotified
sets to false
.
Catalog and item reference that the notification request is for.
Includes IDs for the catalog and item it came from, as well as additional, optional information.
Contact ID for the contact with this email
.
If a contact does not already exist with the email address submitted when creating this request, then a new contact is created. For more information about contacts, see the Contacts API.
Email address to send notification to about item being back in stock.
Item URL for this request.
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
reportItemsBackInStock()
function, then thestatus
is briefly set toPROCESSING
and then set toNOTIFICATION_SENT
if the email is successul, andFAILED
if it fails. - When a notification email is sent offline, use the
markAsNotificationSent()
function to setstatus
toNOTIFICATION_SENT
.
Was this helpful?
getBackInStockNotificationRequest example
1import { backInStockNotifications } from 'wix-ecom-backend';23 async function getBackInStockNotificationRequest(id) {4 try {5 const result = await backInStockNotifications.getBackInStockNotificationRequest(id);67 return result;8 } catch (error) {9 console.error(error);10 // Handle the error11 }12 }13