Skip to content

Diagnostic Bank transfers and statement matching

camt.053 vs MT940: which bank statement format to import

Your bank offers several downloads with similar names: camt.053, camt.052, camt.054, MT940, MT942, a CSV. Two of them are statements. The others repeat payments that the statement will list again, so importing both counts the same money twice. Here is what each one is, what the version numbers mean, why German banks are settling on camt.053.001.08, and a small read-only script that says what a file really is.

Python and Node.js Read only No network
A close up of text on a piece of paper
Photo by Cyril Muhammad on Unsplash
The short answer

camt.053 (ISO 20022 XML) and MT940 (SWIFT text) are end-of-day statements: each booked payment appears once. camt.052, camt.054 and MT942 are intraday reports and notifications whose payments come back in the statement, so importing both double-counts. The number after camt.053.001 is the message version: .02, .04 or .08. The German banking industry's specification V26.11, valid from 15 November 2026, offers only .08 and has dropped its MT940 chapter. A small script reads a file's bytes, names the format and version, and refuses the intraday ones.

The problem in plain words

A shop owner downloads "the statement" on Monday, and on Tuesday an intraday report, because both sit under account information in the banking portal. Both files go into the matcher. The Tuesday file lists payments that Monday's statement already carried, some of them still pending.

The same transfer now appears twice. It matches an order once, and then shows up again as a second payment that matches nothing, or worse, matches a different order of the same amount.

Monday: camt.053booked paymentsTuesday: camt.052intraday, same paymentsBoth importedeach payment twiceDouble countone transfer, two lines
Both files describe the same money; only the statement counts each booked item once.

Why it happens

The formats differ in what they promise, not just in how they look:

The key insight

Decide from the bytes, never from the file name. The XML namespace names the message and its version exactly, and MT940 announces itself with its tags. Everything else, an unknown version included, is refused with a reason instead of guessed.

The fix, as a flow

The script reads the start of each file. A PDF, an OFX file or XML that declares a DOCTYPE is refused. A camt file is read for its namespace: camt.053 versions .02, .04 and .08 pass, camt.052 and camt.054 are refused as intraday. Text with :20: and :60F: or :60M: lines is MT940, unless it carries an MT942 envelope or the :13D: or :34F: tags. For MT940 it also counts the :61: marks and names the :86: style, so reversals are visible before any import.

File bytesname ignoredWhich message?namespace or tagsStatement?camt.053, MT940Reportimport or refuse, withwhy
Read only and offline: it opens the files you name and prints one line each.

Build it step by step

1

Nothing to install

Run it on the files you downloaded. It needs no network, no credentials and no store: it reads the files you name and prints a line for each.

setup (shell)
# Python 3.8 or later. Standard library only: nothing to install, no keys, no network.
setup (shell)
# Node 18 or later. Built-in modules only: nothing to install, no keys, no network.
2

Decide with one pure function

identify takes a file's bytes and returns the format, the version, whether the file is a statement and why. It does not raise on odd input, so a damaged file is a refusal with a reason.

