#robinc_api
1 messages ยท Page 1 of 1 (latest)
๐ 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/1486656862865854505
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
hey ๐ the payment_intent property on the Invoice object was removed in API version 2025-03-31.basil, due to the introduction of support for multiple partial payments on Invoices - this changelog page explains the change in more detail:
Hi, thank you. What is the best way to then display if an invoice was (partly) disputed? We don't want to do an API call per invoice since this is not scalable.
You guys do this very well and we want to be able to do the same ๐
yeah I can understand your point but I'm afraid since the Invoice object doesn't directly contain a reference to the PaymentIntent, the API call is necessary to check the payment's status
If we can expand this field (inside invoice.payments) I think we are helped
stripe invoices list --customer="cus_UDHQ1sHNHIaPoB" --expand="data.payments.data.payment.payment_intent"
You cannot expand more than 4 levels of a property. Property: data.payments.data.payment.payment_intent
It says expandable in the docs, how does this then work?
yes it's possible to expand the payments.data.payment.payment_intent property on the Invoice object
so for example, if you're retrieving an Invoice via the API, you can pass expand: ['payments.data.payment.payment_intent] as a param and your response will include the full PaymentIntent object, nested within data.payment in the payments hash
so if you're already retrieving or listing Invoices, this is an option for you, but you would still need to make an API call to get this data from the Invoice object
try `expand: ['data.payments.data.payment.payment_intent']
I did above,
โ ๏ธ You cannot expand more than 4 levels of a property. Property: data.payments.data.payment.payment_intent
๐ซ
So close to the solution ๐
ahh yes sorry it's because you're listing invoices, so you have an extra level to go through
if you retrieve the invoice directly it works, but not with listing for this reason - I was mistaken above
what's your starting point here? are you trying to get the payment state from the customer ID?
Getting the invoices from the customer, to display them
With their status
And show a โ ๏ธ or Disputed if one of the payments are disputed
I see, so the customer ID is your starting point then - I'm afraid that it's not possible to do this via the API in any other way than retrieving each Invoice individually
this is definitely something that has scope for improvement on our side
due to this exact limitation of expanding up to 4 levels max, it's not possible to get this when listing all invoices for a customer
this is definitely something that has scope for improvement on our side
Can I follow up this feature request somewhere or open a feature request? So that we know when we can implement it on our side.
we can definitely file feedback with our product team but it's something that we can provide a timeline for at the moment