#yashesh - invoice payment history
1 messages · Page 1 of 1 (latest)
Hello. One moment
So just curious. What's your use-case for wanting to access the payment history via the API?
So we could tell our customers why the invoice is still open. That would tell them to update their payment method with us @unborn rampart
Got it
Yeah the way I recommend you do this is through using webhooks. That way you get status updates for the invoice in real time
For example you can monitor invoice.payment_failed and action upon it
And also invoice.payment_succeeded to know when the payment was finally successful
Here's a list of all possible events: https://stripe.com/docs/api/events/types. I would specifically reference the ones that start with invoice.
Got it... that is very helpful. Thanks.
We had evaluated webhooks and decided not to go that route due to non-technical reasons. I guess there is no way to fetch this type of information on-demand?
If you had a specific invoice ID you could retrieve it and expand the PaymentIntent property: https://stripe.com/docs/api/invoices/object#invoice_object-payment_intent. Then, you could look at that PaymentIntent's status https://stripe.com/docs/api/payment_intents/object#payment_intent_object-status
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Really the best and recommended way of dealing with failed payments is to implement webhooks
It will save a lot of headaches
I understand and concur with you. Let me see we can switch to using webhooks. thank you so much.
No problem! Best of luck!