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.
https://api.invoicexml.com/v1/validate/zugferd
Code Example
curl -X POST https://api.invoicexml.com/v1/validate/zugferd \ -H "Authorization: Bearer YOUR_API_KEY" \ -F "[email protected]" \ -F "version=2.3.2" \ -F "profile=extended"
Try it out online — no coding required
Upload an invoice and get a full compliance report instantly, right in your browser.
Request
| Parameter | Type | Description |
|---|---|---|
| file * | binary | The invoice file to validate. Accepted formats: PDF with embedded ZUGFeRD XML, or standalone zugferd-invoice.xml. |
| version | string | Standard version (e.g. 2.3.2). Defaults to the latest supported version. |
| profile | string | Compliance profile. Values: minimum, basicwl, basic, en16931, extended. Defaults to en16931. |
Content-Type: multipart/form-data
Headers
| Header | Value |
|---|---|
| Authorization * | Bearer YOUR_API_KEY |
| Content-Type | multipart/form-data |
Response
{
"valid": true,
"detail": "Your invoice is zugferd compliant and meets the EN 16931 specifications.",
"data": {
"schemaValid": true,
"schematronValid": true,
"conformanceLevel": "EN16931"
}
}
{
"valid": false,
"detail": "Validation failed with 3 error(s)",
"data": {
"conformanceLevel": "EN16931"
},
"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."
],
"friendly": [
{
"rule": "BR-01",
"line": null,
"message": "The invoice is missing a specification identifier (BT-24)."
},
{
"rule": "BR-06",
"line": null,
"message": "The seller must have a name (BT-27). Add the seller's name."
},
{
"rule": "BR-08",
"line": 2,
"message": "Line item 2: The document total amount with VAT is missing or incorrect."
}
]
}
}
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 the raw Schematron description.
The errors.friendly array provides a parallel set of user-facing messages — one object per violation. Each object contains:
| Field | Type | Description |
|---|---|---|
| rule | string | The business rule identifier (e.g. BR-01, BR-DE-15). |
| line | int | null | The 1-based invoice line item number the error relates to, or null when the error applies to the document level. |
| message | string | A plain-language explanation of the violation, suitable for displaying directly to end users. |
| Status | Meaning | Action |
|---|---|---|
| 200 | Validation completed. Check valid to determine compliance. |
If valid is false, inspect errors.xml or errors.friendly. |
| 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. |
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.