Solved

Attempting to send back in stock subscription over legacy API keeps failing...

  • 17 May 2023
  • 4 replies
  • 52 views

Badge

I am attempting to send a back in stock subscription using the legacy API endpoint. I’m using the node fetch API and sending a POST request with the following code;

 

const formData = new URLSearchParams();
formData.append('a', KLAVIYO_PUBLIC_API_KEY);
formData.append('email', email);
formData.append('variant', variantId);
formData.append('platform', 'api');

const klaviyoRes = await fetch(`${KLAVIYO_BIS_API_URL}/subscribe`, {
method: 'POST',
headers: {
'content-type': 'application/x-www-form-urlencoded',
},
body: formData,
});

 

I keep getting a response back that this endpoint does not accept a GET request from Klaviyo. Anyone have a node implementation that works here or uses one of their SDK’s for this?

icon

Best answer by Brian Turcotte 25 May 2023, 19:10

View original

4 replies

Userlevel 7
Badge +36

Hi @mrispoli!

Just wanted to give you a heads up that our new Back in Stock APIs just launched!
 

 

Best,

Brian

Userlevel 7
Badge +36

Hi @mrispoli!
 

My apologies for the delay - would you be willing to provide the exact response you are receiving (with any sensitive information redacted)?

This would help myself/Engineering understand the issue a little better.

In the meantime, I would say that back in stock calls must be made in accordance with this guide:

To that end, I would recommend reading through that guide and double-checking that your API calls are structured thusly.

 

Best,
Brian

Badge

@Brian Turcotte any word from the engineering team?

Userlevel 7
Badge +36

Hi @mrispoli,

 

I am going to check with Engineering on this one, and I will update the thread as soon as possible!

 

Best,

Brian

Reply