Notify when the right variant returns.
The shopper selects the sold-out size or color they want. ReAI records the request and can send the alert through the business’s configured email flow.
Follow the flow
- Enable email marketing and a back-in-stock flow for the business in ReAI. Then enable stockNotificationsEnabled in the starter’s store-content.js.
- Show the form only for published, sold-out variants. The shopper enters an email and consents to one stock notification.
- The Worker sends variantId, email and consent with the server-held Site credential and newsletter:subscribe scope.
- The flow follows availability and sends the alert when the variant can be bought. Repeated requests do not create multiple pending alerts for the same variant and address.
Separate consent
A stock alert does not subscribe the shopper to the newsletter. Pending requests expire after 180 days. Contact the business to withdraw the request.
No empty promises
The starter hides the form by default. Show it once sending is configured. The API rejects available variants and businesses without an active notification flow.
POST /site/v1/commerce/stock-subscriptions
Authorization: Bearer <server-only Site credential>
{ "email": "you@example.com", "variantId": "<published sold-out variant UUID>", "consent": true }
200 { "accepted": true }