#taylor_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/1434797882564804741
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
to clarify, i mean the invoice field on the charge type for stripe node.js library
i can see it when using cURL but not through node.js
Hmmm, our API docs here shows that the Charge object does not have an Invoice field
Could you send me the request ID for your cURL command
it should look like req_xxx
hmm, im not sure i can see it
You may refer to this guide to locate request IDs in your Stripe account: https://support.stripe.com/questions/finding-the-id-for-an-api-request
using stripe in the terminal with my test key
one moment please
i cant find it there
oh, here it is: req_i4wuHWtUdPNdpx
Ah, the Invoice field is not part of the definitions because not every charge would be tied to an Invoice
oh okay, is there a possible workaround ? like a custom definition?
Hmm, you could do the other way round
where you list Invoices and check for the charges associated to it
i also accept payments with stripe links, is there a way to list those too?
right now i am getting them with checkout_sessions and putting a client reference ID in place of the invoice number, but i dont know if thats the best way.
Ah i see, is your question about how to get all Charges/Payments associated to an Invoice?
yeah, along with payments from stripe links, each with IDs for referencing
i chose charges because it also lists fees and taxes associated with the payment
hmm, could you send me the compilation error for this?
there isnt an error but it doesnt show up in the GET
Oh but thats because not every charge is associated to an Invoice as explained here
Could you send me a Charge Object, where an Invoice field was expected, but not appearing?
for ch_3SIldhLPcIYkk67F0CvurxZi there was an Invoice tied to it.
You can see it under "Connections": in_1SIldgLPcIYkk67FXvDPT16c
hence it was returning in the response
that is from using stripe in the terminal but there doesn't seem to be a way to get the same data via node.js
However, the other charge doesn't have a connection with an Invoice, hence Invoice field is returning as null
it doesnt return with node.js for the objects that have an invoice value either
👋 Hi there! I'm taking over for my colleague. Let me take a look
As mentioned, not every Charge will be associated with an Invoice
Taking a step back, what is it you're trying to achieve? Is there certain information you need to have for every payment that is made?
i am trying to get values from each charge like amount, taxes, fees, etc. for a custom bookkeeping system, and i am able to retrieve the invoice ID from the terminal, but not via node.js
i am aware not every charge has an invoice id, but i am unable to retrieve the ID even when it is present
When you say fees, do you mean Stripe fees?
With the Basil API release earlier this year, there was a breaking change made to support multiple payments for a single Invoice: https://docs.stripe.com/changelog/basil/2025-03-31/add-support-for-multiple-partial-payments-on-invoices
I can see that you were retrieving Charges using an old version of the stripe CLI, which would still have an invoice property on each Charge.