identify_statement_format.py
def identify(data):
    """Bytes of a file -> {format, version, importable, why, ...}. Never raises on odd input."""
    if data.startswith(b"%PDF-"):
        return _verdict("pdf", "", False, "a PDF: not machine readable; download the camt.053 or MT940 export instead")
    head = _text(data[:16384]).lstrip()
    if re.match(r"OFXHEADER|<OFX>", head, re.I):
        return _verdict("ofx", "", False, "OFX: not a format this reads")
    if head.startswith("<"):
        if re.search(r"<!DOCTYPE", head, re.I):
            return _verdict("xml", "", False, "declares a DOCTYPE, which a camt statement never does")
        m = re.search(r'xmlns(?::\w+)?="urn:iso:std:iso:20022:tech:xsd:camt\.(\d{3})\.001\.(\d{2})"', head)
        if not m:
            return _verdict("xml", "", False, "XML, but not an ISO 20022 camt message")
        kind, ver = m.group(1), m.group(2)
        if kind in CAMT_NAMES:
            return _verdict("camt." + kind, "001." + ver, False, CAMT_NAMES[kind])
        if kind != "053":
            return _verdict("camt." + kind, "001." + ver, False, f"camt.{kind} is not a bank statement")
        if ver not in CAMT_VERSIONS:
            return _verdict("camt.053", "001." + ver, False, f"camt.053.001.{ver} is a version this does not read (.02, .04 and .08 are)")
        return _verdict("camt.053", "001." + ver, True, "a customer statement: each booked item appears once")
    text = _text(data)
    if re.search(r"\{2:[IO]942|^:(13D|34F):", text, re.M):
        return _verdict("mt942", "", False, "an MT942 interim report, not a statement: its items return in the MT940, so importing both counts them twice")
    if re.search(r"^:20:", text, re.M) and re.search(r"^:6[02][FM]:", text, re.M):
        marks = {"C": 0, "D": 0, "RC": 0, "RD": 0}
        for m in re.finditer(r"^:61:\d{6}(?:\d{4}| {4})?(RC|RD|C|D)", text, re.M):
            marks[m.group(1)] += 1
        if re.search(r"^:86:\d{3}\?", text, re.M):
            family = "German structured (?20-?29 purpose subfields)"
        elif re.search(r"^:86:/[A-Z]{4}/", text, re.M):
            family = "code words (/EREF/, /REMI/)"
        else:
            family = "free text"
        return _verdict("mt940", "", True, "a customer statement: each booked item appears once", marks=marks, details_86=family)
    return _verdict("unknown", "", False, "not camt, MT940, OFX or PDF: probably a CSV, which needs its columns mapped")
