#radu-dumitru_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/1228350205498490881
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
there is a typo in my question
specifying the VAT amount in another currency*
What's the error you get in your webhook endpoint?
When trying to update the invoice?
you cant edit a paid invoice
the webhook is triggered only when "Pay" is pressed and I think my modification reaches Stripe after the invoice is set on paid
this is my best guess
๐ stepping in
hi there
Yeah finalized Invoices are mostly immutable. This is due to regulatory restrictions.
You can modify things like custom fields while the Invoice is in draft
But you still won't know the tax amount at that point if you are using auto tax
yep
I depend on auto tax because I use one time payment, there are no accounts involved sadly
Hmm actually
You should be able to use the Upcoming Invoice API right before you create or finalize your Invoice to figure out the tax amount: https://docs.stripe.com/api/invoices/upcoming
hmm I guess I can catch customer.created and query for upcoming invoice
I will give it a try, thank you
sadly it is not working because I can't find any upcoming invoices, I tried on multiple events
I guess Checkout just creates an invoice without an upcoming invoice?
Oh sorry, I misunderstood what you meant. You need to pass invoice_items: https://docs.stripe.com/api/invoices/upcoming#upcoming_invoice-invoice_items to simulate what will be added to the Invoice
So basically you would need to mirror what you would actually do when you create the Invoice (or what you already did)