freeagent_create_mileage_expense
Log a business trip in FreeAgent by entering origin and destination or manual miles, with round-trip option. FreeAgent calculates the claim value from your configured mileage rate for HMRC reporting.
Instructions
Create a mileage expense in FreeAgent. Provide either origin + destination (requires ORS_API_KEY or GOOGLE_MAPS_API_KEY for distance lookup) or manualMiles for the journey distance. Set roundTrip=true to double the distance.
The claim value is calculated by FreeAgent from the mileage rate configured on the account (this is what HMRC reporting in FreeAgent uses). ratePence / cumulativeMilesYTD only produce an advisory estimate in the response for cross-checking — they do not change what is filed.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| origin | No | Origin address. Requires distance API key. Omit if providing manualMiles. | |
| datedOn | Yes | Journey date YYYY-MM-DD | |
| project | No | FreeAgent project URL to tag the journey against | |
| currency | No | ISO 4217 currency code (default GBP) | GBP |
| ratePence | No | Pence per mile (e.g. 45) used only for the advisory estimate in the response. FreeAgent applies the mileage rate configured on the account when filing the claim. | |
| roundTrip | No | Double the distance for a return journey | |
| description | Yes | Journey description (e.g. 'Office to client site, quarterly review') | |
| destination | No | Destination address. Requires distance API key. Omit if providing manualMiles. | |
| manualMiles | No | Journey distance in miles (use instead of origin/destination) | |
| vehicleType | No | Vehicle used for the journey (required by FreeAgent's mileage category) | Car |
| cumulativeMilesYTD | No | Cumulative business miles already claimed this tax year. Used for HMRC threshold logic (high rate → low rate at threshold). Only relevant when ratePence is not set. |