Introduction

The Back In Stock Settings API allows you to manage whether or not to collect requests from customers to receive back in stock notifications.

Learn more about back in stock notification settings.

Before you begin

It’s important to note the following points before starting to code:

Terminology

  • Collection state: The collection state determines whether the selected app is actively collecting requests for back in stock notifications. When the collection state is set to `true``, collecting requests is enabled and customers may request notifications for out of stock products.
Was this helpful?
Yes
No

Setup

To use the BackInStockSettings API, install the @wix/ecom package using npm or Yarn:

Copy
1
npm install @wix/ecom

or

Copy
1
yarn add @wix/ecom

Then import { backInStockSettings } from @wix/ecom:

Copy
1
import { backInStockSettings } from '@wix/ecom'
Was this helpful?
Yes
No

getSettings( )

Developer Preview

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

Retrieves back in stock request settings.

Copy
function getSettings(): Promise<GetSettingsResponse>
Request
This method does not take any parameters
Returns
Return Type:Promise<GetSettingsResponse>
Was this helpful?
Yes
No

startCollectingRequests( )

Developer Preview

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

Sets settings.collectionStates.collectingRequests to true for given appId.

When the collection state is set to true, collecting requests is enabled and customers may request notifications for out of stock products. While collecting is enabled, customers see a "Notify When Available" button on out-of-stock items. Customers can click the button to enter their email address, which creates the notification request.

Copy
function startCollectingRequests(appId: string): Promise<StartCollectingRequestsResponse>
Method Parameters
appIdstringRequired

ID of the app to start accepting notification requests for.

Returns
Return Type:Promise<StartCollectingRequestsResponse>
Was this helpful?
Yes
No

stopCollectingRequests( )

Developer Preview

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

Sets settings.collectionStates.collectingRequests to false for given appId.

When the collection state is set to false, collecting notification requests is disabled.

Copy
function stopCollectingRequests(appId: string): Promise<StopCollectingRequestsResponse>
Method Parameters
appIdstringRequired

ID of the app to stop accepting notification requests for.

Returns
Return Type:Promise<StopCollectingRequestsResponse>
Was this helpful?
Yes
No