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:
- To start collecting back in stock requests, the
collectionStates
must be set totrue
. UsestartCollectingRequests()
to update collection states. - Customize the design of the notification email that will be sent.
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.
Setup
To use the BackInStockSettings API, install the @wix/ecom
package using npm or Yarn:
1npm install @wix/ecom
or
1yarn add @wix/ecom
Then import { backInStockSettings }
from @wix/ecom
:
1import { backInStockSettings } from '@wix/ecom'
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.
function getSettings(): Promise<GetSettingsResponse>
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.
function startCollectingRequests(appId: string): Promise<StartCollectingRequestsResponse>
ID of the app to start accepting notification requests for.
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.
function stopCollectingRequests(appId: string): Promise<StopCollectingRequestsResponse>
ID of the app to stop accepting notification requests for.