Repository navigation
Validating invoices
How ZeRechnung validates invoices, which rules apply when, and how to pick them. For the number of rules in each set and the official artefacts they come from, see Coverage and accuracy.
- Validating a PDF or an XML file
- Options
- UBL invoices
- FatturaPA documents
- Facturae documents
- Factur-X or CEN rules
- Profiles admitted by country
- Germany: Leitweg-ID and GEBA
- France: B2G invoices for Chorus Pro
- Peppol BIS Billing 3.0
- NLCIUS (the Netherlands)
- CIUS-IT (Italy)
- Command line
report, att, err := zerechnung.Check(pdf, &validate.Options{Auto: true})
if err != nil {
log.Fatal(err) // the PDF cannot be read at all
}
for _, f := range report.Findings {
fmt.Println(f.Severity, f.Rule, f.Message, f.Path, f.Line)
}
if !report.Valid() {
// at least one error
}Check checks the PDF container first, then the XML. For an XML file on its own, use validate.XML(xml, opts). It detects the syntax (CII, UBL or ZUGFeRD 1.0) by itself.
The report never stops at the first error. Each finding carries the official rule identifier, its severity, its source (rule set), an XPath to the element and the line in the XML. Messages are those of the official artefacts. report.Errors(), report.Warnings(), report.Has("BR-CO-10") and report.Rules() help to filter it.
validate.Catalog(set) lists the rules a set implements.
| Option | Effect |
|---|---|
nil or &validate.Options{}
|
Schema (of the profile, CII D16B for XRECHNUNG, or UBL 2.1), EN 16931 rules and Factur-X profile rules. Also BR-DE for an XRECHNUNG invoice, Peppol for a Peppol BIS Billing 3.0 invoice and BR-NL for an NLCIUS invoice (CII or UBL). |
Auto: true |
Adds the rules of the seller's country (BT-40): BR-FR and the profiles admitted in France for a seller in France, the profiles the BMF accepts for a seller in Germany. Check also applies the /AFRelationship admitted in that country. |
Rules: validate.Default | validate.France |
Picks the rule sets explicitly (France, Germany, GermanyProfile, ChorusPro, Peppol, Netherlands, Italy). BR-DE for XRECHNUNG, Peppol for a Peppol invoice and BR-NL for an NLCIUS invoice are always added. |
RejectBasicWL: true |
With the French rules, reports BASIC WL as an error (FR-PROFILE-03). |
Rules: ... | validate.ChorusPro |
Adds the Chorus Pro B2G checks (see below). |
Rules: ... | validate.Peppol |
Adds the Peppol BIS Billing 3.0 rules to an invoice that does not declare itself Peppol. |
Rules: ... | validate.Netherlands |
Adds the Dutch NLCIUS rules to an invoice that does not declare itself NLCIUS. |
Rules: ... | validate.Italy |
Adds the Italian CIUS-IT rules to an invoice that does not declare itself CIUS-IT. |
Profile: invoice.ProfileBasic |
Validates against this profile instead of the one declared in BT-24. |
Hybrid: true |
The XML comes from a Factur-X PDF: an EN 16931 invoice gets the Factur-X schematron of its profile instead of the CEN rules (see below). zerechnung.Check and zerechnung.Create set it, and so does zerechnung validate -hybrid. |
The rule sets are bit flags:
| Set | What it checks |
|---|---|
Schema |
Structure against the XML schema: of the profile (CII) or UBL 2.1; minimal structural check of ZUGFeRD 1.0 |
EN16931 |
CEN business rules and code lists, and the UBL syntax rules for UBL |
FacturX |
Factur-X / ZUGFeRD profile rules (CII only) |
France |
French rules BR-FR (2026 reform) and the profiles the reform admits (FR-PROFILE-*) |
Germany |
German rules BR-DE (XRechnung), Leitweg-ID and GEBA formats (DE-LEITWEG-, DE-GEBA-) |
GermanyProfile |
Profiles the BMF accepts as e-invoices (DE-PROFILE-01) |
ChorusPro |
French B2G checks for Chorus Pro (CPRO-*) |
Peppol |
Peppol BIS Billing 3.0 rules and their national rules |
Netherlands |
Dutch NLCIUS rules (BR-NL), and for UBL the SI-UBL 2.0 version check and the G-account rules (BR-GA) |
Italy |
Italian CIUS-IT rules (BR-IT) and the rules of its extensions (BR-IT-DE), the specification identifier check (IT-PROFILE-01), Partita IVA and Codice Fiscale (IT-PIVA-, IT-CF-) |
Default |
Schema | EN16931 | FacturX, used when Rules is zero |
validate.XML checks a UBL 2.1 Invoice or CreditNote against the OASIS UBL 2.1 XSD of its document, with the same XSD-* rules as CII. It then applies the EN 16931 artefacts for UBL: business rules and code lists in their UBL contexts, and the syntax rules UBL-CR (elements and attributes EN 16931 does not use, as warnings), UBL-SR (cardinalities) and UBL-DT (data types).
The Factur-X profile rules are specific to CII and do not apply. BR-FR, BR-DE, Peppol and BR-NL follow the UBL schematrons of their sets, with their identifiers, contexts and messages, and run on the UBL document itself. The Chorus Pro and CIUS-IT rules run on a CII view of the document, except the rules of the Italian extensions (BR-IT-DE), which read the UBL document itself. Every finding is located in the UBL.
A Factur-X PDF that embeds a UBL invoice is refused: Factur-X requires CII.
validate.XML recognises a FatturaPA 1.2 document (p:FatturaElettronica, FPA12 or FPR12) and checks it against the FatturaPA schema 1.2.4 of the Agenzia delle Entrate, with the same XSD-* rules as CII and UBL (the Schema set). The schema 1.2.3, in force until 10/01/2027, differs only by the tax regime RF21, which is therefore accepted. The tables cover the choice between Denominazione and Nome + Cognome, the bounds, the Latin-only patterns and the default value of Nazione; the content of the XML signature (ds:Signature) is not checked. xmllint gives the same verdicts on the test documents, the mutations and the official examples.
The document is also checked against the 40 SDI controls on the content that need none of the SDI data, whatever the sets: they are listed in appendix 1 of the FatturaPA technical specifications (1.9.1 and 1.10) and reported under their codes, with the source SDI:
- identifiers (00300 to 00306): format and check character of the partita IVA and the codice fiscale, which catches a code the SDI would not find; whether the code exists in the Anagrafe tributaria is not checked;
- transmission:
CodiceDestinatarioagainst the format,XXXXXXXreserved to buyers abroad,FormatoTrasmissioneagainst theversioneattribute, PEC addresses of the SDI (00313, 00330, 00427, 00428); - VAT rates and natures of the lines, pension fund contributions and summaries, with the TD16 exception, and the generic natures N2, N3 and N6 refused (00400, 00401, 00413, 00414, 00424, 00429, 00430, 00445);
- amounts: the total of a line within a cent, discounts and supplements applied in turn (00423), the tax of each summary (00421), the taxable amount of each rate within one euro, lines, contributions and roundings included (00422), rates and natures without a summary (00443, which also stands for 00419, and 00444);
- document and lot: a date after the reception (00403:
Options.ReceivedAt, the current time by default, compared in Italian time), a number without a digit (00425) or repeated in a lot, credit notes aside (00409), withholding (00411, 00415), a linked invoice dated later (00418), discounts without percentage or amount (00437, 00438), reverse charge with split payment (00420); - parties against the document type (00417, 00471 to 00476).
The controls that need the SDI data are not made: duplicate file or invoice (00002, 00404), recipient code not valid or not active (00311, 00312), tax codes not consistent with the Anagrafe tributaria or VAT groups (00320 to 00327), invalidated declaration of intent (00477). The other sets are written for EN 16931 invoices and do not apply; a signed file is checked by fatturapa.VerifySignature (see Reading invoices). To apply the CIUS-IT rules, read the document with fatturapa.Parse and validate the UBL that ubl.Marshal writes: for a seller in Italy, it is a domestic invoice whose Italian extensions carry part of the FatturaPA data, so the rules of the extensions (BR-IT-DE) apply too. The CII that cii.Marshal writes gets the CIUS-IT rules, and of the rules of the extensions only BR-IT-DE-052. zerechnung validate prints Format: FatturaPA FPR12 instead of a profile, and -json adds a format field.
validate.XML recognises a Facturae document (root element Facturae in the namespace of version 3.2, 3.2.1 or 3.2.2) and checks it against the schema of its version, published by facturae.gob.es, with the same XSD-* rules as CII and UBL (the Schema set). The three schemas are compiled into one set of tables; they cover the choices between LegalEntity and Individual, between AddressInSpain and OverseasAddress, between IBAN and AccountNumber, the decimal patterns of the amounts and rates (xs:double with two to eight decimals) and the default value of SchemaVersion. The content of the XML signature (ds:Signature) and of the Extensions elements is not checked. FE-01 reports a value the facturae package cannot read (amount, rate, date, country code, payment means) or a document without file header, parties or invoice.
Facturae is not a syntax of EN 16931, and no official mapping is published: the other sets do not apply, which the warning FE-02 says whatever the sets. To apply the EN 16931 rules, read the document with facturae.Parse and validate the UBL or CII that ubl.Marshal or cii.Marshal writes. There is no Spanish rule set: the AEAT business rules are a draft with no error codes, and the NIF check is not published. zerechnung validate prints Format: Facturae 3.2.2 instead of a profile.
A BASIC or EXTENDED invoice gets the Factur-X 1.09.2 schematron of its profile (FNFE-MPE / FeRD). It is the official reference for these profiles, and Mustang applies it too. It repeats the CEN business rules, with some differences:
- it checks code lists against its own lists (rules FX-SCH-A, instead of the CEN's BR-CL);
- it keeps only part of the CII syntax rules;
- it raises CII-SR-465 and CII-SR-466 (contact with a person name and a department) as errors;
- it refuses a BT-24 with an obsolete spelling (FX-PROFILE-03 as an error).
The two sets of code lists differ on a few codes: electronic address scheme 9958, allowance reasons ABK, ADZ and CAO, packaging units (PackageQuantity) in EXTENDED...
An EN 16931 invoice gets this schematron when it is the XML of a Factur-X PDF. zerechnung.Check and zerechnung.Create set validate.Options.Hybrid, and zerechnung validate -hybrid sets it for an XML file.
Without Hybrid, an EN 16931 invoice gets the CEN 1.3.17 rules, as in the KoSIT validator. Its identifier, urn:cen.eu:en16931:2017, is that of any CII invoice that conforms to EN 16931 without a CIUS, and nothing in the XML says it is meant for a Factur-X PDF. The verdicts then differ only on code lists, on the currencyID attribute of an amount other than the VAT total (CII-DT-031: an error for the CEN, allowed by Factur-X), and on the severity of CII-SR-465 and CII-SR-466.
The official schematrons do not check the profile. These checks have identifiers of their own:
| Rule | Severity | Set | Finding |
|---|---|---|---|
| FR-PROFILE-01 | error | France |
MINIMUM, excluded from the French reform |
| FR-PROFILE-02 | warning | France |
BASIC, which the reform does not list (absent from the FNFE-MPE package and from the directory capabilities) |
| FR-PROFILE-03 | error |
France with RejectBasicWL
|
BASIC WL, admitted today with no published end date. The option lets you refuse it now, or once it is no longer admitted. |
| DE-PROFILE-01 | error | GermanyProfile |
MINIMUM and BASIC WL, which the BMF does not accept as e-invoices (BMF letter of 15/10/2024: ZUGFeRD from 2.0.1, except these two profiles) |
In France, EN 16931 and EXTENDED-CTC-FR are the base and EXTENDED is admitted. In Germany, BASIC, EN 16931, EXTENDED and XRECHNUNG are accepted. Auto does not apply BR-DE to a ZUGFeRD invoice: those rules concern XRECHNUNG only, and apply to it whatever the rule sets.
The XRechnung schematron requires BT-10 (BR-DE-15) and accepts the electronic address schemes 0204 (Leitweg-ID) and 0246 (GEBA) without checking their form. The Germany set also checks their format and check digits, as warnings and with identifiers of its own. A malformed value is not checked for its check digits.
| Rule | Severity | Values | Finding |
|---|---|---|---|
| DE-LEITWEG-01 | warning | BT-10; BT-34 and BT-49 with scheme 0204 | Format of the Leitweg-ID Formatspezifikation 2.0.2: a Grobadressierung of 2, 3, 5, 8, 9 or 12 digits starting with the code of a Land (01 to 16) or of the Bund (99), an optional Feinadressierung of 1 to 30 letters or digits, two check digits, separated by "-" |
| DE-LEITWEG-02 | warning | same | Check digits, ISO/IEC 7064 MOD 97-10. The message gives the expected digits. |
| DE-GEBA-01 | warning | BT-34 and BT-49 with scheme 0246 | Format of the GEBA Formatspezifikation 1.0.1: DE and the 9 digits of the W-IdNr, then optionally "-" and a 5-digit Unterscheidungsmerkmal, then optionally "." and a sub-address of 1 to 8 letters or digits |
| DE-GEBA-02 | warning | same | Check digit of the W-IdNr (ISO 7064 MOD 11,10, as for the USt-IdNr) |
In an XRECHNUNG invoice, BT-10 carries the Leitweg-ID of the public buyer. A B2B invoice that puts another reference there gets DE-LEITWEG-01, which it can ignore.
The ChorusPro set checks an invoice sent to a public body, to catch Chorus Pro rejections early. It is never applied automatically, because nothing in the XML says that the buyer is public. The requirements that depend on how the public body is set up in the Chorus Pro directory go in PublicBuyer:
report := validate.XML(xml, &validate.Options{
Rules: validate.Default | validate.France | validate.ChorusPro,
PublicBuyer: validate.PublicBuyer{ServiceCodeRequired: true, EngagementRequired: true},
})| Rule | Check | Chorus Pro rejection avoided |
|---|---|---|
| CPRO-01 | The public body is identified by its SIRET: BT-46 with scheme 0009 (reform), or a 14-character BT-47 with scheme 0002 or no scheme (historical Chorus Pro format) | COD-021 |
| CPRO-02 | This SIRET has 14 digits and a valid Luhn key (for La Poste, the sum of the digits is a multiple of 5) | n/a |
| CPRO-03 | The service code (BT-10) is present, if ServiceCodeRequired
|
COD-022 |
| CPRO-04 | The service code has at most 100 characters: letters, digits, space, _ and -
|
FOR-009, FOR-047 |
| CPRO-05 | The engagement number (BT-13), or failing that the contract reference (BT-12), is present, if EngagementRequired
|
COH-053 |
| CPRO-06 | BT-13 and BT-12 have at most 50 characters | FOR-013 |
| CPRO-07 | The document type (BT-3) is not 751 | COD-001 |
| CPRO-08 | The invoice number (BT-1) and the preceding invoice number (BT-25) have at most 20 characters: ASCII letters and digits, space, -, +, _ and /
|
FOR-049 |
Sources: EDI annex of the Chorus Pro external specifications V4.23 (rules G1.05, G2.06, G2.07, G2.16 to G2.19, G2.29, G3.01, G3.03, G3.04, S2.04, S2.13), error message annex V3.02, Chorus Pro file of the DGFiP external specifications v3.1 (invoice number limited to 20 characters in B2G after the reform). No official schematron covers these checks, so the identifiers are specific to ZeRechnung. What Chorus Pro checks in its directory (that the SIRET and service code exist, that the body is active) cannot be checked offline.
The Peppol set applies the Peppol BIS Billing 3.0 schematron of the invoice's syntax: the 90 assertions of PEPPOL-EN16931-CII.sch to a CII invoice, and the 165 of PEPPOL-EN16931-UBL.sch to a UBL invoice, checked on the UBL document itself and not on its CII view.
Both share:
- the PEPPOL-EN16931-R rules: business process BT-23, specification identifier BT-24, buyer or order reference, electronic addresses of seller and buyer, a single note, VAT totals, allowances and charges, line net amount, line periods;
- identifier formats by ICD scheme (PEPPOL-COMMON-R: GLN, Norwegian, Swedish, Danish, Belgian and Dutch organisation numbers, Italian codes, Australian ABN...);
- restricted code lists;
- Norwegian, Danish, Italian, Swedish and Dutch national rules, applied by the seller's country.
The UBL schematron also has rules of its own: no empty element (PEPPOL-EN16931-R008), one currency for all amounts (R051), allowances on the price (R044, R046), invoice and credit note type codes (P0100, P0101, P0112), VAT exemption reasons (P0104 to P0111), and Greek (GR-), Icelandic (IS-R-) and German (DE-R-*) national rules.
It applies automatically when BT-24 is the Peppol identifier (urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0, profile invoice.ProfilePeppol), whatever the sets in Rules. Otherwise only on request (Rules: validate.Default | validate.Peppol, zerechnung validate -peppol).
Auto never adds it. Most valid Factur-X and ZUGFeRD invoices do not meet these rules (no Peppol BT-23, no electronic address, no buyer reference), and applying them unconditionally would flag them wrongly. In UBL, BT-24 is cbc:CustomizationID.
The rules reproduce each schematron as written. The CII schematron sometimes targets UBL more than CII:
- VAT identifiers are looked up with the UBL
schemeIDVAT. A CII identifier (VA) is used neither to find the seller's country (its address then decides the Norwegian and Italian rules) nor for NO-R-001, SE-R-001 and SE-R-002; - PEPPOL-EN16931-P0100 looks at
ram:ExchangedDocument/ram:TypeCode, which a CII invoice does not have (the document isrsm:ExchangedDocument), so the rule never fires; - DK-R-007 looks for the direct debit mandate under the payment means, while CII puts it in the payment terms.
In UBL, the seller's country for the Norwegian, Italian and Greek rules is the prefix of its VAT identifier (or that of its tax representative), and its address only when there is none. The Danish, Icelandic, Dutch and German rules look at addresses.
The UBL schematron has its own oddities: PEPPOL-EN16931-R080 applies only to a credit note, DK-R-005 to DK-R-011 only to an invoice, NL-R-001 only to a cbc:CreditNoteTypeCode. IS-R-009 and IS-R-010 look for the due date at document level, where a credit note does not carry it. DE-R-022 compares file names case-sensitively. DK-R-003 is an error there, while the CII schematron makes it a warning.
The Netherlands set applies the rules of NLCIUS, the Dutch CIUS of EN 16931, as the Dutch Peppol authority (NPa) publishes them in its validation artefacts (release of 2026-05-21, in force on 17 August 2026).
- To a CII invoice, it applies the 32 assertions of the
nlciuspattern ofNLCIUS-CII-validation.sch(NLCIUS-CII 1.0.3.13). - To a UBL invoice (SI-UBL 2.0), it applies the 35 assertions of the
nlciuspattern ofsi-ubl-2.0-nlcius.schand of theSI-UBL-VERSIONpattern ofsi-ubl-2.0.sch(SI-UBL 2.0.3.13), checked on the UBL document itself. - To a UBL invoice that declares the G-account extension, it applies the 9 assertions of the
g-account-extensionpattern ofsi-ubl-2.0-ext-gaccount.sch(version 1.0.2.13) instead ofSI-UBL-VERSION.
The EN 16931 rules these validators include are those of the EN16931 set.
The BR-NL rules cover the KVK or OIN identifier of a Dutch seller and buyer (BR-NL-1, BR-NL-10), the buyer or order reference (BR-NL-2, BR-NL-13), complete addresses (BR-NL-3 to BR-NL-5), document type codes (BR-NL-7, and in UBL BR-NL-8 and BR-NL-9) and the payment means (BR-NL-11, BR-NL-12). About twenty warnings discourage data that is pointless in the Netherlands (BR-NL-19 to BR-NL-35) and empty elements.
It applies automatically when BT-24 is the NLCIUS identifier (urn:cen.eu:en16931:2017#compliant#urn:fdc:nen.nl:nlcius:v1.0, profile invoice.ProfileNLCIUS), alone or followed by the G-account extension (#conformant#urn:fdc:nen.nl:gaccount:v1.0), whatever the sets in Rules. Otherwise only on request (Rules: validate.Default | validate.Netherlands, zerechnung validate -nl).
As with Peppol, Auto never adds it: a seller established in the Netherlands is not required to issue NLCIUS invoices.
The schematrons choose which invoices they target, and ZeRechnung does the same. Most rules apply only to a supplier established in the Netherlands (BT-40); BR-NL-13 (and BR-NL-7 in CII) apply to every NLCIUS invoice. On a UBL invoice that does not declare itself NLCIUS, the requested set reports SI-V20-INV-R000, like the SI-UBL validator.
The rules reproduce each schematron as written, rule order included: an element is checked only by the first rule whose context matches it. A few assertions of the artefacts can therefore never fire and are not written: BR-NL-9 and BR-NL-31 in CII; BR-NL-32-2, BR-NL-32-3 and the assertions with the message of BR-NL-34 in UBL (an allowance or charge reason code, at document or line level, gives BR-NL-32-1).
The two schematrons also differ from each other. In CII, BR-NL-1 applies only if the seller has a ram:SpecifiedLegalOrganization, BR-NL-10 requires a legal identifier for the buyer whatever its country, and type codes are compared as numbers (0380 equals 380). In UBL, BR-NL-11 targets only an invoice, not a credit note.
The G-rekening extension (G-account, #conformant#urn:fdc:nen.nl:gaccount:v1.0 in BT-24) has part of the amount due paid into the supplier's blocked account. A validator picks its artefacts from BT-24, and ZeRechnung does the same for a UBL invoice whose cbc:CustomizationID contains the extension identifier: the g-account-extension pattern then replaces SI-UBL-VERSION, which these artefacts do not include, and its rules apply with no other condition.
- BR-GA-0 and its own version check (SI-V20-INV-R000) look at every
cbc:CustomizationID. - On an
Invoice, BR-GA-1 and BR-GA-2 require two payment terms (NL-GA-01) and two payment means (BG-16). - BR-GA-3 requires the sum of the payment term amounts (NL-GA-03) to equal the amount due (BT-115), compared in exact decimals.
- BR-GA-4 and BR-GA-5 require a reference (NL-GA-02) in each payment term and an identifier (NL-GA-04) in each payment means.
- BR-GA-6 requires each reference to point to an identifier, and BR-GA-7 exactly one payment means with the identifier
GACCOUNT.
The nlcius pattern applies as to any SI-UBL 2.0 invoice. These artefacts also change the CEN syntax rules: an invoice that declares the extension does not get UBL-CR-411, UBL-CR-453 and UBL-CR-459 (payment means identifier, payment terms reference and amount), which the extension uses.
The NPa publishes no G-account extension for NLCIUS-CII, so a CII invoice that declares it gets the NLCIUS rules only. Reading and writing the extension data is described in Reading invoices.
The Italy set applies the Italian technical rules (Regole tecniche of art. 3 of d.lgs. 148/2018, version 2.7, whose rules have not changed since 2.5 but for one legal reference). They publish no schematron: the rules are written from their tables, with their identifiers, and the Italian text prevails where the English translation differs.
- The CIUS-IT rules of appendix 2 (BR-IT, BR-IT-DC): 59 of the 61 rules, on lengths and character sets, addresses and provinces, identifiers, payment means, VAT categories and split payment. BR-IT-DC-291 and BR-IT-DC-480 depend on facts the invoice does not carry. Three rules that only decide how the SDI maps a value are warnings (BR-IT-DC-150, BR-IT-220, BR-IT-250).
- The rules of the Italian extensions of appendix 3 (BR-IT-DE-001 to 042, 050 to 052), see below.
- Checks specific to ZeRechnung, as warnings: the specification identifier against the countries of the parties (IT-PROFILE-01), the format and check character of the Partita IVA (IT-PIVA-01/02) and of the Codice Fiscale (IT-CF-01/02).
The rules marked IT in the tables (BR-IT-DC, BR-IT-DE) apply only to a seller in Italy (BT-40). On a UBL invoice, the rules of appendix 2 run on a CII view of the document; every finding is located in the UBL.
It applies automatically when BT-24 is a CIUS-IT identifier (urn:cen.eu:en16931:2017#compliant#urn:fatturapa.gov.it:CIUS-IT:2.0.0, profile invoice.ProfileCIUSIT), alone (cross-border invoice) or followed by the Italian extension (#conformant#urn:fatturapa.gov.it:EXT-IT:1.0.0, domestic invoice), whatever the sets in Rules. Otherwise only on request (Rules: validate.Default | validate.Italy, zerechnung validate -it). Auto never adds it.
The domestic invoice of an Italian seller carries FatturaPA data that no business term holds. Appendix 4.2 gives its UBL layout: UBL extensions (ext:UBLExtension) and UBL elements outside EN 16931. The 45 rules of appendix 3 check them, as errors (PR #82):
- the extensions, recognised by their URI:
urn:fdc:agid.gov.it:fatturapa:followed bySoggettoEmittente(BR-IT-DE-001),TipoDocumento(002),TipoRitenuta(003),Art73(004),RiepilogoIVA:Arrotondamento(005) orScontoMaggiorazione(006 to 008), possibly followed by::and an index (TipoRitenuta::2for the second withholding). The technical rules do not give these URIs: they come from the AgID documentation of the domestic invoice; - the withholdings,
cac:WithholdingTaxTotal(009 to 013): one or two, each with its type, amount, category S, rate, scheme SWT and reason for payment; - the main invoice (
cac:BillingReference/cac:AdditionalDocumentReference) and the transport documents, with their dates (014 to 016, 040 to 042); - the tax regime, the permanent establishment (
cac:AgentParty) and the third-party intermediary (cac:ServiceProviderParty) of the seller (017 to 023, 050, 051); - the identifiers of the tax representative (024, 025), the carrier, pickup and shipment of the delivery (026 to 035), the delivery terms (036), the early payment discount and late payment penalty (037, 038) and the order number of a line (039).
The code lists (document types, withholding types, tax regimes, issuers) are those of the FatturaPA 1.2.4 schema. BR-IT-DE-052, written with business terms, applies to both syntaxes: an invoice line that references a purchase order line (BT-132) needs a purchase order reference, in the header (BT-13) or in the line. The other rules apply to UBL only, the only syntax appendix 4.2 extends. The EN 16931 syntax rules report these extensions and elements as UBL-CR warnings.
Two points of appendix 3 contradict other texts. The extension ScontoMaggiorazione holds one or more cac:AllowanceCharge, but the UBL 2.1 schema admits a single element in an ext:ExtensionContent: an extension with two discounts gets XSD-COUNT. BR-IT-DE-040 requires NA as the transport document line reference, where the table of appendix 4.2 says 0: ZeRechnung follows the rule. The AgID documentation adds rules that appendix 3 does not have (BR-IT-DE-043 to 049 among them): they are not checked.
zerechnung validate [-fr] [-de] [-peppol] [-nl] [-it] [-auto] [-reject-basicwl]
[-choruspro [-service-required] [-engagement-required]]
[-profile p] [-hybrid] [-json] invoice.pdf|invoice.xml
zerechnung rules [-fr] [-de] [-choruspro] [-peppol] [-nl] [-it]
validate accepts a PDF, or a CII, UBL, FatturaPA or Facturae XML file. It exits with code 1 when the invoice has errors, so you can use it in CI. The rule options (-fr, -de, -choruspro, -peppol, -nl, -it) add to the default rules. They never remove BR-DE from an XRECHNUNG invoice, Peppol from a Peppol invoice, BR-NL from an NLCIUS invoice or BR-IT from a CIUS-IT invoice. -json prints the report as JSON. rules lists the rules of the selected sets.
ZeRechnung
Guides
- Creating invoices
- Reading invoices
- Validating invoices
- Coverage and accuracy
- Testing
- License and provenance
By country
- Facturer en France
- E-Rechnungen in Deutschland
- E-facturen in Nederland
- Fatturazione elettronica in Italia
- Facturación electrónica en España
- Guides par pays
En français