#bruhhhhh_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/1397956602060869632
đ 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.
- bruhhhhh_invoice-paymentintent-lookups, 15 hours ago, 47 messages
Can you share an example of what you're trying to do?
i'm on Node.js SDK 18.0.0 ⢠Basil by the way
Given a stripe charge id (i.e. given a Stripe Charge object), i want to identify the associated Stripe Invoice object
a TypeScript code snippet on how to achieve this or any high level pointers otherwise would be very helpful
I don't have typescript snippets for you, but given the charge object you can take the payment_intent ID
https://docs.stripe.com/api/charges/object#charge_object-payment_intent
Then you need to use the payment intent ID to get the invoice payments:
https://docs.stripe.com/api/invoice-payment/list#list_invoice_payments-payment-payment_intent
const invoicePayments = await stripe.invoicePayments.list({
payment: {
type: 'payment_intent',
payment_intent: 'pi_123',
},
});
that's helpful thanks!
is it possible for a Stripe BalanceTransaction object to directly have an associated invoice id in one of its fields?
No, it doesn't have that
isn't it possible for the source field of BalanceTransaction object to be an invoice id?
No directly, no, it would be the charge associated with the payment intent that pays the invoice