Extract EREF+, MREF+ and CRED+ from MT940
These SEPA narrative markers identify the end-to-end payment, mandate and creditor respectively. They support different joins in the collections register, where one mandate can cover many debits.
Open this sample in Air-Gapped ConverterWorked bank sample
Synthetic bank data for local reconciliation.
:20:REPORT-1
:25:EUR-OPERATING
:28C:007/1
:60F:C261130EUR100,00
:61:261130C25,00NDDTCOL-084//BANK-084
:86:EREF+COL-084 MREF+MDT-006 CRED+DE98ZZZ09999999999
:62F:C261130EUR125,00Field anatomy
| Field or path | Meaning in this file | Type or format | ERP or Excel import risk |
|---|---|---|---|
| EREF+ | End-to-end reference | Identifier text | A mandate key collapses different collections. |
| MREF+ / CRED+ | Mandate / creditor identifiers | Separate strings | Joining across creditors can clear the wrong debtor. |
Root cause and ERP fix
- The suffix after EREF+ became a single key. Stop at the next recognised marker.
- A mandate reference was reused by another creditor. Use the mandate and creditor as a pair.
- An end-to-end value is a placeholder. Match using the bank reference and original collection evidence.
Inspect with the MIT parser
Save the sample as mt940-sepa-eref-mref-cred.sta and the script as inspect.mjs. With @stmtrecon/parser installed, run node inspect.mjs mt940-sepa-eref-mref-cred.sta.
import { readFile } from 'node:fs/promises';
import { inspect } from '@stmtrecon/parser';
const text = await readFile(process.argv[2], 'utf8');
const report = inspect(text, { transactions: true });
const rows = report.transactions;
const markers = /\b(EREF|MREF|CRED)\+(.+?)(?=\s+(?:EREF|MREF|CRED)\+|$)/g;
console.log(Object.fromEntries([...rows[0].narrative.matchAll(markers)].map(m => m.slice(1))));Open this sample in Air-Gapped ConverterExport a multi-sheet Excel workbook with balance checks and batch reconciliation on your device. No Node installation or cloud upload is required.
npm package · SDK source · Format reference