#mangle_invoice-payment-intent-relationship
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/1399507317451657239
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- mangle_invoice-proration-credits, 15 minutes ago, 69 messages
Hello ๐
This is because, with the basil API and newer, Payment Intents are no longer directly linked to Invoices
Okay, and how can i retrieve the subscription id in charge.refunded
If you want to go from a Payment Intent to it's related Inovice, you need to use the Invoice Payments list API
I just need to update a referral based on subscription id when user refunds
but subscriptionId is not on charge.refunded and on last API i was getting it through invoice
You need to filter this list API using the Payment Intent ID to get to the Invoice and from there you can get the Subscription
const invoicePayments = await stripe.invoicePayments.list({
payment: {
payment_intent: 'the payment intent id'
}
});
like this?
i will get only one invoice right? array of 1 object
if i don't send invoice id it's not required right?
In Python this would look like
invoice_payments = stripe.InvoicePayment.list(
payment={
"type": "payment_intent",
"payment_intent": "pi_XXXXXXXX" # <= this is where you put the ID
}
)
nice, and i will only one invoice object in that array in the response right?
Yes, One invoice can be related to multiple Payment Intents but each Payment Intent will be related to 1 or 0 Invoices
But since this list API needs to work both ways (Invoice => Payment Intents, Payment Intents => Invoice), we always return a list
nice, give me 1 minute to try it
I got the subscription id from invoice.parent now. All good
Thank you very much!
This basil new api requires you to do a lot of stripe calls
i hope it won't be an issue on the rate limiter to stripe
if an app has a lot of users, talking in general i mean
Do you know the limit of the rate limiter on the stripe API, just curious
I mean even for invoice.paid, i had to do some extra calls to get the payment_intent on new Basil Api, and before i was getting it on the event
We document this here: https://docs.stripe.com/rate-limits
And yeah, the basil API does wind up causing more API requests
100 requests per second, above that i hope it queues. I will read the documentation. Thank you