Skip to Content
Open Booksby LumeoDocs

CAMT.053 field map and parser reference

Map CAMT.053 (ISO 20022) fields to MT940 and OFX, with a minimal valid statement, the command to run it and the conditions that refuse a file.

Open Books supports CAMT.053 (ISO 20022 XML) bank statements as layout camt053.v1. Files with the .xml extension are routed to this parser when the document contains a BkToCstmrStmt element. This page lists the CAMT.053 elements the parser reads, shows how they line up with MT940 and OFX, and gives a sample to run.

Field map

Generic fieldCAMT.053 (read by the parser)MT940OFX
Account identifierStmt/Acct/Id/IBAN, or Stmt/Acct/Id/Othr/Id when no IBAN is present:25:BANKACCTFROM (BANKID, ACCTID)
Statement referenceStmt/Id:20: transaction reference, and :28C: statement numberNo equivalent element
CurrencyCcy on Acct, and the Ccy attribute on each AmtCurrency code inside :60F:, :62F: and :64:CURDEF
Opening balanceBal with type code OPBD or PRCD:60F:, or :60M: for an intermediate balanceNo opening balance element
Closing balanceBal with type code CLBD:62F:, or :62M: for an intermediate balanceLEDGERBAL (BALAMT, DTASOF)
Balance signCdtDbtInd on the balance: CRDT is positive, DBIT is negativeC or D markSign of BALAMT
Balance dateBal/Dt/DtDate in :60F: and :62F:DTASOF
Transaction entryNtry, booked only (Sts is BOOK, or absent):61: statement lineSTMTTRN
Booking dateNtry/BookgDt/DtEntry date in :61:DTPOSTED
AmountNtry/Amt, unsigned and positiveAmount in :61:, with a comma decimal markTRNAMT, signed
DirectionNtry/CdtDbtInd (CRDT or DBIT). RvslInd of true flips it.D or C in :61:. RD and RC mark reversals.Sign of TRNAMT
Bank referenceNtry/AcctSvcrRefAfter // in :61:FITID
Customer referenceNtry/NtryDtls/TxDtls/Refs/EndToEndId, used when AcctSvcrRef is absentBefore // in :61:REFNUM, optional
NarrativeTxDtls/RmtInf/Ustrd lines, otherwise Ntry/AddtlNtryInf:86:, free textNAME and MEMO

Dates in CAMT.053 are ISO dates (YYYY-MM-DD). Amounts are decimal text with a point, and the sign is carried by CdtDbtInd, as in the table above.

Sample statement

This is a minimal valid statement. It has one account, an opening balance (OPBD), a closing balance (CLBD) and two booked entries, one credit and one debit.

<?xml version="1.0" encoding="UTF-8"?>
<Document xmlns="urn:iso:std:iso:20022:tech:xsd:camt.053.001.02">
  <BkToCstmrStmt>
    <Stmt>
      <Id>S1</Id>
      <Acct><Id><IBAN>DE89370400440532013000</IBAN></Id><Ccy>EUR</Ccy></Acct>
      <Bal><Tp><CdOrPrtry><Cd>OPBD</Cd></CdOrPrtry></Tp><Amt Ccy="EUR">1000.00</Amt><CdtDbtInd>CRDT</CdtDbtInd><Dt><Dt>2025-01-01</Dt></Dt></Bal>
      <Bal><Tp><CdOrPrtry><Cd>CLBD</Cd></CdOrPrtry></Tp><Amt Ccy="EUR">1150.50</Amt><CdtDbtInd>CRDT</CdtDbtInd><Dt><Dt>2025-01-31</Dt></Dt></Bal>
      <Ntry><Amt Ccy="EUR">200.00</Amt><CdtDbtInd>CRDT</CdtDbtInd><Sts>BOOK</Sts><BookgDt><Dt>2025-01-05</Dt></BookgDt>
        <AcctSvcrRef>REF1</AcctSvcrRef><NtryDtls><TxDtls><RmtInf><Ustrd>Invoice 42</Ustrd></RmtInf></TxDtls></NtryDtls></Ntry>
      <Ntry><Amt Ccy="EUR">49.50</Amt><CdtDbtInd>DBIT</CdtDbtInd><Sts>BOOK</Sts><BookgDt><Dt>2025-01-20</Dt></BookgDt>
        <AddtlNtryInf>Card payment</AddtlNtryInf></Ntry>
    </Stmt>
  </BkToCstmrStmt>
</Document>

The opening balance plus the signed entries (1000.00 + 200.00 - 49.50) gives the closing balance of 1150.50, which is the check Open Books runs before it releases the document.

Run it

openbooks run sample_camt.xml

The command prints one line per file. For this sample it prints sample_camt.xml: ok -> <sha256>.json. Add --out ./proofs to keep the proof document.

What makes a file refused

A CAMT.053 file is refused with PARSE_ERROR when any of these hold:

  • The XML is not well-formed.
  • The file contains a DOCTYPE or entity declaration. These are refused before parsing.
  • There is no BkToCstmrStmt element, or it contains no Stmt.
  • A statement has no account identifier.
  • A statement has no OPBD or PRCD opening balance, or no CLBD closing balance.
  • The currency changes inside a statement.
  • An amount or a date is missing or unreadable, or an amount has no Ccy attribute.
  • An entry's currency differs from the account currency.
  • An amount is zero or negative. The direction comes from CdtDbtInd, not from the sign.
  • No entry is booked. Entries whose Sts is not BOOK are skipped, not refused.

A text file over 64 MiB is refused with UNSUPPORTED_INPUT, because .xml is a text-type extension. Documents of up to 2 GiB are accepted in other formats. See supported file types and size limits.

How Open Books handles these formats

  • MT940 is read as mt940.v1, and OFX and QFX as ofx.v1. CAMT.053 is read as camt053.v1.
  • OFX has no opening balance element, so the opening balance must be supplied with --opening.
  • Multiple Stmt elements in one document are supported. Each becomes its own batch.
  • The opening plus signed movements check is described in how verification works.

Next steps

View this page as Markdown