#consobs-vp_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/1375393923069116418
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
hi there!
what's your goal? find the Invoice ID related to this PayementIntent?
Yes that's correct
Then you need to make an extra API call to this endpoint: https://docs.stripe.com/api/invoice-payment/list?api-version=2025-04-30.basil
You pass the PaymentIntent ID, and you'll get back the assocaited Invoice.
Ah OK. some paymentintents do list the invoice, it's just that this particular one has it as null for some reason
this is something that changed in the latestet API version.
- if you use an old API version, you'll see the
invoicedirectly on the PaymentIntent - if yuo use the latest API version, then yuo need to make an extra API call as explained above
Got it, that works. Or can i use the events API to keep a track instead?
Or can i use the events API to keep a track instead?
what do you mean by this? can you be more precise?
I can look for payment_intent.succeeded event and keep a list of pi_id and matching invoice_id, correct?
and keep a list of pi_id and matching invoice_id
but how do you make the match?
in this invoice.payment_succeeded event there's a match
"object": {
"id":
"in_1RF7Bw2NtvlMLsl8FYyey6Bt"
,
"object":
"invoice",
"amount_due":
898000,
"charge":
"ch_3RF88f2NtvlMLsl80C8sfP4f"
,
"currency":
"usd",
"customer":
"cus_S7vV0yJ8h3qTqJ"
,
"default_payment_method":
null,
"default_source":
null,
"number":
"F6B74119-0010",
"payment_intent":
"pi_3RF88f2NtvlMLsl80YfRGafa"
,
"period_end":
1744953020
,
"period_start":
1744610590
,
"status":
"paid",
"subscription":
"sub_1RDg6s2NtvlMLsl8r1i1KZvt"
,
in the latest API version, Invoice objects don't contain a payment_intent property.
OK, will take a look. thanks for the help!