identify-statement-format.mjs
export function identify(buf) {
  if (buf.subarray(0, 5).toString("latin1") === "%PDF-") return verdict("pdf", "", false, "a PDF: not machine readable; download the camt.053 or MT940 export instead");
  const head = text(buf.subarray(0, 16384)).trimStart();
  if (/^(OFXHEADER|<OFX>)/i.test(head)) return verdict("ofx", "", false, "OFX: not a format this reads");
  if (head.startsWith("<")) {
    if (/<!DOCTYPE/i.test(head)) return verdict("xml", "", false, "declares a DOCTYPE, which a camt statement never does");
    const m = /xmlns(?::\w+)?="urn:iso:std:iso:20022:tech:xsd:camt\.(\d{3})\.001\.(\d{2})"/.exec(head);
    if (!m) return verdict("xml", "", false, "XML, but not an ISO 20022 camt message");
    const [, kind, ver] = m;
    if (CAMT_NAMES[kind]) return verdict("camt." + kind, "001." + ver, false, CAMT_NAMES[kind]);
    if (kind !== "053") return verdict("camt." + kind, "001." + ver, false, `camt.${kind} is not a bank statement`);
    if (!CAMT_VERSIONS.includes(ver)) return verdict("camt.053", "001." + ver, false, `camt.053.001.${ver} is a version this does not read (.02, .04 and .08 are)`);
    return verdict("camt.053", "001." + ver, true, "a customer statement: each booked item appears once");
  }
  const all = text(buf);
  if (/\{2:[IO]942|^:(13D|34F):/m.test(all)) return verdict("mt942", "", false, "an MT942 interim report, not a statement: its items return in the MT940, so importing both counts them twice");
  if (/^:20:/m.test(all) && /^:6[02][FM]:/m.test(all)) {
    const marks = { C: 0, D: 0, RC: 0, RD: 0 };
    for (const m of all.matchAll(/^:61:\d{6}(?:\d{4}| {4})?(RC|RD|C|D)/gm)) marks[m[1]]++;
    let family = "free text";
    if (/^:86:\d{3}\?/m.test(all)) family = "German structured (?20-?29 purpose subfields)";
    else if (/^:86:\/[A-Z]{4}\//m.test(all)) family = "code words (/EREF/, /REMI/)";
    return verdict("mt940", "", true, "a customer statement: each booked item appears once", { marks, details_86: family });
  }
  return verdict("unknown", "", false, "not camt, MT940, OFX or PDF: probably a CSV, which needs its columns mapped");
}
3

Run it before every import

It exits with status 1 if any file is refused, so a script can stop before a double count.

run it
python3 identify_statement_format.py statement.xml umsaetze.txt
run it
node identify-statement-format.mjs statement.xml umsaetze.txt
Read only, on purpose

The script never writes anything and never touches the network: it reads the files or numbers you give it and prints. Confirming a payment against an order is a decision for a person.

The full code

The complete script in one file for each language. It reads only the files you name.

Get this script on GitHub Follow @allanninal Python and Node.js, with tests. Read only. One of 148 WooCommerce fixes, free and open source.
identify_statement_format.py
"""Say what a bank statement file is, from its bytes, and refuse intraday reports.

Banks name files "Umsaetze.txt" whatever is inside, so this never looks at the name.
camt.053 and MT940 are statements: each booked item appears once. camt.052 and camt.054
(and the SWIFT MT942) are intraday reports and notifications: the same payment appears
again in the statement later, so importing both counts it twice. Those are refused.
Read only: it opens the files you name, sends nothing anywhere.

    python3 identify_statement_format.py statement.xml statement.sta

Guide: https://www.allanninal.dev/woocommerce/camt053-vs-mt940-statement-formats/
"""
import re
import sys

CAMT_VERSIONS = ("02", "04", "08")
CAMT_NAMES = {
    "052": "an intraday report (camt.052), not a statement: its items return in the camt.053, so importing both counts them twice",
    "054": "a notification (camt.054), not a statement: its items return in the camt.053, so importing both counts them twice",
}


def _text(data):
    if data[:2] in (b"\xff\xfe", b"\xfe\xff"):
        return data.decode("utf-16", "replace")
    try:
        return data.decode("utf-8-sig")
    except UnicodeDecodeError:
        return data.decode("latin-1")


def _verdict(fmt, version, importable, why, **more):
    return {"format": fmt, "version": version, "importable": importable, "why": why, **more}


def identify(data):
    """Bytes of a file -> {format, version, importable, why, ...}. Never raises on odd input."""
    if data.startswith(b"%PDF-"):
        return _verdict("pdf", "", False, "a PDF: not machine readable; download the camt.053 or MT940 export instead")
    head = _text(data[:16384]).lstrip()
    if re.match(r"OFXHEADER|<OFX>", head, re.I):
        return _verdict("ofx", "", False, "OFX: not a format this reads")
    if head.startswith("<"):
        if re.search(r"<!DOCTYPE", head, re.I):
            return _verdict("xml", "", False, "declares a DOCTYPE, which a camt statement never does")
        m = re.search(r'xmlns(?::\w+)?="urn:iso:std:iso:20022:tech:xsd:camt\.(\d{3})\.001\.(\d{2})"', head)
        if not m:
            return _verdict("xml", "", False, "XML, but not an ISO 20022 camt message")
        kind, ver = m.group(1), m.group(2)
        if kind in CAMT_NAMES:
            return _verdict("camt." + kind, "001." + ver, False, CAMT_NAMES[kind])
        if kind != "053":
            return _verdict("camt." + kind, "001." + ver, False, f"camt.{kind} is not a bank statement")
        if ver not in CAMT_VERSIONS:
            return _verdict("camt.053", "001." + ver, False, f"camt.053.001.{ver} is a version this does not read (.02, .04 and .08 are)")
        return _verdict("camt.053", "001." + ver, True, "a customer statement: each booked item appears once")
    text = _text(data)
    if re.search(r"\{2:[IO]942|^:(13D|34F):", text, re.M):
        return _verdict("mt942", "", False, "an MT942 interim report, not a statement: its items return in the MT940, so importing both counts them twice")
    if re.search(r"^:20:", text, re.M) and re.search(r"^:6[02][FM]:", text, re.M):
        marks = {"C": 0, "D": 0, "RC": 0, "RD": 0}
        for m in re.finditer(r"^:61:\d{6}(?:\d{4}| {4})?(RC|RD|C|D)", text, re.M):
            marks[m.group(1)] += 1
        if re.search(r"^:86:\d{3}\?", text, re.M):
            family = "German structured (?20-?29 purpose subfields)"
        elif re.search(r"^:86:/[A-Z]{4}/", text, re.M):
            family = "code words (/EREF/, /REMI/)"
        else:
            family = "free text"
        return _verdict("mt940", "", True, "a customer statement: each booked item appears once", marks=marks, details_86=family)
    return _verdict("unknown", "", False, "not camt, MT940, OFX or PDF: probably a CSV, which needs its columns mapped")


def main(argv):
    if len(argv) < 2:
        print("usage: identify_statement_format.py FILE [FILE ...]", file=sys.stderr)
        return 2
    refused = 0
    for path in argv[1:]:
        with open(path, "rb") as f:
            v = identify(f.read())
        name = v["format"] + (("." + v["version"]) if v["version"] else "")
        extra = ""
        if v.get("marks"):
            m = v["marks"]
            extra = f" [:61: credits {m['C']}, debits {m['D']}, reversed credits {m['RC']}, returned debits {m['RD']}; :86: {v['details_86']}]"
        print(f"{path}: {name}, {'OK to import' if v['importable'] else 'REFUSED'}: {v['why']}{extra}")
        refused += not v["importable"]
    return 1 if refused else 0


if __name__ == "__main__":
    sys.exit(main(sys.argv))
identify-statement-format.mjs
/**
 * Say what a bank statement file is, from its bytes, and refuse intraday reports.
 *
 * Banks name files "Umsaetze.txt" whatever is inside, so this never looks at the name. camt.053
 * and MT940 are statements: each booked item appears once. camt.052 and camt.054 (and the SWIFT
 * MT942) are intraday reports and notifications: the same payment appears again in the statement
 * later, so importing both counts it twice. Those are refused. Read only: it opens the files you
 * name and sends nothing anywhere.
 *
 *     node identify-statement-format.mjs statement.xml statement.sta
 *
 * Guide: https://www.allanninal.dev/woocommerce/camt053-vs-mt940-statement-formats/
 */
import { pathToFileURL } from "node:url";



import { readFileSync } from "node:fs";

const CAMT_VERSIONS = ["02", "04", "08"];
const CAMT_NAMES = {
  "052": "an intraday report (camt.052), not a statement: its items return in the camt.053, so importing both counts them twice",
  "054": "a notification (camt.054), not a statement: its items return in the camt.053, so importing both counts them twice",
};

function text(buf) {
  if ((buf[0] === 0xff && buf[1] === 0xfe)) return buf.toString("utf16le").replace(/^/, "");
  const s = buf.toString("utf8");
  if (!s.includes("�")) return s.replace(/^/, "");
  return buf.toString("latin1");
}

const verdict = (format, version, importable, why, more = {}) => ({ format, version, importable, why, ...more });

export function identify(buf) {
  if (buf.subarray(0, 5).toString("latin1") === "%PDF-") return verdict("pdf", "", false, "a PDF: not machine readable; download the camt.053 or MT940 export instead");
  const head = text(buf.subarray(0, 16384)).trimStart();
  if (/^(OFXHEADER|<OFX>)/i.test(head)) return verdict("ofx", "", false, "OFX: not a format this reads");
  if (head.startsWith("<")) {
    if (/<!DOCTYPE/i.test(head)) return verdict("xml", "", false, "declares a DOCTYPE, which a camt statement never does");
    const m = /xmlns(?::\w+)?="urn:iso:std:iso:20022:tech:xsd:camt\.(\d{3})\.001\.(\d{2})"/.exec(head);
    if (!m) return verdict("xml", "", false, "XML, but not an ISO 20022 camt message");
    const [, kind, ver] = m;
    if (CAMT_NAMES[kind]) return verdict("camt." + kind, "001." + ver, false, CAMT_NAMES[kind]);
    if (kind !== "053") return verdict("camt." + kind, "001." + ver, false, `camt.${kind} is not a bank statement`);
    if (!CAMT_VERSIONS.includes(ver)) return verdict("camt.053", "001." + ver, false, `camt.053.001.${ver} is a version this does not read (.02, .04 and .08 are)`);
    return verdict("camt.053", "001." + ver, true, "a customer statement: each booked item appears once");
  }
  const all = text(buf);
  if (/\{2:[IO]942|^:(13D|34F):/m.test(all)) return verdict("mt942", "", false, "an MT942 interim report, not a statement: its items return in the MT940, so importing both counts them twice");
  if (/^:20:/m.test(all) && /^:6[02][FM]:/m.test(all)) {
    const marks = { C: 0, D: 0, RC: 0, RD: 0 };
    for (const m of all.matchAll(/^:61:\d{6}(?:\d{4}| {4})?(RC|RD|C|D)/gm)) marks[m[1]]++;
    let family = "free text";
    if (/^:86:\d{3}\?/m.test(all)) family = "German structured (?20-?29 purpose subfields)";
    else if (/^:86:\/[A-Z]{4}\//m.test(all)) family = "code words (/EREF/, /REMI/)";
    return verdict("mt940", "", true, "a customer statement: each booked item appears once", { marks, details_86: family });
  }
  return verdict("unknown", "", false, "not camt, MT940, OFX or PDF: probably a CSV, which needs its columns mapped");
}

export async function run(argv = process.argv.slice(2)) {
  if (!argv.length) {
    console.error("usage: identify-statement-format.mjs FILE [FILE ...]");
    return 2;
  }
  let refused = 0;
  for (const path of argv) {
    const v = identify(readFileSync(path));
    const name = v.format + (v.version ? "." + v.version : "");
    let extra = "";
    if (v.marks) {
      const m = v.marks;
      extra = ` [:61: credits ${m.C}, debits ${m.D}, reversed credits ${m.RC}, returned debits ${m.RD}; :86: ${v.details_86}]`;
    }
    console.log(`${path}: ${name}, ${v.importable ? "OK to import" : "REFUSED"}: ${v.why}${extra}`);
    if (!v.importable) refused++;
  }
  return refused ? 1 : 0;
}

if (import.meta.url === pathToFileURL(process.argv[1]).href) {
  run().then((code) => process.exit(code)).catch((err) => { console.error(err); process.exit(2); });
}

Add a test

The decision is the part most worth testing, and because it is a pure function the tests need no store and no network: they feed in plain objects and check the answer.

test_statement_format.py
from identify_statement_format import identify


def camt(kind="053", ver="08"):
    return f'<?xml version="1.0"?><Document xmlns="urn:iso:std:iso:20022:tech:xsd:camt.{kind}.001.{ver}"><BkToCstmrStmt/></Document>'.encode()


MT940 = b":20:STMT1\n:25:DE02120300000000202051\n:28C:1/1\n:60F:C261116EUR1000,00\n:61:2611161116C49,90NTRFNONREF\n:86:166?00SEPA-UEBERWEISUNG?20SVWZ+RF97 1042\n:61:2611161116RC10,00NTRFNONREF\n:62F:C261116EUR1039,90\n"


def test_each_camt_053_version_is_a_statement():
    for ver in ("02", "04", "08"):
        v = identify(camt("053", ver))
        assert (v["format"], v["version"], v["importable"]) == ("camt.053", "001." + ver, True)


def test_camt_052_and_054_are_refused_as_double_counting():
    for kind in ("052", "054"):
        v = identify(camt(kind))
        assert v["format"] == "camt." + kind and not v["importable"] and "twice" in v["why"]


def test_an_unknown_camt_053_version_is_refused_not_guessed():
    assert not identify(camt("053", "12"))["importable"]


def test_mt940_counts_its_marks_and_names_the_86_family():
    v = identify(MT940)
    assert v["format"] == "mt940" and v["importable"]
    assert v["marks"] == {"C": 1, "D": 0, "RC": 1, "RD": 0}
    assert v["details_86"].startswith("German structured")


def test_mt942_is_refused_by_its_tags_and_by_its_envelope():
    assert not identify(b":20:X\n:25:DE02\n:28C:1/1\n:34F:EURC0,\n:13D:2611161000+0100\n:61:2611161116C1,00NTRFNONREF\n")["importable"]
    assert identify(b"{1:F01BANKDEFFAXXX}{2:O9420900261116BANKDEFFXXXX}{4:\n:20:X\n:60F:C261116EUR1,00\n-}")["format"] == "mt942"


def test_the_file_name_never_matters_only_the_bytes():
    assert identify(MT940)["format"] == "mt940"  # there is no name argument to be fooled by


def test_pdf_doctype_and_junk_are_refused():
    assert identify(b"%PDF-1.7 ...")["format"] == "pdf"
    assert not identify(b'<!DOCTYPE x [<!ENTITY a "b">]><Document xmlns="urn:iso:std:iso:20022:tech:xsd:camt.053.001.08"/>')["importable"]
    assert identify(b"Datum;Betrag\n01.01.2026;5,00")["format"] == "unknown"
    assert identify(b"")["format"] == "unknown"


def test_a_bom_and_utf16_do_not_hide_a_camt():
    assert identify(b"\xef\xbb\xbf" + camt())["format"] == "camt.053"
    assert identify(camt().decode().encode("utf-16"))["format"] == "camt.053"
check-statement-format.test.mjs
import { test } from "node:test";
import assert from "node:assert/strict";
import { identify } from "./identify-statement-format.mjs";

const b = (s) => Buffer.from(s);
const camt = (kind = "053", ver = "08") => b(`<?xml version="1.0"?><Document xmlns="urn:iso:std:iso:20022:tech:xsd:camt.${kind}.001.${ver}"><BkToCstmrStmt/></Document>`);
const MT940 = b(":20:STMT1\n:25:DE02120300000000202051\n:28C:1/1\n:60F:C261116EUR1000,00\n:61:2611161116C49,90NTRFNONREF\n:86:166?00SEPA-UEBERWEISUNG?20SVWZ+RF97 1042\n:61:2611161116RC10,00NTRFNONREF\n:62F:C261116EUR1039,90\n");

test("each camt.053 version is a statement", () => {
  for (const ver of ["02", "04", "08"]) {
    const v = identify(camt("053", ver));
    assert.deepEqual([v.format, v.version, v.importable], ["camt.053", "001." + ver, true]);
  }
});
test("camt.052 and camt.054 are refused as double counting", () => {
  for (const kind of ["052", "054"]) {
    const v = identify(camt(kind));
    assert.equal(v.format, "camt." + kind);
    assert.ok(!v.importable && v.why.includes("twice"));
  }
});
test("an unknown camt.053 version is refused, not guessed", () => assert.ok(!identify(camt("053", "12")).importable));
test("mt940 counts its marks and names the 86 family", () => {
  const v = identify(MT940);
  assert.ok(v.format === "mt940" && v.importable);
  assert.deepEqual(v.marks, { C: 1, D: 0, RC: 1, RD: 0 });
  assert.ok(v.details_86.startsWith("German structured"));
});
test("mt942 is refused by its tags and by its envelope", () => {
  assert.ok(!identify(b(":20:X\n:25:DE02\n:28C:1/1\n:34F:EURC0,\n:13D:2611161000+0100\n:61:2611161116C1,00NTRFNONREF\n")).importable);
  assert.equal(identify(b("{1:F01BANKDEFFAXXX}{2:O9420900261116BANKDEFFXXXX}{4:\n:20:X\n:60F:C261116EUR1,00\n-}")).format, "mt942");
});
test("the file name never matters, only the bytes", () => assert.equal(identify(MT940).format, "mt940"));
test("pdf, doctype and junk are refused", () => {
  assert.equal(identify(b("%PDF-1.7 ...")).format, "pdf");
  assert.ok(!identify(b('<!DOCTYPE x [<!ENTITY a "b">]><Document xmlns="urn:iso:std:iso:20022:tech:xsd:camt.053.001.08"/>')).importable);
  assert.equal(identify(b("Datum;Betrag\n01.01.2026;5,00")).format, "unknown");
  assert.equal(identify(b("")).format, "unknown");
});
test("a bom and utf-16 do not hide a camt", () => {
  assert.equal(identify(Buffer.concat([Buffer.from([0xef, 0xbb, 0xbf]), camt()])).format, "camt.053");
  assert.equal(identify(Buffer.concat([Buffer.from([0xff, 0xfe]), Buffer.from(camt().toString(), "utf16le")])).format, "camt.053");
});

Worked example

From a real run

What it said

The script ran on the synthetic statement files in Transferproof's test fixtures (camt.053 versions .02, .04 and .08, and three MT940 styles) plus two files made for this example: a camt.052 made by changing the namespace of the .08 file, and an MT942 made by adding its :34F: and :13D: tags to an MT940. The file called Umsaetze.txt is an MT940 under a misleading name.

output (Python)
camt053-v02.xml: camt.053.001.02, OK to import: a customer statement: each booked item appears once
camt053-v04.xml: camt.053.001.04, OK to import: a customer statement: each booked item appears once
camt053-v08.xml: camt.053.001.08, OK to import: a customer statement: each booked item appears once
intraday-report.xml: camt.052.001.08, REFUSED: an intraday report (camt.052), not a statement: its items return in the camt.053, so importing both counts them twice
Umsaetze.txt: mt940, OK to import: a customer statement: each booked item appears once [:61: credits 6, debits 1, reversed credits 1, returned debits 1; :86: German structured (?20-?29 purpose subfields)]
ing.sta: mt940, OK to import: a customer statement: each booked item appears once [:61: credits 3, debits 1, reversed credits 0, returned debits 0; :86: code words (/EREF/, /REMI/)]
interim.sta: mt942, REFUSED: an MT942 interim report, not a statement: its items return in the MT940, so importing both counts them twice
(exit status 1)
output (Node.js)
camt053-v02.xml: camt.053.001.02, OK to import: a customer statement: each booked item appears once
camt053-v04.xml: camt.053.001.04, OK to import: a customer statement: each booked item appears once
camt053-v08.xml: camt.053.001.08, OK to import: a customer statement: each booked item appears once
intraday-report.xml: camt.052.001.08, REFUSED: an intraday report (camt.052), not a statement: its items return in the camt.053, so importing both counts them twice
Umsaetze.txt: mt940, OK to import: a customer statement: each booked item appears once [:61: credits 6, debits 1, reversed credits 1, returned debits 1; :86: German structured (?20-?29 purpose subfields)]
ing.sta: mt940, OK to import: a customer statement: each booked item appears once [:61: credits 3, debits 1, reversed credits 0, returned debits 0; :86: code words (/EREF/, /REMI/)]
interim.sta: mt942, REFUSED: an MT942 interim report, not a statement: its items return in the MT940, so importing both counts them twice
(exit status 1)

The intraday camt.052 and the MT942 were refused with the reason, so the exit status is 1. The counts come from the :61: lines: the reversed credit and the returned debit in Umsaetze.txt are the lines a matcher must not treat as a customer paying.

FAQ

Which should I download if my bank offers both camt.053 and MT940?

camt.053: it is XML, it names its own version, and it is where the German banking industry has moved. MT940 is a statement too, so it is fine when it is what your bank offers. What matters is not mixing in the intraday files.

Why not import the intraday report to see today's payments?

Its payments return in the next statement, so you would have to remove them yourself, and the intraday report can carry items that are not booked yet. The statement is the file where each booked item appears once.

What do .02, .04 and .08 mean?

They are versions of the same camt.053 message. Newer versions change the structure in places, for example where the payer's name sits, so a reader has to know which one it has. The namespace on the first element says.

Why does MT940 still exist?

Banks outside Germany, and statements downloaded years ago, still use it. The German banking industry's current specification has removed its MT940 chapter.

Related field notes

Citations

  1. Deutsche Kreditwirtschaft, DFU agreement Anlage 3, version 26.11 (valid from 15 November 2026): chapter 7 on camt statements; chapter 8 (MT940/MT942) reads "removed". www.ebics.de/de/datenformate
  2. Deutsche Kreditwirtschaft, DFU agreement Anlage 3, version 3.5 (Postbank's copy; the last to specify MT940): the :61: marks and the :86: subfields. www.postbank.de/dam/postbank/pdf/firmenkunden/Postbank-DFUe-Spezifikationen-Anlage-3-20211121.pdf
  3. ISO 20022 XSD files for camt.053.001.02, .04 and .08, as copied in the genkgo/camt repository. github.com/genkgo/camt/tree/56e047d1599854ca34db0ccabce15230fcdd3f16/assets
Statements only, by design

Transferproof reads camt.053 (.02, .04 and .08), MT940 and CSV. It refuses camt.052, camt.054 and MT942 with the reason, imports only credit entries, and holds reversals and returns for a person instead of matching them.

Did this save you a morning with the bank statement?

If it did, you can buy me a coffee. It is the best way to keep these field notes free and growing.

Buy me a coffee on Ko-fi

Back to all WooCommerce and Stripe field notes