Solved

Back In Stock with woocommerce

  • 28 January 2021
  • 12 replies
  • 3401 views

Badge +2

Hi,

Do somebody find a solution to implement back in stock flow with Klaivyo and Woocommerce ?

natively, it is possible only with shopify.

 

I did it with a List, form and woocommerce hooks but with this method, I have to send email and create new list manualy each time…

 

Regards

icon

Best answer by caroline 5 March 2021, 20:15

View original

12 replies

Userlevel 7
Badge +57

@db-conception As far as I know, the Klaviyo public API documentation doesn’t seem to expose this functionality, even for “Custom Ecommerce Integrations.”  For example, this probably has a lot to do with the Catalog Feed Integration for Klaviyo to monitor and check inventory/stock status.  Even the Catalog Integration requires consultation with Klaviyo’s Support Team so it may be possible?

I’d be interested to know if it’s possible too!

 

Userlevel 3
Badge +4

I never tested myself but maybe there is a workaround with plugins like this 

https://woocommerce.com/products/back-in-stock-notifications/

which will pass the information to Klaviyo and you can set some custom properties and triggers. Just brainstorming. :)

Badge +2

I never tested myself but maybe there is a workaround with plugins like this 

https://woocommerce.com/products/back-in-stock-notifications/

which will pass the information to Klaviyo and you can set some custom properties and triggers. Just brainstorming. :)

With this solution I will still have to do a lot of custom developments. But if I am not wrong, Klaviyo doens’t provide the way to trigger custom flow on API call. So it’s possible to send may be a campaign but not to start a customizable  flow in Klaviyo.

 

Badge +2

@db-conception As far as I know, the Klaviyo public API documentation doesn’t seem to expose this functionality, even for “Custom Ecommerce Integrations.”  For example, this probably has a lot to do with the Catalog Feed Integration for Klaviyo to monitor and check inventory/stock status.  Even the Catalog Integration requires consultation with Klaviyo’s Support Team so it may be possible?

I’d be interested to know if it’s possible too!

 

It is strange to see that it is possible for Shopify but not for custom integrations or woocommerce whereas Woocommerce provides webhook for product updated and php hooks for stock changed.:thinking:

 

 

Userlevel 5
Badge +8

Hi there,

It is possible to implement Back in Stock with WooCommerce and Klaviyo using a combination of a custom catalog and API calls. WooCommerce’s standard catalog does not include inventory; as a result, back in stock cannot currently be implemented with the standard WooCommerce catalog. Note: the specifics of setting up a custom catalog for implementing back in stock are covered in our custom catalog documentation, which is not yet publicly facing. If you would like a copy of this information, shoot me a DM.

Once you’ve set up a custom catalog which includes stock for each product, you can make the following API calls to subscribe customers to Back in Stock.

Client-side


$.ajax({
type: "POST",
url: "https://a.klaviyo.com/onsite/components/back-in-stock/subscribe",
data: {
a: "ACCOUNT_ID",
email: "EMAIL",
variant: VARIANT_ID,
product: PRODUCT_ID, // Product must be present in Klaviyo catalog to record event.
platform: "shopify",
subscribe_for_newsletter: false, // Optional with "g". Defaults to false if omitted.
g: "LIST_ID", // Optional with "subscribe_for_newsletter".
},
success: function(response){
console.log(response)
}
})

 

  • a: KLAVIYO_PUBLIC_TOKEN
  • email: the email address of the person (eg. a template tag like {{ email }})
  • g: the ID of the list you want to subscribe them to in addition to the Back in Stock subscription
  • variant: the variant ID of the product (sometimes the same as the product ID)
  • product: the ID of the product
  • platform: the platform from which the request is being sent (we currently accept "shopify", "bigcommerce", or "api")
  • subscribe_for_newsletter: true if you want to subscribe them to a list in addition to the Back in Stock subscription (otherwise false)}

 

Server-side

The API endpoint can allow a platform of api (custom catalogs) or ‘shopify’.  NOTE: if you're using a custom catalog, you'll need to utilize the $inventory_quantity field inside of the custom catalog to track inventory for in/out of stock items

Example call:

curl 'https://a.klaviyo.com/api/v1/catalog/subscribe' --data 'a=AccountID&email=test@klaviyo.com&variant=5000149172256&platform=shopify'

Your POST request must include:

  • a: Your public Klaviyo API Key (6 characters, can be retrieved from https://www.klaviyo.com/account#api-keys-tab)
  • email: The email address entered by the subscriber (must be correctly formatted & valid)
  • variant: The variant ID, for Shopify stores only.
  • platform: shopify

Note: To subscribe a customer to a list as part of the Back In Stock workflow, you will need to make a separate, additional call to our existing List API: https://www.klaviyo.com/docs/api/lists

 

Happy to answer any followup questions.

Best,

Caroline

Badge +2

Hi Caroline,

I am going to try the solution you gave for Woocommerce.
I have sent you a PM about the “custom catalog documentation” you mentioned in your message, it is possible to send it to me please? Thank you.

Also, I read the article for Shopify and BigCommerce (https://help.klaviyo.com/hc/en-us/articles/115003872251-Building-a-Back-in-Stock-Flow), and I don’t understand with your solution how is it possible to manage things such as:

  • Creation of a flow
  • Minimum inventory rules
  • Customer notification rules
  • Back in stock button in Woocommerce

I’m not a tech guy, so I will check it my developer, but if you elaborate on these points, that would be helpful.

Thank you in advance for your help,
Arnaud.

Userlevel 7
Badge +60

Hello @ArnaudLaf,

Just sent you an email pertaining the information required to set up your own custom catalog mentioned by @caroline.

In term of the creation of the flow, the minimum inventory rules, and the notification rules, these would all be controlled within the back in stock flow which is available to you within the Klaviyo Flow Library. You can find this flow even before setting up the custom back in stock event by navigating to the Flow Library and searching for “Back in Stock” as detailed in the Set Up a Back in Stock Flow section of the article you highlighted. 

For the creation of the back in stock button on your WooCommerce site, this would be something you’ll need to custom code and built. You’ll want to build this button to be triggering your custom back in stock event. You can find some examples of how this button is built from the Customizing Your Form & Button sections of both the How to Install Back in Stock for Shopify and How to Install Back In Stock for BigCommerce Help Center articles. 

Have a great day!

David

Badge +1

@david.to I’m interested in implementing this solution too, however the Back In Stock Flow isn’t present in the library unless we have Shopify integrated, which we don’t, because we’re using WooCommerce. Can you point me in the right direction?

 

Can you please also provide me with the custom catalog documentation?

 

Thanks!

Badge +1

Hello!

I faced a problem quite similar as well. While I was able to successfully display the out of stock sign but the back in stock seemed impossible. So what I did was using Custom Stock Status for WooCommerce I changed the rule to show “Back in Stock” when quantity exceeded 1 and show out of stock when quantity was less than 1. While this trick worked I still haven’t been able to set-up back in stock notifications through email.

Help in this matter would be appreciated 

Userlevel 1
Badge +2

With the new API releases, is there any improvement on setting up an easier Back in Stock flow with WooCommerce? Or ideally a native solution as you see with Shopify, is this on the roadmap at all?

It would be great to develop this flow for Woocommerce users who trust Klaviyo.
Userlevel 1
Badge +2

With the new API releases, is there any improvement on setting up an easier Back in Stock flow with WooCommerce? Or ideally a native solution as you see with Shopify, is this on the roadmap at all?

Is there yet any native integration to the Klaviyo WordPress plugin for this functionality, or is it still custom catalog and API required?

Reply