Skip to content
Docs menu

Reconciliation sources

Finance > Reconciliation. Sources (a bank account, a gateway, a system), importing CSV, XLSX, MT940, CAMT.053 and OFX files into records, the mapping step, how large files resume, duplicates, the records limit and the MCP tools.

View .md

Finance > Reconciliation (/finance/recon) holds the files you reconcile: bank statements, payment gateway and sales channel reports, and exports from your own systems. Each file is imported into records, one per line, ready for matching. It belongs to the Reconciliation module (finance.recon): an organisation without it sees "not on your plan" there, and the tools answer 403 product_not_enabled. Matching records against each other comes in a later release; this one brings the files in.

Sources

A source is one place records come from, on one entity: a bank account, a gateway, a sales channel, an operational system, a ledger, a card, or something else. It has a name (unique on its entity), an optional currency (every line must then be in it), and a file format, set by its first import when you leave it empty. A source can be archived and restored; its records stay.

The Sources list shows each source's kind, format, last import and how many records it holds. Open one (/finance/recon/source?id=…) to see its imports and records, and to import a file.

Importing a file

On a source, press Import a file, then upload a file or pick one already in Finance > Documents. Files go in through the same upload as the Documents inbox, so the same type, size and duplicate rules apply, and the file is kept there.

MT940, CAMT.053 and OFX files say what each field is. The preview shows the period, the account and the first lines, and Import starts it. Money into the account is positive and money out negative, as the bank books it: a CAMT.053 entry's credit or debit mark is its own direction even on a reversal (a returned payment is money in), and an MT940 RD (a debit reversed) is money in, RC money out. An OFX amount may have a decimal comma (-12,50); a comma followed by more digits than the currency has decimals is a thousands separator (12,500 dollars).

CSV and XLSX files need a mapping the first time: which column holds what. See below.

The mapping step

Finance guesses a mapping from the file and fills the form with it. Every field still holding the guess is marked Suggested. A suggestion is never used on its own: nothing is imported until a person (or an agent, with confirm: true) confirms a mapping.

You choose:

  • the header row (or none) and, for an Excel file with several sheets, the sheet;
  • the date column and its date format. When more than one format fits every date in the file (03/04/2026 could be either), the page says so;
  • the sign convention: one signed amount column, the same with the sign inverted (money out is positive), separate debit and credit columns, or an amount with a debit/credit marker column;
  • the decimal style (1,234.56 or 1.234,56), or let Finance work it out;
  • the currency: one code for every line, or a currency column;
  • optional value date, reference, counterparty and line ID columns;
  • rows to skip at the end (a totals line). Every row at the end counts, the empty rows a spreadsheet leaves at the bottom too: a totals line followed by two empty rows is 3. A totals line left in is refused, never imported.

Extra fields and record kinds

A mapping can keep more columns than the statement needs, for rules and contracts to use. In the mapping's JSON (finance_reconsource_update, or a pack's template):

  • fields: up to 20 named fields, each a column name or {"column": "...", "type": "text" | "amount" | "date", "dateFormat": "..."}. An amount is stored in minor units of the line's currency, a date as YYYY-MM-DD, text trimmed; an empty cell is left out. Rules read them by name (commission, rate_plan, service_end, ...).
  • kindColumn and kinds: the column that says what a line is, and which value means which record kind (sale, refund, fee, commission, payout, chargeback, adjustment, no_show, cancellation), matched without regard to case. One goes with the other. An agency statement with booking lines and payout lines uses them, so the bookings pair with your stays and the payouts with the bank.

Below the form, the first lines show as they will be stored, and the first row that cannot be read is named. Tick that you checked the preview, then Save mapping and import. The mapping is saved on the source, so the next file from it imports straight away. On a phone the form stacks into one column.

How an import runs

An import is a batch. Starting one checks the file and queues it; the work runs in steps:

  • Each step reads the file from the document store and parses it, then inserts the lines in chunks of 2,000. After each chunk it saves how far it got, in the same transaction as the insert.
  • A step works for a fixed time and then stops; the next step carries on from the saved position. Steps run from the imports cron, and from the open source page while you watch.
  • Only one step works on a batch at a time (it holds a lease). A step that dies or loses its lease leaves the position at the last committed chunk, and the next step resumes from there, so no line is inserted twice. A step that fails for an unexpected reason is retried with a backoff, up to six times.

A step takes at most 100,000 lines, so a 200,000-line file (the largest CSV Finance reads) needs at least two steps. Parsing it takes under a second; the inserts take the rest.

If any line cannot be read (a date that does not match the format, an amount that is not a number, a line in another currency than the source's), the import fails before anything is inserted, and the reason names the row.

Duplicates

  • The same file twice: a file whose bytes were already imported into this source is refused (409), naming the earlier import. After an import failed, the same file can be imported again.
  • Overlapping files: each line gets an ID, and a line whose ID the source already has is counted as a duplicate and skipped. The ID is the line's own reference when the file gives one and it is unique in the file (OFX FITID, CAMT.053 AcctSvcrRef or TxId, MT940's bank reference, or the CSV/XLSX line ID column). Otherwise it is a hash of the line's date, amount, currency, reference and counterparty, numbered when the same line appears more than once in a file, so two identical payments on one day stay two records.

Each import shows the lines imported, the duplicates, and the lines not imported.

The records limit

Each plan includes a number of records a month (records_month). Records count as they are inserted; duplicates do not count. An import that reaches the limit stops there with plan_limit_reached: the lines already in stay, the rest are counted as not imported, and the import can be run again on a larger plan (its earlier lines then show as duplicates).

Who can do what

Action Roles
See sources, imports and records (recon.read) Controller, reconciliation clerk, auditor
Add and change sources, import files (recon.import) Controller, reconciliation clerk

A reconciliation clerk can also upload files into Documents, to import them. See Finance roles.

Every change is an event on the Finance audit trail: a source created, updated, its mapping confirmed, archived or restored, and an import started, finished or failed.

MCP tools

Tool What it does Scope
finance_reconsource_create Add a source: entity_id, name, kind; optional currency, format, counterparty_party_id finance:write
finance_reconsource_list The sources, with their record counts and last import; filter by entity_id, include archived finance:read
finance_reconsource_update Rename, change kind, currency or format, archive or restore; a mapping is saved only with confirm: true finance:write
finance_reconbatch_import Import a document into a source. preview: true shows the file and the suggested mapping without importing; a CSV or XLSX without a confirmed mapping answers needs_mapping with the preview; mapping with confirm: true saves it and imports finance:write
finance_reconbatch_list A source's imports, newest first, with their progress finance:read
finance_reconrecord_list A source's records, newest first; filter by batch_id, dates, an exact amount in minor units or text finance:read

Their REST twins are under /api/v1/finance/recon (sources, imports, records).