Log a transaction
log_transactionAdds- What it does
- Adds a new record and leaves what you had alone. Safe to retry: the same call twice changes nothing more.
- Permission
- Transactions, change
transactions:write
What your assistant is told
Record one transaction (an expense or income) for the calling user. Amounts are ALWAYS integer minor units of the currency — cents for EUR/USD/GBP — never a decimal: €12.34 is amount_minor 1234. category is a category NAME (case-insensitive, e.g. "Groceries") or a category UUID; resolve names with list_categories first if unsure — an unknown name is rejected with the list of valid ones. is_expense true = money out, false = money in. occurred_at_iso is when it happened, and it MUST carry the user's UTC offset ("2026-06-17T09:30:00+03:00", or "…Z" when they really are on UTC) — a timestamp without one is refused, because read back in their own zone it can land in the wrong month; if you don't know their offset, ask. account is the account it happened in (id, alias or IBAN, from list_accounts); omit it only when the user has one account — with two or more an omitted account is refused. currency defaults to the account's. When the line comes from a bank statement, pass the bank's own transaction id as externalId: a line already in the account with that id is refused as a duplicate. Pass a stable idempotencyKey (e.g. a UUID you mint per logical action) so a retry does not double-log. For more than a handful of lines (a whole statement) use log_transactions_batch instead. Returns the created transaction including its id, account and resolved category. Does NOT create categories or accounts — use create_category / create_account for that. TRANSFERS: money the user moved between their OWN accounts (current account → savings, card top-up) is kind "transfer", not an expense or income: leave category out, set isExpense to the direction for THIS account (true = out of it), and pass counterpartAccount when the other account is one of theirs. Transfers stay in the account's history but never count in spending, income or budgets. Payments to other people or companies are standard, never transfers. source says how you captured it — "receipt" when you read it off a receipt photo, otherwise leave it out. A transaction logged here is NOT yet confirmed by a bank statement, and passing externalId does not change that: only log_transactions_batch and attach_statement_line mark a transaction as being on a statement. A one-line statement is therefore better sent through log_transactions_batch, which also checks it against what the user already logged — this tool does not.
Parameters
amountMinorwhole number, requiredAmount in integer minor units (cents). Must be > 0. €12.34 → 1234.occurredAtIsotext, requiredWhen the transaction occurred, ISO-8601 WITH the user's UTC offset, e.g. "2026-06-17T09:30:00+03:00" (or "…Z" on UTC). Without an offset it is refused — it could land in the wrong month. If you don't know the user's offset, ask.isExpensetrue or false, requiredtrue = money out of the account, false = money in (also a transfer's direction).idempotencyKeytext, requiredStable idempotency key so a retry does not create a duplicate. Mint one UUID per logical log action.categorytext, optionalCategory NAME (case-insensitive) or UUID, fromlist_categories. Required unless kind is "transfer"; a transfer has none.descriptiontext, optionalOptional free-text description, e.g. "Weekly shop at Lidl".currencytext, optional3-letter ISO 4217 currency code, e.g. "EUR". Omit for the account's currency.accounttext, optionalAccount id, alias or IBAN, fromlist_accounts. Omit only when the user has a single account.externalIdtext, optionalThe bank's own id for this line, when it comes from a statement. Max 200 characters.kindtext, optional"standard" (default) or "transfer" — money moved between the user's own accounts, never counted as spending or income.counterpartAccounttext, optionalFor a transfer: the other account (id, alias or IBAN) when it is one of the user's. Omit when it isn't tracked.sourcetext, optionalHow you captured it: "receipt" (read off a receipt photo) or "manual" (the default — the user told you, or you are entering it for them).