#taylor_api

1 messages · Page 1 of 1 (latest)

sly iglooBOT
#

👋 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.

grim rampart
#

hey! Apologies for the wait!

#

Looking into this now!

stark pewter
#

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

grim rampart
#

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

stark pewter
#

hmm, im not sure i can see it

grim rampart
stark pewter
#

using stripe in the terminal with my test key

#

one moment please

#

i cant find it there

#

oh, here it is: req_i4wuHWtUdPNdpx

grim rampart
#

Ah, the Invoice field is not part of the definitions because not every charge would be tied to an Invoice

stark pewter
#

oh okay, is there a possible workaround ? like a custom definition?

grim rampart
#

Hmm, you could do the other way round

#

where you list Invoices and check for the charges associated to it

stark pewter
#

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.

grim rampart
#

Ah i see, is your question about how to get all Charges/Payments associated to an Invoice?

stark pewter
#

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

grim rampart
#

hmm, could you send me the compilation error for this?

stark pewter
#

there isnt an error but it doesnt show up in the GET

grim rampart
#

Could you send me a Charge Object, where an Invoice field was expected, but not appearing?

stark pewter
#

as in the GET json output?

grim rampart
#

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

stark pewter
#

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

grim rampart
#

However, the other charge doesn't have a connection with an Invoice, hence Invoice field is returning as null

stark pewter
#

it doesnt return with node.js for the objects that have an invoice value either

sly iglooBOT
shut patrol
#

👋 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?

stark pewter
#

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

shut patrol
#

When you say fees, do you mean Stripe fees?

stark pewter
#

yes, and im able to retrieve them with node.js

#

i am only missing the invoice field

shut patrol
stark pewter
#

ah i see, that explains it. looks like i will have to come up with a different way to do it

#

thank you both for your help