- Create a back-in-stock subscription
- Receive a stock level update
- Start the back-in-stock automation
- Send a back-in-stock email
Read about automations and email here.
Back-in-stock API endpoints
In order to receive back-in-stock notifications, a contact needs to have a back-in-stock subscription registered in Engage. This subscription connects an Engage contact to a specific item (by the SKU).1 - Create a new subscription
A back-in-stock subscription is created using the following API endpoint:The subscriber’s Engage contact ID.
The SKU of the item being subscribed to.
Locale of the SKU and therefore which product feed to fetch product data from.
A reference to an entity in an external system, only required if the value is included in the stock level update.
Read more about creating contacts and contact types
2 - Delete an existing subscription
A back-in-stock subscription is deleted like this:The unique ID of the back-in-stock subscription.
3 - Get all subscriptions for a contact
You can fetch all back-in-stock subscriptions for a contact like this:The standard GUID identifying a contact in Engage.
4 - Update one or several stock levels
This endpoint updates stock levels of one or more specific SKUs in Engage. This is then used to trigger the automations that will send back-in-stock communication to subscribed contacts. Stock level updates are done like this:Latest stock quantity of the SKU.
The SKU of the item which has received a stock level change. This SKU has to exist in the product feed.
Locale of the SKU and therefore which product feed to fetch product data from.
Reference to an entity in external system.
locale and externalId in stock level updates
Although neitherlocale nor externalId are required for stock level updates, it’s strongly recommended to include at least one of these attributes when a stock level update is done. Which one you use depends on what your subscription look like.
Consider the following situation. Five subscriptions are set up using these values (the externalId attribute is optional when setting up a subscription):
| Subscription | sku | locale | externalId |
|---|---|---|---|
| #1 | SKU-1 | sv-se | |
| #2 | SKU-1 | pl-pl | |
| #3 | SKU-1 | sv-se | SE-SKU-1 |
| #4 | SKU-1 | pl-pl | PL-SKU-1 |
| #5 | SKU-2 | sv-se |
sku, quantity and locale when doing a stock level update. An event is then triggered if both the sku and locale in the request match one or more of the subscriptions. The event created will be enriched based on the value in locale.
- Example: The retailer sends
skuas “SKU-1” and locale as “sv-se”, triggering subscriptions #1 and #3.
sku, quantity, externalId in a stock update. Now for an event to be triggered, sku and externalId have to match a subscription. The event will be enriched based on locale.
- Example: The retailer sends
skuas “SKU-1” andexternalIdas “SE-SKU-1”, triggering subscription #3.
sku and quantity in a stock update. All subscriptions containing that sku will now be triggered regardless of their externalId or locale value. The event will be enriched based on the locale.
- Example: The retailer sends the
skuas “SKU-1” which triggers subscriptions #1, #2, #3 and #4.
Triggering the back-in-stock automation
For Engage to trigger a back-in-stock email, all products (including out of stock products) must be present in the product feed that is connected to Engage. If a product is not in the feed, a BIS (back-in-stock) email cannot be sent for it. A stock level update sent to Engage triggers any back-in-stock automation triggers.
- The stock quantity must be higher than 0
- A product feed must be configured for the specified locale
- Product data must exist for the specified SKU
- Locale
- Quantity
- SKU
- ExternalId
- Product data
- Subscription time
- Purchase
- Contact attributes
locale is also supported in back-in-stock automations.
Logging of back-in-stock
The integration log will show you which SKU has passed the predefined conditions in the automation, and the number of subscriptions that have been sent to the back-in-stock automation trigger.