Skip to main content
Contributor I
May 17, 2023
Solved

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

  • May 17, 2023
  • 4 replies
  • 154 views

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?

    This topic has been closed for replies.
    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
    Klaviyo Alum
    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

    mrispoliAuthor
    Contributor I
    May 19, 2023

    @Brian Turcotte any word from the engineering team?

    Brian Turcotte
    Klaviyo Alum
    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
    Klaviyo Alum
    July 20, 2023

    Hi @mrispoli!

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

     

    Best,

    Brian