Hey,
I have a subscription based app, where I am using two webhooks with Stripe:
-
invoice.payment_succeeded
in one API endpoint -
invoice.payment_failed
in another API endopoint
The first one is for when a user subscribes correctly and each month sends the user an email.
The second one is when a user’s payment method is declined (insufficient funds, etc…), and also send an email to the user.
When a user tries to subscribe for the first time and the payment is declined (I am using one of this cards to try this), the invoice.payment_failed
is triggered, but in Stipe it appears that the webhook had a 400 error
. I thought the invoice.payment_failed
was only triggered if a consequent payment’s charge failed, no the first payment.
So, I have a few questions:
- Is the
400 error
really an error or it should be fixed by checking Return a 200 if condition is not met? - What are the most used / correct Stripe events for a subscription based app?
Thanks in advance