You will learn
Learn how to enable Klaviyo Back in Stock, and variant syncing, for Salesforce Commerce Cloud (SFCC). First, you’ll make sure Back in Stock is enabled within your SFCC integration via the addition of a snippet, which will also enable variant syncing. Then, you’ll set up a Back in Stock form on your site using Klaviyo’s APIs. Lastly, you’ll set up a Back in Stock flow in Klaviyo to email customers who have subscribed to alerts.
Before you beginBefore you begin
If you've yet to integrate your SFCC store with Klaviyo, you should integrate first, then skip ahead to the Add a Back in Stock form section of this article.
If you've already integrated Klaviyo with SFCC previously, please note that the following will happen when you enable Back in Stock in SFCC:
- Your Klaviyo catalog will be restructured. Variants that were previously synced as top-level products will now become nested variants under their respective parent. If you are using static product blocks in messaging for any of your product variants, these will need to be updated.
- For a brief period after you add the enable Back in Stock, your Best-selling products feed recommendations will appear empty, or may recommend unusual products. Within 3 days, these recommendations should return to normal. You may want to pause any messaging using the Best-selling products feed for this period.
Enable Back in Stock / variant syncing for SFCC
To use Klaviyo’s Back in Stock functionality with SFCC, you’ll need to add a /variations snippet to your OCAPI Data API settings, if you haven’t done so already. This snippet also enables variant syncing. To do this:
- In your SFCC Business Manager, navigate to Administration > Site Development > Open Commerce API Settings.
- Add the following JSON as a listed resource under the type Data and context Global (organization-wide), under the client_id assigned to Klaviyo (you should already have other snippets here):
Once added, the settings should appear similar to this:{ "resource_id":"/products/*/variations", "methods":["get"], "read_attributes":"(**)", "write_attributes":"(**)" }
- Click Save.
That’s it! Next time your catalog sync runs (this sync runs every 8 hours), you’ll see product variants synced to your Klaviyo catalog. To view them:
- Head to the Products tab in Klaviyo.
- Search for a parent product and click on it.
- Scroll to the bottom and click the Variants dropdown to verify that the variants are listed correctly.
Add a Back in Stock form
Now, it’s time to add a Back in Stock button and form to your site so that your customers can request back in stock alerts. This button and accompanying form should appear on out-of-stock product pages, and when it’s submitted, a request should be made to our Back in Stock API.
Check out our developer portal to learn how to make client-side requests to our Back in Stock API and subscribe customers to email alerts
Build your Back in Stock flowBuild your Back in Stock flow
Finally, you’ll want to create a flow to automatically message customers (via email, SMS, or both) who’ve subscribed to Back in Stock notifications:
- Check out our article to learn how to set up this flow.
- When setting up the flow, choose the pre-built Back in Stock flow for SFCC from the Flow Library:
- Make sure to configure your account’s Back in Stock flow settings.