Opening Mileage

When I create a user with opening_mileage set to 9995 and send a mileage expense, the cost is always calculated at the high rate(45p) instead of the low rate(25p), even tho the mileage is way over the 10,000. Does anyone have any ideas?

Thanks,
Paul

Hi Paul,

Thanks for your message and I’m sure I can help.

What you’re seeing there is an implementation detail of how mileage expenses are valued for reclaim in FreeAgent:

When the expense is first created, we default the reclaim to £0.45 per mile.
We then kick-off another process, to sum together all mileage reclaims and knock any expense after the 10,000 mile threshold down to the lower £0.25 rate.

We function this way to deal with mileage expenses that might be entered into FreeAgent retrospectively, and often out of chronological order.
You should find, if you issue a second GET request moments later, that the reclaim has dropped to the £0.25 figure you expect.

I hope this helps!