Skip to main content
Solved

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

  • May 17, 2023
  • 4 replies
  • 101 views

Forum|alt.badge.img+2

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?

Best answer by Brian Turcotte

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

4 replies

Brian Turcotte
Forum|alt.badge.img+37
  • Klaviyo Alum
  • 1393 replies
  • May 18, 2023

Hi @mrispoli,

 

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

 

Best,

Brian


Forum|alt.badge.img+2
  • Author
  • Contributor I
  • 1 reply
  • May 19, 2023

@Brian Turcotte any word from the engineering team?


Brian Turcotte
Forum|alt.badge.img+37
  • Klaviyo Alum
  • 1393 replies
  • Answer
  • May 25, 2023

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


Brian Turcotte
Forum|alt.badge.img+37
  • Klaviyo Alum
  • 1393 replies
  • July 20, 2023

Hi @mrispoli!

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

 

Best,

Brian