The Back In Stock Settings API allows you to manage whether a site collects requests from customers to receive back in stock notifications.
Learn more about back in stock notification settings.
It’s important to note the following points before starting to code:
collectionStates must be set to true. Call startCollectingRequests() to update collection states.true, collecting requests is enabled and customers may request notifications for out of stock products.