Filter by assessment period ID
Transactions
CRUD operations for transactions - list, create (CSV import), update categories, and delete.
Transactions are also available via the Public API using API keys: GET https://taxmtd.uk/api/v1/transactions. See Authentication for details.
List Transactions#
Retrieve all transactions, optionally filtered by period, category, or source.
periodIdnumbercategorystringFilter by expense category slug
sourcestringFilter by source account (e.g., "NatWest", "PayPal")
excludedbooleanInclude or exclude transferred/personal transactions
// All transactions
const txns = await $fetch('https://taxmtd.uk/api/transactions')
// Filtered by period
const filtered = await $fetch('https://taxmtd.uk/api/transactions', {
params: { periodId: 1, category: 'transport-travel' }
})
// Response shape
interface Transaction {
id: number
date: string
description: string
amount: number
category: string | null
categoryLabel: string | null
aiReasoning: string | null
isPersonal: boolean
isExcluded: boolean
sourceAccount: string | null
periodId: number | null
}Import Transactions (CSV)#
Upload a bank statement CSV. TaxMTD auto-detects bank format.
const result = await $fetch('https://taxmtd.uk/api/upload', {
method: 'POST',
body: {
csv: csvContent,
periodStart: '2026-01-30',
periodEnd: '2026-02-27',
periodLabel: 'Jan 2026'
}
})
// Returns: { data: { stats: { total, income, expenses, excluded }, bankLabel } }Update Transaction#
Update the category, personal flag, or exclusion status.
await $fetch('https://taxmtd.uk/api/transactions', {
method: 'PUT',
body: {
id: 42,
category: 'office-equipment',
categoryLabel: 'Office & Equipment',
isPersonal: false,
isExcluded: false
}
})Transaction Splits#
Split a transaction into multiple categories (e.g., 60% business, 40% personal).
// Get splits for a transaction
const splits = await $fetch('https://taxmtd.uk/api/transaction-splits', {
params: { transactionId: 42 }
})
// Create splits
await $fetch('https://taxmtd.uk/api/transaction-splits', {
method: 'POST',
body: {
transactionId: 42,
splits: [
{ category: 'office-equipment', categoryLabel: 'Office & Equipment', percentage: 60, amount: 17.99 },
{ category: null, categoryLabel: 'Personal', percentage: 40, amount: 12.00, isPersonal: true }
]
}
})
// Delete splits
await $fetch('https://taxmtd.uk/api/transaction-splits', {
method: 'DELETE',
body: { transactionId: 42 }
})Find Similar Transactions#
Find transactions with similar descriptions for batch categorisation.
const similar = await $fetch('https://taxmtd.uk/api/transactions-similar', {
params: { description: 'AMAZON' }
})
// Returns transactions matching the pattern