Search.../

markAsNotificationSent( )

Developer Preview

Sets status of a back in stock request to NOTIFICATION_SENT.

Description

Use this function if the notification is sent manually offline. If the notification is sent automatically or with the reportItemsBackInStock() function, then status updates on its own.

Admin Method

This function requires elevated permissions to run. This function is not universal and runs only on the backend.

Syntax

function markAsNotificationSent(_id: string): Promise<MarkAsNotificationSentResponse>

markAsNotificationSent Parameters

NAME
TYPE
DESCRIPTION
_id
string

ID of the notification request to mark.

Returns

Return Type:

Promise<
MarkAsNotificationSentResponse
>
NAME
TYPE
DESCRIPTION
request
BackInStockNotificationRequest

Marked back in stock notification request.

Was this helpful?

markAsNotificationSent example

Copy Code
1import { backInStockNotifications } from 'wix-ecom-backend';
2
3 async function markAsNotificationSent(id) {
4 try {
5 const result = await backInStockNotifications.markAsNotificationSent(id);
6
7 return result;
8 } catch (error) {
9 console.error(error);
10 // Handle the error
11 }
12 }
13