#tom_api

1 messages ยท Page 1 of 1 (latest)

slender lynxBOT
#

๐Ÿ‘‹ 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.

fierce crater
#

I note the invoice ID in_1Sp5JwIq2o1LAhVTxb8GAS cannot be retrieved, but adding st to the end does retrieve it, EG: in_1Sp5JwIq2o1LAhVTxb8GASsT

fierce island
#

hi there, looking into this now

fierce crater
#

Thank you

fierce island
fierce crater
#

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

fierce island
#

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

fierce crater
#

Understood, given the event: evt_3Sp6KxIq2o1LAhVT3yNStTOf

Can you guide me on how to retrieve the invoice ID?

fierce island
#

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

slender lynxBOT
fierce crater
#

To use the invoice payments list, I would need the invoice ID right?

candid copper
#

Hi there! I'll be taking over for denton, who needed to step away

fierce crater
#

Thank you

#

This is broken in production for us so is a little urgent ๐Ÿ™‚

candid copper
#

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.

https://docs.stripe.com/api/invoice-payment/list?lang=curl

fierce crater
#

Gotcha let me just try this out

#

Think it's working give me a few more mins

candid copper
#

No problem; I'm here

fierce crater
#

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 ๐Ÿ™‚

candid copper
#

You're talking about order_reference ?