Mileage, Receipts & Time
API reference for mileage logging, receipt capture, time entries, and project management.
const entries = await $fetch('https://taxmtd.uk/api/mileage')Log Mileage#
await $fetch('https://taxmtd.uk/api/mileage', {
method: 'POST',
body: {
date: '2026-03-01',
from: 'London',
to: 'Manchester',
miles: 200,
purpose: 'Client meeting',
vehicleType: 'car' // car, motorcycle, bicycle
}
})Update & Delete#
// Update
await $fetch('https://taxmtd.uk/api/mileage', {
method: 'PUT',
body: { id: 1, miles: 210, purpose: 'Client meeting (return)' }
})
// Delete
await $fetch('https://taxmtd.uk/api/mileage', {
method: 'DELETE',
body: { id: 1 }
})HMRC Mileage Rates#
| Vehicle | First 10,000 miles | Over 10,000 |
|---|---|---|
| Car/van | 45p/mile | 25p/mile |
| Motorcycle | 24p/mile | 24p/mile |
| Bicycle | 20p/mile | 20p/mile |
Receipts#
List Receipts#
const receipts = await $fetch('https://taxmtd.uk/api/receipts')Upload Receipt#
await $fetch('https://taxmtd.uk/api/receipts', {
method: 'POST',
body: {
image: 'base64-encoded-image...',
merchant: 'Staples',
amount: 45.99,
date: '2026-03-01',
category: 'office-equipment',
transactionId: 42 // optional: link to transaction
}
})// List
const projects = await $fetch('https://taxmtd.uk/api/projects')
// Create
await $fetch('https://taxmtd.uk/api/projects', {
method: 'POST',
body: { name: 'Website Redesign', client: 'Acme Ltd', hourlyRate: 75 }
})
// Update
await $fetch('https://taxmtd.uk/api/projects', {
method: 'PUT',
body: { id: 1, status: 'completed' }
})
// Delete
await $fetch('https://taxmtd.uk/api/projects', {
method: 'DELETE',
body: { id: 1 }
})// List
const entries = await $fetch('https://taxmtd.uk/api/time-entries')
// Create
await $fetch('https://taxmtd.uk/api/time-entries', {
method: 'POST',
body: {
projectId: 1,
date: '2026-03-01',
duration: 3.5,
description: 'Frontend development',
billable: true
}
})
// Update
await $fetch('https://taxmtd.uk/api/time-entries', {
method: 'PUT',
body: { id: 1, duration: 4.0 }
})
// Delete
await $fetch('https://taxmtd.uk/api/time-entries', {
method: 'DELETE',
body: { id: 1 }
})Timing App Integration#
Import time entries from the macOS Timing app via Web API or CSV file export.
Connect (Web API)#
// Connect via API (bearer token from web.timingapp.com → API Keys)
await $fetch('https://taxmtd.uk/api/timing/connect', {
method: 'POST',
body: { apiToken: 'tmng_your_token_here' }
})Import Entries#
// Import all entries
const result = await $fetch('https://taxmtd.uk/api/timing/import', {
method: 'POST'
})
// → { imported: 47, skipped: 0, projectsCreated: 5, projectsMapped: 0 }
// Import with date range
await $fetch('https://taxmtd.uk/api/timing/import', {
method: 'POST',
body: { startDate: '2026-01-01', endDate: '2026-03-31' }
})List Timing Projects#
const projects = await $fetch('https://taxmtd.uk/api/timing/projects')
// → [{ id: '42', title: 'Client Work', parentTitle: null, color: '#ff0000' }]Disconnect#
await $fetch('https://taxmtd.uk/api/timing/disconnect', { method: 'POST' })Upload CSV#
For users who don't sync to Timing's cloud - export from the app (File → Export Report as CSV), then upload.
const csvContent = '...' // Read from file
const result = await $fetch('https://taxmtd.uk/api/timing/upload', {
method: 'POST',
body: { csv: csvContent }
})
// → { imported: 23, skipped: 0, projectsCreated: 3, projectsMapped: 0 }