Validate ZUGFeRD Invoice using REST-API
Validate a ZUGFeRD 2.x hybrid invoice against the full German e-invoicing compliance stack. The API checks CII XML schema conformance, EN 16931 Schematron business rules, and ZUGFeRD profile-specific constraints — ensuring your invoices are ready for the 2025 German e-invoicing mandate.
/v1/validate/zugferd
Request
| Parameter | Type | Description |
|---|---|---|
| file * | binary | The invoice file to validate. Accepted formats: PDF with embedded ZUGFeRD XML, or standalone zugferd-invoice.xml. |
Content-Type: multipart/form-data
Headers
| Header | Value |
|---|---|
| Authorization * | Bearer YOUR_API_KEY |
| Content-Type | multipart/form-data |
Response
{
"valid": true,
"message": "The invoice is valid.",
"profile": "EN16931",
"standard": "zugferd"
}
{
"type": "https://tools.ietf.org/html/rfc9110#section-15.5.1",
"title": "Validation Failed",
"status": 400,
"detail": "The invoice contains 3 validation error(s).",
"errors": {
"xml": [
"[BR-01] An invoice shall have a specification identifier.",
"[BR-06] An invoice shall contain the seller name.",
"[BR-08] An invoice shall contain the document total amount."
]
}
}
Error Reference
When an invoice fails validation, the errors.xml array contains one entry per violated business rule. Each entry starts with the rule identifier (e.g. [BR-01]) followed by a human-readable description.
| Status | Meaning | Action |
|---|---|---|
| 200 | Invoice is valid — all Schematron rules passed. | No action required. |
| 400 | Validation errors found in the invoice. | Inspect errors.xml and fix the listed rule violations. |
| 401 | Missing or invalid API key. | Check the Authorization header. |
| 422 | File is not a valid PDF or XML document. | Ensure you are uploading a supported file format. |
Code Example
curl -X POST https://api.invoicexml.com/v1/validate/zugferd \ -H "Authorization: Bearer YOUR_API_KEY" \ -F "[email protected]"
Frequently Asked Questions
What is the difference between ZUGFeRD and Factur-X validation?
Technically, ZUGFeRD 2.x and Factur-X use the same CII XML schema and EN 16931 rules. The ZUGFeRD validator applies the German-branded profile names and is optimized for the German regulatory context, but the underlying checks are identical.
Which ZUGFeRD versions are supported?
The validator supports ZUGFeRD 2.1, 2.2, and 2.3. All profiles are supported: Minimum, Basic WL, Basic, EN 16931, and Extended. The version is auto-detected from the embedded XML.
Is ZUGFeRD validation mandatory under the German e-invoicing law?
The German e-invoicing mandate (Wachstumschancengesetz) requires structured e-invoices from 2025. While validation is not legally required, it ensures your invoices meet EN 16931 requirements and will be accepted by recipients.
Can I validate ZUGFeRD invoices with XRechnung rules?
ZUGFeRD and XRechnung are different formats. ZUGFeRD is a hybrid PDF, XRechnung is standalone XML with stricter CIUS rules. Use the /v1/validate/en16931 endpoint to check EN 16931 core rules that both formats share.
What happens if the PDF is not PDF/A-3?
The validator flags non-PDF/A-3 containers as a warning. While the XML content may be valid, the ZUGFeRD specification requires PDF/A-3 for the embedded attachment to be standard-compliant.