#luc_invoice-paymentintent-charges

1 messages ยท Page 1 of 1 (latest)

torn talonBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

๐Ÿ”— This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1263237589083619481

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

harsh mason
#

Hi ๐Ÿ‘‹

The relationship goes like this: Invoice -> Payment Intent -> Charges

So to get the related Charges for an Invoice you follow this relationship

#

If all you want is the latest_charge, you can get all this data in a single API call by passing expand=[payment_intent.latest_charge'] when you retrieve the Invoice.
https://docs.stripe.com/expand

quartz wharf
#

thank you! one last question, can an invoice be related to more than 1 charge?

harsh mason
#

Yes. If the customer attempts a payment and it fails that will generate a charge. Then, if the customer attempts to pay again and it succeeds that will generate another charge.

quartz wharf
#

I mean, "to more than one successful charge"**

harsh mason
#

Ah, no

quartz wharf
#

good, then!

#

thank you! you are amazing!

harsh mason
#

Once a Charge is successful, the Payment Intent and Invoice transition to succeeded/paid and cannot be used again.

#

Happy to help