You will learn

Learn how to enable Klaviyo Back in Stock and variant syncing for Salesforce Commerce Cloud (SFCC). First, you’ll check that your integration has access to product variants and that they sync to Klaviyo. 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 or text customers who have subscribed to alerts.

Before 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 your existing SFCC integration still syncs variants as top-level products, note the following changes when you switch to syncing variants under their parent products:

  • 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 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 gives Klaviyo permission to read product variants. Existing integrations must also have variant syncing enabled in Klaviyo. To add the snippet:

  1. In your SFCC Business Manager, navigate to Administration > Site Development > Open Commerce API Settings.
  2. 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):
text
{
               "resource_id":"/products/*/variations",
               "methods":["get"],
               "read_attributes":"(**)",
               "write_attributes":"(**)"
}

Once added, the settings should appear similar to this:

  1. Click Save.

After the next catalog sync, verify that your product variants appear in Klaviyo. Standard catalog syncs run every 8 hours by default. If you use Optimized catalog sync, catalog updates run hourly. To view your variants:

  1. Head to Content > Products in Klaviyo.
  2. Search for a parent product and click on it.
  3. Scroll to the bottom and click the Variants dropdown to verify that the variants are listed correctly.

If variants are still missing after a catalog sync, contact Klaviyo Support to check whether variant syncing is enabled for your integration. Confirm that the variants are present before testing your Back in Stock form.

Add a Back in Stock form

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. If your form submits requests through your server, use the server-side Back in Stock API.

If your form sends requests directly from the browser, use the client-side Back in Stock API with your Klaviyo public API key (site ID). Never include a private API key in browser code.

Check out our developer portal to learn how to make client-side requests to our Back in Stock API and subscribe customers to email or SMS alerts.

Build 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.
  • In Klaviyo, go to Flows > Create flow, then search for back in stock. Choose the pre-built Back in Stock flow for SFCC, name your flow, and click Use template:
  • Make sure to configure your account’s Back in Stock flow settings.
  • Review and customize your alert messages. When you’re ready to send alerts, click Review and turn on (or Update status) in the flow builder, choose Live, and click Save. Messages left in draft will not send.

Additional resources

  • Getting started with Salesforce Commerce Cloud

    Learn how to integrate Salesforce Commerce Cloud with Klaviyo. The Klaviyo cartridge and API integration allows websites using Salesforce Commerce Cloud (formerly Demandware) to quickly connect and send both real-time and historic data to Klaviyo. When you integrate Klaviyo with Salesforce Commerce Cloud (SFCC), Klaviyo will start tracking actions people take in real-time like website navigation, search tracking, viewing products, viewing categories, adding items to a cart, checking out, and ordering.

  • Salesforce Commerce Cloud data reference

    Learn what data syncs from Salesforce Commerce Cloud to Klaviyo after you enable Klaviyo's Salesforce Commerce Cloud integration, and how you can view it.

  • How to upgrade your Salesforce Commerce Cloud cartridge

    Learn how to upgrade your Klaviyo Salesforce Commerce Cloud cartridge.

Was this article helpful?
Use this form only for article feedback. Learn how to contact support.

Explore more from Klaviyo

Community
Connect with peers, partners, and Klaviyo experts to find inspiration, share insights, and get answers to all of your questions.
Partners
Hire a Klaviyo-certified expert to help you with a specific task, or for ongoing marketing management.
Support

Access support through your account.

Email support (free trial and paid accounts) Available 24/7

Chat/virtual assistance
Availability varies by location and plan type