Short answer
An invoice reconciliation API takes bank transactions in, proposes which invoice each payment settles, and records the allocations a person confirms. The hard parts are not the endpoints. They are importing bank data from camt.053 files, CSV exports and payment providers, normalising it into one transaction model, matching with explainable rules, and making every write safe to retry. DIGITAL EUR has no public API today: this page shows the design we plan, the rules our browser demo already uses, and the test cases any matching engine should pass.
What can a developer use from DIGITAL EUR today?
| Component | Status | What it means for you |
|---|---|---|
| Matching rules (reference, amount, IBAN, name) | DEMO, available now | They run in the browser in our reconciliation lab on your own CSV files; nothing is uploaded or stored |
| CSV checks before import | Available now | The bank statement CSV validator checks structure, delimiters and amounts in the browser |
| REST API with API keys | PLANNED | A versioned design exists (below); nothing is callable and there is no sandbox |
| camt.053 import | PLANNED | Tracked on the bank statement import page |
| Webhooks from DIGITAL EUR to your system | Not designed yet | We will publish event types before building them |
If you need a production invoice reconciliation API this month, use what your accounting platform or payment provider already offers and treat this page as a checklist for evaluating it. If you are building your own matching, the rest of the page is written for you.
What does an invoice reconciliation API have to do?
Every reconciliation API, whatever the vendor, performs five jobs in the same order:
- Import bank transactions and open invoices, idempotently, so the same statement uploaded twice creates nothing new.
- Normalise them into one model: integer amounts in minor units, one sign convention, one date field used for matching, cleaned references.
- Propose candidate matches with reasons, never a silent decision.
- Allocate an amount of a transaction to an invoice once an authorised person confirms it, without ever exceeding what is outstanding.
- Reverse an allocation by adding a reversal, keeping the history intact, and report every change in an audit trail.
The first two jobs decide most of the quality. A matching rule cannot recover a reference that the import truncated or an amount that was parsed with the wrong decimal separator.
How should a bank transaction import API accept data?
A bank transaction import API usually accepts three kinds of input, each with its own traps.
| Source | Typical format | Main risk | Defence |
|---|---|---|---|
| Bank statement files | ISO 20022 camt.053 (XML), MT940, bank CSV | Duplicate uploads; bank-specific variants | Store a checksum per file and a fingerprint per transaction; reject a second import of the same file |
| Payment provider events | JSON webhooks or reports | Duplicate and out-of-order delivery | Unique event IDs, stored before any side effect (see below) |
| Open-banking feeds | JSON from a licensed provider | Pending entries that later change | Import only booked entries, or mark pending ones and replace them |
For XML statements, two safeguards are not optional: disable external entity resolution in the parser (XXE) and cap the file size before parsing. For CSV, treat the file as untrusted text: detect the encoding, neutralise cells that start with =, +, - or @ before anything is exported back to a spreadsheet, and keep the raw row next to the parsed one so every match can be traced back to the bank's own words.
A transaction fingerprint should be built from data the bank will repeat identically in a later statement: account, booking date, amount, direction and the bank's entry reference when present. Do not include free-text fields that banks sometimes reformat between the intraday and the end-of-day statement.
ISO 20022 bank transaction mapping
When the source is camt.053, the mapping into your own model is mostly mechanical. The table below shows the fields that matter for matching; element names follow camt.053.001.08, and nesting differs between versions, so keep your bank's implementation guide at hand.
| Normalised field | camt.053 element | Watch out for |
|---|---|---|
| Amount | Ntry/Amt with Ccy |
Always positive; the sign comes from the indicator |
| Direction | CdtDbtInd (CRDT or DBIT) |
Map to signed amounts in one place only |
| Status | Sts/Cd (BOOK, PDNG) |
Match only booked entries |
| Booking and value date | BookgDt, ValDt |
They can differ; pick one for matching and keep both |
| End-to-end reference | TxDtls/Refs/EndToEndId |
Optional; may be missing or NOTPROVIDED when the payer set none |
| Counterparty name and IBAN | RltdPties/Dbtr, RltdPties/DbtrAcct |
Names vary in spelling; IBANs are stronger evidence |
| Remittance text | TxDtls/RmtInf/Ustrd |
Free text; the SEPA credit transfer rulebook allows 140 characters per occurrence |
| Structured reference | TxDtls/RmtInf/Strd (creditor reference) |
Present only when the payer used one, such as an ISO 11649 RF reference |
| Bank transaction code | BkTxCd/Domn (domain, family, sub-family) or BkTxCd/Prtry |
Use it to filter, not to match |
The bank transaction code has three levels: a domain, a family within it and a sub-family within the family, all published as ISO 20022 external code sets. When a bank has no specific code, it falls back to the generic code of the level above. For example, in the payments domain PMNT, the family RCDT (received credit transfers) with the sub-family ESCT marks a received SEPA credit transfer, while XBCT marks a cross-border one; received instant transfers have their own family, RRCT. Many banks also send a proprietary code in Prtry, so store both. In practice the code is useful to exclude card settlements, fees and returns from invoice matching; it never tells you which invoice was paid.
A camt.053 file holds more than this table, including balances, batches and the many optional parts of each entry. Our upcoming article on reading a camt.053 file explains the whole structure for non-developers.
Euro payment data normalisation, step by step
Euro payment data normalisation turns four different bank exports into one model you can match. CSV needs the most care, because a CSV file states none of its conventions. A bank statement parser for CSV should make these decisions in this order:
- Detect encoding and delimiter. Many European exports use semicolons because the comma is the decimal separator, and some still arrive in Windows-1252 rather than UTF-8.
- Fix the number format. Convert "1.250,00" to 1250.00 before any arithmetic, then store the amount as integer cents (125000). Never sum floating-point euros.
- Fix the date locale. "03.11.2026" and "11/03/2026" can be the same day; a CSV date locale bank importer must be told the format per bank rather than guess it from the first rows.
- Unify the sign. Some banks use a minus sign, others a separate debit/credit column, and a few put debits in a second amount column.
- Clean references, keep originals. Upper-case the reference and remove spaces and separators for comparison, but store the payer's original text for the audit trail.
- Keep the currency on every row. Do not convert silently; a payment in another currency is an exception for a person, not a rounding problem.
- Keep the raw row. Store the original line next to the normalised record.
The bank statement CSV validator runs the structural checks of steps 1 to 4 in your browser, which is a quick way to see what a given bank export will need.
How should matching work, and how do you test an invoice matching algorithm?
Our browser demo uses deterministic, published rules, and they make a useful reference case for anyone writing or buying a matcher. For each pair of an open invoice and an incoming transaction in the same currency, the demo adds named reasons:
| Reason | Effect on the score |
|---|---|
| Invoice reference found as a whole word in the remittance text | +65 |
| Amount equals the outstanding amount | +20 |
| Counterparty IBAN equals the customer's IBAN | +10 |
| Counterparty name equals the customer's name | +5 |
| Amount below the outstanding amount (possible partial payment) | −15 |
| Amount above the outstanding amount | −25 |
Three rules matter more than the numbers. No candidate is proposed on amount alone: without reference, IBAN or name evidence, coincidental amounts produce nothing. Equal top scores are flagged as ambiguous instead of picking one. And every proposal stays "review required" until a person approves it. The score is match evidence, not a probability that the match is correct. Reference matching compares whole identifiers, so INV-12 never matches inside INV-123, while INV 2026 0042 and inv-2026-0042 match each other.
A test suite for an invoice matching algorithm should include at least these cases, each with an expected outcome written down before you run it:
| Case | Example | Expected outcome |
|---|---|---|
| Clean payment | Reference, exact amount, known IBAN | One strong candidate |
| No reference | Exact amount, known IBAN | Candidate with lower evidence, review |
| Partial payment | Half the amount, correct reference | Candidate flagged as partial |
| Overpayment | Amount above outstanding | Candidate flagged; the excess is not allocated |
| Same amount, two invoices | Same customer, no reference | Two candidates marked ambiguous |
| Reference inside a longer one | INV-12 vs remittance "INV-123" |
No reference match |
| Coincidental amount | Stranger pays the exact amount, no other evidence | No candidate |
| Duplicate payment | Second credit for an already allocated invoice | Allocation refused once the invoice is fully settled |
| Other currency | Invoice in EUR, payment in another currency | No candidate |
| Outgoing payment | A debit with the right reference | Ignored for receivables |
You can run these cases through the demo by uploading two small CSV files; the reasons appear next to every suggestion. Our reconciliation product page describes the full logic and a worked example with six bank lines.
Reconciliation API example: the design we plan
This is the shape of the API in our technical design. It is PLANNED: no endpoint below is live, names may still change, and we publish it so developers can comment on it and compare it with the APIs they evaluate.
| Method and path | Purpose |
|---|---|
POST /v1/imports |
Upload a statement or invoice file; returns an import ID |
POST /v1/imports/{id}/preview |
Column mapping and parsed rows, nothing stored yet |
POST /v1/imports/{id}/confirm |
Store the rows; a second confirm of the same file is refused |
GET /v1/reconciliation/queue |
Unmatched transactions, cursor-paginated |
GET /v1/reconciliation/transactions/{id}/suggestions |
Candidates with reasons and the rules version |
POST /v1/reconciliation/allocations |
Confirm an allocation; requires an Idempotency-Key header |
POST /v1/reconciliation/allocations/{id}/reverse |
Reverse an allocation by adding a reversal |
GET /v1/audit |
Who did what, when |
A suggestion response could look like this (illustrative values):
{
"transactionId": "txn_01J9EXAMPLE",
"amountMinor": 125000,
"currency": "EUR",
"rulesVersion": "2026-11",
"suggestions": [
{
"invoiceId": "inv_2026_0042",
"score": 95,
"reasons": ["INVOICE_REFERENCE", "EXACT_AMOUNT", "COUNTERPARTY_IBAN"],
"ambiguousTopMatch": false,
"status": "REVIEW_REQUIRED"
}
]
}
and confirming it:
POST /v1/reconciliation/allocations
Idempotency-Key: 6f1c2a9e-0b7d-4d3e-9a51-2f8c1e7b4a10
Content-Type: application/json
{ "transactionId": "txn_01J9EXAMPLE", "invoiceId": "inv_2026_0042", "amountMinor": 125000 }
The server checks, inside one database transaction, that the user may reconcile for this organisation, that the transaction and invoice belong to it and share a currency, and that the new allocation does not exceed what is outstanding on either side. Errors use the problem-details format of RFC 9457, so a client can tell "already fully allocated" from "invalid input" without parsing English text. The organisation always comes from the authenticated membership, never from a query parameter.
Idempotency: why every write must be safe to repeat
Networks fail after the server has done the work but before the client hears about it. The client retries, and without protection the same payment is allocated twice. Two mechanisms prevent that.
Idempotency keys on requests. The client generates a unique key per intended operation and sends it with every retry of that operation. The server stores the key with the result of the first execution and returns the same result for repeats; a repeat with a different body under the same key is an error. Stripe documents this pattern for its API, and an IETF draft standardises the Idempotency-Key header.
Payment webhook idempotency. Payment providers deliver events at least once, so every handler must expect the same event twice and sometimes in a different order. The robust pattern:
- Verify the signature on the raw body before parsing.
- Insert the event ID into a table with a unique constraint, and treat a constraint violation as "already handled". A check-then-insert has a race in which two copies both pass the check.
- Make the business action itself idempotent too: before marking an invoice paid, check that it is not already paid and that the amount and currency match what you expected.
- Act only on final states. A failed or pending event can arrive several times; log it, do not trigger a final action from it.
- Handle order explicitly: a refund event may arrive before the payment event it refers to, so store it and apply it once the payment exists.
- Delete stored event IDs once they are older than the provider's retry window.
Our own shop module, built and tested but not yet selling, follows this pattern: each provider event ID is stored under a primary key before anything else happens, and a payment whose amount or currency differs from the order is recorded as a mismatch, never delivered.
Common mistakes in reconciliation integrations
- Matching on amount alone. Two customers paying €480.00 in the same week is ordinary, not a coincidence to resolve automatically.
- Floating-point money. Sums drift by a cent; use integer minor units end to end.
- Treating the score as a confidence percentage. Without calibration on real data it is evidence, not probability.
- Deleting a wrong match. Reverse it; an auditor will ask what happened.
- Trusting a redirect as payment proof. Only a verified provider event or a booked bank entry proves a payment.
- Letting the client choose the tenant. The organisation must come from the session, or one customer can read another's invoices.
Frequently asked questions
Does DIGITAL EUR have a public invoice reconciliation API?
No. The design above is planned, not built, and there are no API keys or sandbox. What works today is the browser demo and the CSV validator.
Can I test my own matching algorithm against yours?
Yes, informally. Run the same two CSV files through your code and through the reconciliation lab, and compare candidates and reasons case by case. The demo keeps nothing after you reload the page.
Will the API post matches automatically?
No. Every allocation needs a confirming request from an authorised user. Exact matches are suggested first, but they are not booked on their own.
Will there be a digital euro integration?
Not before the legislation and the ECB's platform exist; our page on digital euro developer opportunities explains the timeline, and the digital euro API page covers what the ECB has published.
Which banks' files will the import support?
CSV with comma separators and dot decimals today in the demo; camt.053 is planned. Because each bank's camt.053 differs slightly, we will publish the tested variants rather than claim universal support.
Sources
- ISO 20022, Bank Transaction Code external code list description (November 2025) (accessed 7 November 2026)
- IETF, RFC 9457: Problem Details for HTTP APIs (accessed 7 November 2026)
- IETF HTTPAPI working group, The Idempotency-Key HTTP Header Field (Internet-Draft) (accessed 7 November 2026)
- Stripe, Idempotent requests (accessed 7 November 2026)
- Svix, Idempotency and deduplication for webhooks (accessed 7 November 2026)
- European Payments Council, SEPA Credit Transfer Rulebook, version 1.2 (PDF) (accessed 7 November 2026)