ZUGFeRD validator for .NET: reliably validate incoming e-invoices
The Validator extracts the embedded XML from an invoice PDF, checks the PDF container (PDF/A-3 & Factur-X) and validates the XML against the official rule sets – all the way to the official Schematron validation of Factur-X/ZUGFeRD and KoSIT XRechnung. Validation runs entirely offline inside your application – all rule sets ship with the package, no invoice ever leaves your system.
- .NET Framework 4.8
- .NET 8
- .NET 10
- ZUGFeRD 2.5.2 / Factur-X 1.09.2
- XRechnung 3.0 (CII & UBL)
dotnet add package Facturexa.ZugferdValidator
Install-Package Facturexa.ZugferdValidator
PDF container
PDF/A-3 conformance, file naming convention, XMP metadata and the Factur-X embedding of the XML are checked – in line with the official ZUGFeRD validation tool.
Official XML schema
The Validator first checks CII invoices against the official XML schema: ZUGFeRD/Factur-X against the schema of the respective profile (Factur-X 1.09.2), which only allows that profile’s elements, and XRechnung against CII D16B like the KoSIT validator. This also catches structural errors the Schematron does not see – such as a wrong element order or an element not allowed in the profile.
Official Schematron
The official Schematron then checks the business rules (Factur-X/ZUGFeRD or KoSIT XRechnung, via Saxon/XSLT 2.0) – the same rule sets your invoice recipients use. An invoice is only valid if both checks pass.
Fully offline
The Validator needs no internet connection at runtime and calls no external service.
- Data protection: invoices are validated solely inside your application – nothing is sent to third parties.
- No internet required: works in isolated networks and on servers without internet access.
- Independent: no outages or limits of an online validation service; the license check runs locally too.
Coverage
The Validator covers all common profiles – for XRechnung both the CII and the UBL syntax.
| Profile | Description | Validator | Creator |
|---|---|---|---|
| MINIMUM | Header data only, not a valid e-invoice format on its own | ✔ Yes | ✔ Yes |
| BASIC WL | Header data without invoice lines | ✔ Yes | ✔ Yes |
| BASIC | Core information including invoice lines | ✔ Yes | ✔ Yes |
| EN 16931 / COMFORT | European core standard – valid e-invoice format | ✔ Yes | ✔ Yes |
| EXTENDED | Extended data set; from ZUGFeRD 2.5.2 including sub-lines, kits & bundles | ✔ Yes | ✔ Yes |
| XRechnung 3.0 (CIUS) | German B2G core variant, two-stage EN 16931 + CIUS | ✔ Yes (CII + UBL) | ✔ Yes (CII) |
| UBL generation | Output XRechnung as UBL instead of CII | n/a (already validated) | Roadmap |
Integration made simple
A single call is enough: pass the PDF and the Validator checks the PDF container, the XML schema and the official Schematron. The example below mirrors the actual flow used by the live demo on this site.
using Facturexa.ZugferdValidator;
// Once at application startup.
ZugferdValidatorLicense.RegisterLicense("…");
// PDF container (PDF/A-3 & Factur-X), XML schema and official Schematron in one call.
var result = ZugferdValidator.Validate("invoice.pdf", "INV-2026-0001");
if (result.IsPdfValid == false)
Console.WriteLine("PDF container not compliant");
if (!result.IsValid)
{
foreach (var error in result.Errors)
Console.WriteLine($"{error.Stage}: {error}"); // e.g. "Schematron: BR-CO-15 (BT-112): ..."
}
Validator and Creator in one license
Validate and create e-invoices – for incoming and outgoing invoices alike. The Reader is free.