pain.008.001.02 — NbOfTxs and CtrlSum wrong at both levels
Un addebito diretto SEPA che si conta e si somma male, su entrambi i livelli insieme: il lotto contiene davvero 2 incassi per 300,00 EUR, ma NbOfTxs dichiara 3 e CtrlSum 250,00 — nel PmtInf e di nuovo nel GrpHdr. Sono quattro errori, non due: i totali di controllo si verificano sul lotto di pagamento E sull’intestazione, perché un file multi-lotto può esibire un totale d’intestazione corretto poggiato su due totali di lotto sbagliati. L’XML è ben formato e l’XSD ufficiale lo accetta: per uno schema, NbOfTxs e CtrlSum sono solo numeri.
pain.008.001.02 — Non valido
Un addebito diretto SEPA che si conta e si somma male, su entrambi i livelli insieme: il lotto contiene davvero 2 incassi per 300,00 EUR, ma NbOfTxs dichiara 3 e CtrlSum 250,00 — nel PmtInf e di nuovo nel GrpHdr. Sono quattro errori, non due: i totali di controllo si verificano sul lotto di pagamento E sull’intestazione, perché un file multi-lotto può esibire un totale d’intestazione corretto poggiato su due totali di lotto sbagliati. L’XML è ben formato e l’XSD ufficiale lo accetta: per uno schema, NbOfTxs e CtrlSum sono solo numeri.
Cosa mostra questo file
Un addebito diretto SEPA che si conta e si somma male, su entrambi i livelli insieme: il lotto contiene davvero 2 incassi per 300,00 EUR, ma NbOfTxs dichiara 3 e CtrlSum 250,00 — nel PmtInf e di nuovo nel GrpHdr. Sono quattro errori, non due: i totali di controllo si verificano sul lotto di pagamento E sull’intestazione, perché un file multi-lotto può esibire un totale d’intestazione corretto poggiato su due totali di lotto sbagliati. L’XML è ben formato e l’XSD ufficiale lo accetta: per uno schema, NbOfTxs e CtrlSum sono solo numeri.
| Transazioni | 2 |
|---|---|
| Totale | 300,00 € |
| Schema | CORE |
| Data nel file | 2026-03-10 |
I difetti che contiene
- CtrlSumPmtInf CtrlSum mismatch: a payment batch declares 250.00 but its transactions total 300.00.
- NbOfTxsPmtInf NbOfTxs mismatch: a payment batch declares 3 but contains 2 transactions.
- CtrlSumCtrlSum mismatch: header declares 250.00 but calculated total is 300.00.
- NbOfTxsNbOfTxs mismatch: header declares 3 but found 2 transactions.
Citato alla lettera dal validatore, non parafrasato.
Tutte le parti, gli IBAN e gli importi qui sotto sono fittizi. Gli IBAN sono strutturalmente validi — superano il mod-97 — ma non corrispondono ad alcun conto reale.
Contenuto del file
<?xml version="1.0" encoding="UTF-8"?>
<!--
ValidateFin sample file — SEPA Direct Debit, pain.008.001.02, BROKEN ON PURPOSE.
Expected validation result: INVALID — both control totals lie, at both levels.
The batch really contains 2 collections adding up to 300.00 EUR, but NbOfTxs says 3
and CtrlSum says 250.00 — in the PmtInf AND in the GrpHdr. That is four errors, not
two: the totals are checked on the payment batch and again on the file header, and a
file with several batches can very well have a correct header total sitting on top of
two batches whose own totals are wrong.
This is the classic symptom of a payment file assembled in a loop where one record
was dropped after the header was written. The XML is well-formed and the official XSD
accepts it: NbOfTxs and CtrlSum are just numbers to a schema.
All parties and account numbers are fictitious.
Reference page: https://validatefin.com/en/resources/samples/sepa-pain008-invalid-totals
License: CC-BY-4.0
-->
<Document xmlns="urn:iso:std:iso:20022:tech:xsd:pain.008.001.02"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<CstmrDrctDbtInitn>
<GrpHdr>
<MsgId>SDD-BADTOTALS-20260302</MsgId>
<CreDtTm>2026-03-02T11:00:00</CreDtTm>
<NbOfTxs>3</NbOfTxs>
<CtrlSum>250.00</CtrlSum>
<InitgPty>
<Nm>Editions Lumiere SARL</Nm>
</InitgPty>
</GrpHdr>
<PmtInf>
<PmtInfId>PMT-SDD-BADTOTALS-001</PmtInfId>
<PmtMtd>DD</PmtMtd>
<NbOfTxs>3</NbOfTxs>
<CtrlSum>250.00</CtrlSum>
<PmtTpInf>
<SvcLvl>
<Cd>SEPA</Cd>
</SvcLvl>
<LclInstrm>
<Cd>CORE</Cd>
</LclInstrm>
<SeqTp>RCUR</SeqTp>
</PmtTpInf>
<ReqdColltnDt>2026-03-10</ReqdColltnDt>
<Cdtr>
<Nm>Editions Lumiere SARL</Nm>
<PstlAdr>
<TwnNm>Paris</TwnNm>
<Ctry>FR</Ctry>
</PstlAdr>
</Cdtr>
<CdtrAcct>
<Id>
<IBAN>FR7610107001011234567890129</IBAN>
</Id>
<Ccy>EUR</Ccy>
</CdtrAcct>
<CdtrAgt>
<FinInstnId>
<BIC>CCBPFRPP</BIC>
</FinInstnId>
</CdtrAgt>
<ChrgBr>SLEV</ChrgBr>
<CdtrSchmeId>
<Id>
<PrvtId>
<Othr>
<Id>FR72ZZZ123456</Id>
<SchmeNm>
<Prtry>SEPA</Prtry>
</SchmeNm>
</Othr>
</PrvtId>
</Id>
</CdtrSchmeId>
<DrctDbtTxInf>
<PmtId>
<EndToEndId>E2E-BADTOTALS-2026-0301</EndToEndId>
</PmtId>
<InstdAmt Ccy="EUR">180.00</InstdAmt>
<DrctDbtTx>
<MndtRltdInf>
<MndtId>MNDT-2024-000731</MndtId>
<DtOfSgntr>2024-09-12</DtOfSgntr>
<AmdmntInd>false</AmdmntInd>
</MndtRltdInf>
</DrctDbtTx>
<DbtrAgt>
<FinInstnId>
<BIC>PSSTFRPP</BIC>
</FinInstnId>
</DbtrAgt>
<Dbtr>
<Nm>Camille Rousseau</Nm>
<PstlAdr>
<TwnNm>Lyon</TwnNm>
<Ctry>FR</Ctry>
</PstlAdr>
</Dbtr>
<DbtrAcct>
<Id>
<IBAN>FR1420041010050500013M02606</IBAN>
</Id>
</DbtrAcct>
<RmtInf>
<Ustrd>Abonnement annuel 2026 - facture AB-2026-0731</Ustrd>
</RmtInf>
</DrctDbtTxInf>
<DrctDbtTxInf>
<PmtId>
<EndToEndId>E2E-BADTOTALS-2026-0302</EndToEndId>
</PmtId>
<InstdAmt Ccy="EUR">120.00</InstdAmt>
<DrctDbtTx>
<MndtRltdInf>
<MndtId>MNDT-2025-001188</MndtId>
<DtOfSgntr>2025-01-20</DtOfSgntr>
<AmdmntInd>false</AmdmntInd>
</MndtRltdInf>
</DrctDbtTx>
<DbtrAgt>
<FinInstnId>
<BIC>GEBABEBB</BIC>
</FinInstnId>
</DbtrAgt>
<Dbtr>
<Nm>Bureau Verhoeven BVBA</Nm>
<PstlAdr>
<TwnNm>Gent</TwnNm>
<Ctry>BE</Ctry>
</PstlAdr>
</Dbtr>
<DbtrAcct>
<Id>
<IBAN>BE68539007547034</IBAN>
</Id>
</DbtrAcct>
<RmtInf>
<Ustrd>Abonnement annuel 2026 - facture AB-2026-0788</Ustrd>
</RmtInf>
</DrctDbtTxInf>
</PmtInf>
</CstmrDrctDbtInitn>
</Document>
Come sappiamo che questi risultati reggono
Ogni file di questa libreria passa nel validatore del sito a ogni build. Il risultato atteso indicato sopra è verificato da un test automatico: se un file smettesse di corrispondere a quanto afferma questa pagina, la build fallirebbe. Due fixture ereditate sono state riparate così prima della pubblicazione: tre IBAN non superavano il mod-97 e diversi nomi usavano caratteri fuori dal set SEPA di base.
Addebito diretto SEPA (pain.008)
- pain.008.001.02 — valid CORE direct debit
- pain.008.001.08 — valid CORE direct debit, collected after 2026-11-15
- pain.008.001.02 — mandate signed after the collection
- pain.008.001.08 — valid B2B direct debit, RCUR sequence
- pain.008.001.02 — valid CORE direct debit, FRST sequence
- pain.008.001.08 — valid one-off direct debit, OOFF sequence
- pain.008.001.02 — mandate identifier (MndtId) missing