#ivan_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/1359068740976640060
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi! With the recent updates in Basil, the payment_intent field has been removed from the Invoice object [0]. Instead, we've introduced a new field called payments. To get the payment_intent ID, you can expand latest_invoice.payments and then access it via payments.data.payment.payment_intent [1].
[0] https://docs.stripe.com/changelog/basil/2025-03-31/add-support-for-multiple-partial-payments-on-invoices#why-is-this-a-breaking-change
[1] https://docs.stripe.com/api/invoices/object?api-version=2025-03-31.basil#invoice_object-payments-data-payment-payment_intent
Thank you for the quick response! Do you mean I should be going from invoices to payments intents instead? So far, we have been going in the other direction: listing payment intents and expanding invoices inside. If I want to preserve that, I would have to list invoices first and then inside see which payment intents they belong to to be able to later on connect to payment intents. Is this how I should do it, or is there a better way?
Have you been listing invoices or payment intents?
Payment intents.
Let me check! Just a moment!
👋 taking over for my colleague. Let me know if there's any follow-up Qs I can answer!
@tacit cliff why are you saying that the invoice is no longer available?
Our workflow has been to list payment intents while expanding invoices inside, which is not longer available. I am wondering how to get invoices back into payment intents.
Given a payment intent, how do I find the corresponding invoice?
which is not longer available
at what point?
When passing expand.
it's only null until the checkout.session.completed is complete
this is weird to be honest
I'm checking with my colleagues
Maybe I misunderstood. We are doing like this:
expand: ['data.invoice.subscription']
And then it complains that it cannot do that. They I read in the changelog that invoice was removed from payment intents.
would you mind sharing the request ID that is failing?
OK, wait a second. Let me create one.
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
I realize now that it complains about subscription actually.
Yeah… Sorry. So you are saying the changelog is not correct and the invoice can still be expanded…
OK, should I ask a separate question about subscription, or would you not mind taking it here?
it's a bit more complicated than that...
Tried removing .subscription and got an error about invoice: https://dashboard.stripe.com/logs/req_3tyj3IIEG6GsZL?t=1744099965
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
yes it's not going to work
now you need to use https://docs.stripe.com/api/invoice-payment/retrieve to get the invoice information for a PaymentIntent
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
unless you need any of the changes introduced in https://docs.stripe.com/upgrades#2025-03-31.basil I highly recommend not upgrading to this API version since it has this and other breaking changes
Well, we want to stay up to date.
It would make sense to update however painful it might be.
ok let me know if I could help with that
But how do I get this invoice payment ID from a payment intent?
#1359068740976640060 message
like this
and you would filter by passing https://docs.stripe.com/api/invoice-payment/list#list_invoice_payments-payment
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
I cannot access the last link, but the first one says I need to have an invoice payment ID.
sorry my bad! I sent the retrieve API instead of the list
So first I need to list all invoices. Then for each invoice, I need to list all payments. And in there, I would be able to find payment intent IDs.
no you can still start by PaymentIntents
and for each PaymentIntent you have to list the Invoice Payments and filter by PaymentIntent ID
But I need to pass the mandatory invoice, no?
no
Aha, it is not mandatory. I see.
you'd pass payment.type and payment.payment_intent
OK, then I do as you say. First list all payment intents, and for each payment intent, I try to list invoice payments.
if you have feedback about this change I highly encourage you to write to https://support.stripe.com/?contact=true
Find help and support for Stripe. Our support site provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
Although, it would probably be more efficient to list all payment intents and all invoice payments and then in my code, do the matching.
Thank you for the help!
I didn't mean my last message as to cut this conversation short
but we're collecting feedback about this change that's why I'm encouraging you to do so
I understand. I do not feel comfortable lobbying for something here. You made that change for a reason. It is just that our original usage was weird to begin with, and this is why it now feels this uncomfortable now.
sure