#sandra_best-practices
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/1471167973648760985
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
This was changed in Basil
You have to expand the individual invoice payments: https://docs.stripe.com/changelog/basil/2025-03-31/add-support-for-multiple-partial-payments-on-invoices#inspect-the-array-for-payment-information
Hi!
so is there no way to avoid n + 1 requests? (1 for the invoices list and N per invoice)??
because the payment doesn't have refunded or disputed at the first level
we tried this and get an error due to the levels of the expand because we need to list the invoices
so when we list them, we expand data.payments.data.payment.charge
Ah ok
Yeah unfortunately it will be multiple calls then
Or you can use the older api version
Ok, thanks! Another option we thought was using the charges API instead but then we lose the data about attempted payments
Really I don't recommend calling our api to render a UI at all tbh
I recommend listening to webhook events so you can store the data in your database
And then every time the page loads, you just query your db
This will reduce liklihood of your account getting rate limited
Hmmm ok, I'll let know the team, thanks for the suggestion
tbh our first option was to use the customer portal but then the users could pay invoices after their subscription is cancelled
in any case, thanks for your help!!
No problem