I am trying to deploy my web app but I keep getting errors 405, 500 etc. I also noticed that Stripe webhook links and other APIs under apis/webhook/* folder gives a 405 method not allowed error. How do I fix this and this is very frustrating. I tried numerous solutions online including CORS and they don't work. The API endpoints were working on the *.vercel.app domain but not on my custom domain...
I am expecting for webhook events and API calls to be successful.
Give me a solution, my website is fhotosonic.com and I am using Node.js and Next.js framework.
The domain troubleshooting guide can help with most custom domain configuration issues. You might be able to use that guide to solve it before a human is available to help you. Then you can come back here and share the answer for bonus points.
You can also use v0 to narrow down the possibilities.
Vercel Staff
Hi , welcome to the Vercel Community!
Sorry that you're facing this issue.
Can you confirm whether the endpoint in the api/webhook/ folder are POST? Because this is the method that Stripe expects.
If you need more help, please share your public repo or a minimal reproducible example. That will let us all work together from the same code to figure out what’s going wrong.
How do I confirm this?
I believe Anshuman meant that the webhook handler file in that folder should be configured to accept POST requests. Could you share a minimal reproducible setup of your code that can help ensure we are all on the same page?
Here's the code for both /api/webhooks/stripe and stripe.ts, It worked fine on vercel.app domain (which I unfortunately deleted after connecting custom domain) but doesn't work on my custom domain.
The error I keep getting is 405 error "Cannot connect to remote host" when viewing events in Stripe dashboard....
Hi , thanks for sharing the additional context. From the code, I'm not sure if we should get a 405. Can you share the URL you are putting in the Stripe dashboard?
This topic is closed. It no longer accepts new replies.