Hey Beth,
What happens if you try sending as x-www-form-urlencoded instead of json like this:
fetch("https://a.klaviyo.com/onsite/components/back-in-stock/subscribe", {
"headers": {
"accept": "application/json, text/plain, */*",
"content-type": "application/x-www-form-urlencoded;charset=UTF-8",
},
"body": new URLSearchParams({
"a": "your klaviyo account here",
"email": "nateklaviyo@gmail.com",
"platform": "shopify",
"variant": 123456789, //replace with a valid variant ID
"product": 987654321, // '' '' '' '' product ''
}),
"method": "POST",
})
.then(response => {
console.log(response);
})
.catch(err => {
console.error(err);
});