#tom_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/1460672755186798826
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
I note the invoice ID in_1Sp5JwIq2o1LAhVTxb8GAS cannot be retrieved, but adding st to the end does retrieve it, EG: in_1Sp5JwIq2o1LAhVTxb8GASsT
hi there, looking into this now
Thank you
that field is truncated to 25 characters https://docs.stripe.com/api/payment_intents/object#payment_intent_object-payment_details-order_reference so it's cutting off the end of the Invoice id
if you need to find Invoices that use a particular Payment Intent, you can use the Invoice Payments List API endpoint https://docs.stripe.com/api/invoice-payment/list#list_invoice_payments-payment-payment_intent
Oh dear, so is this a bug?
My issue is I'm working on quite an old payments system, we have a horrible pattern where we need to fetch the invoice ID given a charge ID using the .net SDK.
The only way I can see to do this is first retrieve the PI, then from the PI retrieve the paymentdetails.order
I believe this is intended behavior, as that field is meant to be used for supplying additional information to the card networks and the 25 char limit is imposed by them. it's not meant to be used as a reference for the invoice that created the Payment Intent
Understood, given the event: evt_3Sp6KxIq2o1LAhVT3yNStTOf
Can you guide me on how to retrieve the invoice ID?
My issue is I'm working on quite an old payments system, we have a horrible pattern where we need to fetch the invoice ID given a charge ID using the .net SDK.
gotcha, so I think what you'll need to do is use the Invoice Payments List method I linked to. this was a change introduced in the Basil API version to support partial payments on Invoices, which means there's no longer a one-to-one relationship between PIs and Invoices https://docs.stripe.com/changelog/basil/2025-03-31/add-support-for-multiple-partial-payments-on-invoices#use-the-new-for-payments-and-invoice-connection
To use the invoice payments list, I would need the invoice ID right?
Hi there! I'll be taking over for denton, who needed to step away
There are a few ways you can use the Invoice Payments List method/endpoint - you can provide an Invoice id as an argument and get all payments on an Invoice, but you can also give it a Charge or PaymentIntent and get the specific Invoice Payments associated with that PaymentIntent or Charge, and that object (the Invoice Payment) will tie the Invoice and PaymentIntent/Charge together.
No problem; I'm here
OK I think this is now working thanks for your help, much appreciated.
Just as a suggestion, I feel if an object ID is written to a truncated field, it should perhaps end with "..." to avoid confusion. Feel free to ignore my suggestion of course, you guys know best.
Many thanks for your help ๐
You're talking about order_reference ?