#yashesh - invoice payment history

1 messages · Page 1 of 1 (latest)

unborn rampart
#

Hello. One moment

#

So just curious. What's your use-case for wanting to access the payment history via the API?

edgy forge
#

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

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

edgy forge
#

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?

unborn rampart
#

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

#

Really the best and recommended way of dealing with failed payments is to implement webhooks

#

It will save a lot of headaches

edgy forge
#

I understand and concur with you. Let me see we can switch to using webhooks. thank you so much.

unborn rampart
#

No problem! Best of luck!