#daviddd_api

1 messages ¡ Page 1 of 1 (latest)

native pantherBOT
#

👋 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/1394896943423160350

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

keen sluice
#

Hi! I see you're using the API version 2025-03-31.basil. In that release, a breaking change was implemented: the removal of the Payment Intent field from the Invoice object [0]. To access the charge associated with an invoice, you'll now need to expand the payments [1] parameter. The payment intent object ID can be found under payments.data.payment.charge. From there you can expand the charge object to get the refund object.

[0] https://docs.corp.stripe.com/changelog/basil/2025-03-31/add-support-for-multiple-partial-payments-on-invoices
[1] https://docs.stripe.com/api/invoices/object#invoice_object-payments-data-payment-charge

torn anvil
#

req_gKgIzwe2xQhI10 , i use payments.data.payment.charge but not found charge, charge field is null

#

in the stripe dashboard , i found the dash response contains charge_id

keen sluice
#

So the charge object is only surfaced if it's not associated with a payment intent. If it's, then the Invoice Payment surfaces the payment intent instead. So in your case you can expand payments.data.payment.payment_intent . This will give you the latest_charge. And then you can separately retrieve the charge object (https://docs.stripe.com/api/charges/object).

torn anvil
#

yes, it work

#

can i use payments.data.payment.payment_intent in Invoice.list api ?

#

it will expand more than 4 levels of a property

keen sluice
#

Yeap you can only expand up to 4 levels.

torn anvil
#

how can i use invoice.list to get each invoice with their latest_charge?

keen sluice
#

You can expand data.payments.

torn anvil
#

it not work, the invoice.list api return charge:null