#ivan_api

1 messages · Page 1 of 1 (latest)

narrow falconBOT
#

👋 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.

ivory shard
#

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

tacit cliff
#

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?

ivory shard
#

Have you been listing invoices or payment intents?

tacit cliff
#

Payment intents.

ivory shard
#

Let me check! Just a moment!

narrow falconBOT
zinc quail
#

👋 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?

tacit cliff
#

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?

zinc quail
#

which is not longer available
at what point?

tacit cliff
#

When passing expand.

tacit cliff
zinc quail
#

it's only null until the checkout.session.completed is complete

#

this is weird to be honest

#

I'm checking with my colleagues

tacit cliff
#

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.

zinc quail
#

would you mind sharing the request ID that is failing?

tacit cliff
#

OK, wait a second. Let me create one.

#

I realize now that it complains about subscription actually.

zinc quail
#

it's not saying that the invoice cannot be expanded

#

yes exactly

tacit cliff
#

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?

zinc quail
#

it's a bit more complicated than that...

tacit cliff
zinc quail
#

yes it's not going to work

tacit cliff
#

It cannot expand invoice, it seems.

#

OK, the changelog is fine then 🙂

zinc quail
tacit cliff
#

Well, we want to stay up to date.

#

It would make sense to update however painful it might be.

zinc quail
#

ok let me know if I could help with that

tacit cliff
#

But how do I get this invoice payment ID from a payment intent?

zinc quail
tacit cliff
#

I cannot access the last link, but the first one says I need to have an invoice payment ID.

zinc quail
#

sorry my bad! I sent the retrieve API instead of the list

tacit cliff
#

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.

zinc quail
#

no you can still start by PaymentIntents

#

and for each PaymentIntent you have to list the Invoice Payments and filter by PaymentIntent ID

tacit cliff
#

But I need to pass the mandatory invoice, no?

zinc quail
#

no

tacit cliff
#

Aha, it is not mandatory. I see.

zinc quail
#

you'd pass payment.type and payment.payment_intent

tacit cliff
#

OK, then I do as you say. First list all payment intents, and for each payment intent, I try to list invoice payments.

zinc quail
#

if you have feedback about this change I highly encourage you to write to https://support.stripe.com/?contact=true

tacit cliff
#

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!

zinc quail
#

but we're collecting feedback about this change that's why I'm encouraging you to do so

tacit cliff
#

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.

zinc quail
#

sure