Skip to main content
Solved

Custom Shopify Back in Stock + Subscribe to List API


Forum|alt.badge.img+2
  • Contributor I
  • 1 reply

Hello! While reading the community forum and developer docs, I got the impression that API calls are possible using regular JS, but anytime I try to request something I get CORS error and that is the end of it. I tried both public and private API keys, AJAX and fetch(), configured the list to be single opt-in and double opt-in. Even used the provided JS script in the docs and used my private email for testing and still it does not work. Is it even possible to do that right now and what am I doing wrong? Here are the links I used for reference: for the list subscription https://developers.klaviyo.com/en/reference/subscribe, and for Back in Stock I found this from one of the accepted answers:

This does not work for me, so If you have any idea why lemme know. Thanks!

Best answer by stephen.trumble

Hey @NemoK 

Thank you so much for asking the Klaviyo Community for help!

The article you linked above is to add users to a subscriber list but it looks like you are trying to create a custom back in stock event while subscribing users to a list? You will need the link the already mentioned with the document I added to build this out! Happy building!

View original
Did this topic or the replies in the thread help you find an answer to your question?

2 replies

stephen.trumble
Community Manager
Forum|alt.badge.img+60
  • Community Manager
  • 1518 replies
  • Answer
  • March 17, 2022

Hey @NemoK 

Thank you so much for asking the Klaviyo Community for help!

The article you linked above is to add users to a subscriber list but it looks like you are trying to create a custom back in stock event while subscribing users to a list? You will need the link the already mentioned with the document I added to build this out! Happy building!


Forum|alt.badge.img+2
  • Author
  • Contributor I
  • 1 reply
  • March 17, 2022

Hey @stephen.trumble! Thanks for reaching out, I guess my dilemma is how to translate this curl request to javascript one: curl 'https://a.klaviyo.com/api/v1/catalog/subscribe' --data 'a=AccountID&email=test@klaviyo.com&variant=5000149172256&platform=shopify'