#hamidm-tax-avalara
1 messages · Page 1 of 1 (latest)
Hi there!
Hmmm okay so your desired behavior here is to have the tax amount be equal to the invoice amount for the full cycle as opposed to the prorated amount?
No, in fact we need the tax amount to equal the subtotal of the invoice (remaining seats - unused seats) and not be calculated on the remaining seats item only, as it’s doing right now.
Can you provide me an invoice ID that I can look at where this is happening?
This is the invoice https://dashboard.stripe.com/test/invoices/in_1LeOqBC7aZ1kKv4ZU88UsWtK
Ah okay so you are saying that because this is a migration and tax wasn't calculated on the "previous" invoice, you want tax to be applied based on the total of the invoice, which includes the prorated credit, instead of on the new line item.
Yeah this is tricky. Not really possible to do this (as you said... expected behavior at the moment).
Let me think about whether there might be a workaround here
Yes exactly. Thanks for looking into this.
It is paramount that we find a workaround on this case, since otherwise it would mean that we'd have inaccurate sales tax calculations, charges and filings on such invoices and that would be reflected to our customers
Okay the workaround will be a little convoluted but I think this will handle it:
1/ before you update you preview the upcoming invoice with the update using: https://stripe.com/docs/api/invoices/upcoming. This will give you all of the details: each line item and the tax amount.
2/ You calculate on your end the total amount that would be taxed (using the tax %) if it was calculated on both line items instead of just the one upgrade line item.
3/ You calculate the difference in tax amount based on step 2 and what would actually be included on the invoice.
4/ You create an invoice item (https://stripe.com/docs/api/invoiceitems/create) for the difference in tax amount.
5/ You now upgrade the Subscription. The new invoice picks up the invoice item so that the tax calculation is accurate.
Like I said, a bit convoluted but I think it will work. You definitely should test it. Let me know if any of those steps don't make sense?
Thanks a ton. We’ll be looking into this shortly
As I get it you are saying to create a manual invoice and do all the calculations manually. But when I upgrade subscription it will create another draft invoice with these prorated items, am I right?
Not really. You preview the upcoming invoice (so that you can see the calculations that will happen), then you create an invoice item to correct the calculation to what you desire. And this invoice item will be swept up in the newly generated invoice from the upgrade.
So there should be 3 invoice items in the upcoming invoice when we add this item for difference of tax?
Correct
It is a bit convoluted but we will give a try and see if it works
👍