#Nancy-webhook-api-versions

1 messages · Page 1 of 1 (latest)

vast currentBOT
#

Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

autumn oasis
#

So when i run the code in our default - 2017 version it works, but when I change the setting to latest it error 404.

silent cradle
#

I tried different ways to fix it by specifiying the api version, but still running into error.
Can you share more about how you're doing this?

autumn oasis
silent cradle
#

And can you provided an example test event ID that failed delivery which i can inspect?

autumn oasis
#
  try {
    await stripe.subscriptions.create({
      customer: customerID,
      items: [
        {
          price: subscriptionPriceID,
        },
      ],
      metadata: {
        'Student Name': 'Test LastName',
      },
    });
  } catch (err) {
    console.log(`********ERROR**************${err}`);
  }
};

createSubscription();
#

i am testing a simple create subscription event

silent cradle
#

Taking a look at that example, thanks

#

Your server is returning this 404 error and an indication that the endpoint can't be reached

#

You'll need ot investigate why it's doing that in your code and server logs

#
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Error</title>
</head>
<body>
<pre>Cannot POST /webhook/stripe</pre>
</body>
</html>
#

That's the response body from your server

autumn oasis
#

gotcha

#

does the version of API matter?

#

cuz it works when I am on 2017 which is our default version and I am testing a new webhook with 2023 and it does work

silent cradle
#

I don't see why the API version of the event request would matter, but it's possible your code rejects objects with an unexpected structure with 404

#

Can you share your webhook endpoint code?

autumn oasis
#

Sorry, found the error!

#

I have another question, can you by any chance update the webhooks api version once it's created?

silent cradle
#

No, that's immutable, you'd need to create a new endpoint to set a different API version