#taxeve_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/1304445330770890772
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- taxeve_api, 2 days ago, 18 messages
hi! generally you can set metadata when creating the Invoice. https://docs.stripe.com/api/invoices/create#create_invoice-metadata
And how can we get it back in the webhook call?
I don't think it is coming back in "invoice.paid"
it should if you pass it to that field
if you find that it's not, please share a specific example like an Event evt_xxx and so on
So, I am getting the metadata.
But for some reason I am unable to read one of the 2 fields.
Please check this: evt_1QItCxAOVYJllwBvapQHyAw1
I am able to read the taxyear field, but not able to read the uid field, I am getting this error:
SyntaxError: Unexpected token f in JSON at position 2
will have a look, in the meantime can you explain what exact code causes that error when run?
Yes, I am doing this:
const session_id = sessionData.object.id;
const taxyear = JSON.parse(sessionData.object.metadata.taxyear);
const uid = JSON.parse(sessionData.object.metadata.uid);
The 3rd line here causes the error.
you don't need to JSON parse it, it's not JSON
like it's just const uid = sessionData.object.metadata.uid; ; our SDK already constructed an object so that works
you'd only use JSON.parse here if the actual value you put in the metadata was a string like "{\"foo\":42}" etc
Okay, understood.
It is working now. I have been JSON parsing metadata for last 1 year for another project.
Thank you!
happy to help