Search.../

items

Returns an array of backInStockNotifications items that match the query.

Description

items contains the current page of results retrieved by the query. If no results match the query, items is an empty array. The page size is defined by the limit() function and can be retrieved using the pageSize property. You can use the next() and prev() functions returned by backInStockNotifications to navigate the pages of a query result.

Type:

Array<
BackInStockNotificationRequest
>
NAME
TYPE
DESCRIPTION
_createdDate
Date

Date and time the notification request was created.

_id
string

Request ID.

autoNotified
boolean

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.

catalogReference
CatalogReference

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.

contactId
string

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
string

Email address to send notification to about item being back in stock.

itemUrl
string

Item URL for this request.

status
string

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 the status is briefly set to PROCESSING and then set to NOTIFICATION_SENT if the email is successul, and FAILED if it fails.
  • When a notification email is sent offline, use the markAsNotificationSent() function to set status to NOTIFICATION_SENT.

Was this helpful?

Get items from a query result

Copy Code
1const returnedItems = results.items;
2
Perform a query and get items from the result

Copy Code
1import { backInStockNotifications } from 'wix-ecom-backend';
2
3export async function myQueryFunction() {
4 const results = await backInStockNotifications
5 .queryBackInStockNotificationRequests()
6 .find();
7
8 const returnedItems = results.items;
9
10 if (returnedItems.length > 0) {
11 return items;
12 } else {
13 // Handle if no matching items found
14 }
15}
16