#brokensparks_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/1506696817566552355
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
hello! looking at this now
so basically you have a charge ID and you want to identify the invoice ID that originated it, right?
which API version are you on? do you have an example invoice / charge?
Is there any additional info you need?
hello! i already asked for some additional info, can you share what API version you're using or an example invoice / charge?
Hi sorry, we can't see discord responses on my friends machine for some reason - only his sent messages to you
oh that's odd
we aren't using the api yet, could use any version that has invoice_id attached to it
our goal is to log all charge_obj data in our sql db, and relate it to a invoice_id parent record
but did not see the invoice_id on charge_id body
so wondering if it exists at all on charge obj, or if we should use a different access pattern entirely?
If different access patter, do you have any suggestions for the best way to implement?
gotcha. yeah, we removed the 1:1 relationship between invoices and charges in our basil releases, so you need to go back to 2025-02-24.acacia or earlier to see invoice directly on the charge (which i would not recommend for tech debt reasons)
https://docs.stripe.com/api/charges/object?api-version=2025-02-24.acacia&rds=1#charge_object-invoice
for basil+ API versions you'll want to retrieve the charge and save the payment_intent:
https://docs.stripe.com/api/charges/object?api-version=2026-04-22.dahlia&rds=1#charge_object-payment_intent
then call the list invoice payments API and pass that PaymentIntent ID in:
https://docs.stripe.com/api/invoice-payment/list?api-version=2026-04-22.dahlia&rds=1#list_invoice_payments-payment-payment_intent
Okay, great, thanks so much
Thank you!