Sales_tax_rate is not a number error


A user receives the error: sales_tax_rate is not a number error when
exporting an expense to freeagent. (live)

amount: 35.40 gbp, VAT Percentage: 20%

When we export exactly the same data to our test account in freeagent, it

Any idea why it fails for that user?

Thx in advance,

Hi Kenny,

I’ve had a dig through the error logs and think I have identified the
problem. I can see several attempts at creating an expense that create
an error which match the amount and VAT percentage you’ve listed.
However, in these cases, the sales_tax_rate (VAT amount) that is being
passed into the API is written using a comma to specify the decimal
place: 20,0. The FreeAgent API expects a period/full stop to mark the
decimal place, like so: 20.0. Since the number doesn’t match the
expected format, we’re returning a “not a number” error.

I can see another request around the same time that was successful,
which did use the expected format. Try adjusting the comma and see if
that fixes the error for the user.

I hope that helps!


James Bell
Software Developer