# How should I handle reverse VAT calculations before sending invoice data through the API?

**URL:** <https://api-discuss.freeagent.com/t/how-should-i-handle-reverse-vat-calculations-before-sending-invoice-data-through-the-api/6668>\
**Category:** Uncategorized\
**Created:** [10 August 2026 07:59 UTC](https://api-discuss.freeagent.com/t/how-should-i-handle-reverse-vat-calculations-before-sending-invoice-data-through-the-api/6668 "2026-08-10T07:59:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sam\_Youl](https://api-discuss.freeagent.com/letter_avatar_proxy/v4/letter/s/b3f665/32.png) [@Sam\_Youl](https://api-discuss.freeagent.com/u/Sam_Youl)\
**Post date:** [10 August 2026 07:59 UTC](https://api-discuss.freeagent.com/t/how-should-i-handle-reverse-vat-calculations-before-sending-invoice-data-through-the-api/6668/1 "2026-08-10T07:59:01Z")

</div>

I’m working with tax-inclusive prices and need to calculate the net amount and VAT amount before sending the values to an accounting system through an API.

For example, if the total amount is **£120.00** and VAT is **20%** , I would expect:

- Gross amount: **£120.00**
- Net amount: **£100.00**
- VAT: **£20.00**

The formula I’m using is:

**Net = Gross ÷ (1 + VAT rate / 100)**

I’m mainly trying to avoid rounding differences when the original amount has more than two decimal places.

I found it useful to verify the calculation with an **[online reverse sales tax](https://reversesalestaxcal.com/) calculator for finding the original price before tax**, especially when testing different VAT rates.  
For developers integrating tax-inclusive invoices, how do you normally handle the rounding—calculate the VAT first and derive the net amount, or calculate the net amount first and then derive the VAT?

---

<div class="post-metadata">

**Author:** ![Andrew\_Stewart](https://api-discuss.freeagent.com/user_avatar/api-discuss.freeagent.com/andrew_stewart/32/149_2.png) [@Andrew\_Stewart](https://api-discuss.freeagent.com/u/Andrew_Stewart)\
**Post date:** [10 August 2026 12:23 UTC](https://api-discuss.freeagent.com/t/how-should-i-handle-reverse-vat-calculations-before-sending-invoice-data-through-the-api/6668/2 "2026-08-10T12:23:42Z")

</div>

If you search the forum you’ll find rounding on invoices has been coming up for a while.

Personally I calculate the net amount using the formula you gave. I post it to FreeAgent via the API and then read back the created invoice’s total value. If it differs from the total value I was expecting, I update the invoice with an extra item that fixes the rounding error, with the extra item’s type depending on whether the rounding error is in the net value or the tax value.
