#acffaria91-webhook-404

1 messages ยท Page 1 of 1 (latest)

viscid dagger
#

Hello ๐Ÿ‘‹
Can you verify if the URL you have set as a webhook endpoint is correct?

#

as well as it is reachable?

serene fog
#

I'll check, but if it's the same as the localhost shouldn't it be ok? (I'm new to stripe and I'm still understanding the basics)

#

I get this error: Cannot POST /webhooks/stripe

viscid dagger
#

When you say live, you mean a webhook hosted on a remote server correct?

serene fog
#

I mean in my actual website that is online. It's a nodejs hosted on a windows server

viscid dagger
#

Okay so what URL have you registered as a webhook endpoint?

serene fog
viscid dagger
#

I'd recommend checking your server logs to see what's causing the POST request to fail here

I get this error: Cannot POST /webhooks/stripe
Where exactly are you seeing this error?

serene fog
#

but in the logs

pine wyvern
#

๐Ÿ‘‹ stepping in here.

#

So yeah that 404 in your first screenshot indicates that is what is being returned from your Server when the webhook is sent.

#

Can you share your webhook code?

#

Also can you share one of those event IDs

#

It looks like evt_xxxx

serene fog
#

evt_1L1B9eBOIcgIIZ17vCQm5wm0

pine wyvern
#

So that event is invoice.payment_succeeded but doesn't look like you have code in your handler for that event type.

#

Before worrying about that, can you add a log at the beginning of your handler for req.body and then trigger a new event

#

And see if your endpoint is getting hit at all?

serene fog
#

sorry, I send the 1st one, this one I have in my code: evt_3L1B9NBOIcgIIZ170QWpDjJg

I'll add the log and check

#

I got no log

pine wyvern
#

Yeah okay

#

So the issue lies in your server itself

#

You will need to talk to your hosting provider for why your endpoint isn't getting hit at all.

serene fog
#

I'm hosting on a windows server, do you think that might be impacting something?

pine wyvern
#

Hmm though shouldn't your endpoint be /webhooks/stripe?

#

Since you are using an Express router

#

Shouldn't that match?

serene fog
#

I'll try, I had this website done by someone else a few years ago and I'm updating for the new checkout. A lot of things I'm figuring out as I go. Because it worked on localhost with the stripe CLI I though it would be ok

#

but I'll try that

pine wyvern
#

The other option is to change the endpoint in your Dashboard to /webhook

serene fog
#

it worked!! ๐Ÿ˜

#

thank you so much, and sorry for such a rookie mistake!!

pine wyvern
#

No need to apologize!