Validate Factur-X Invoice using REST-API
Validate a Factur-X hybrid invoice against the full compliance stack: XML schema (XSD), EN 16931 Schematron business rules, and PDF/A-3 embedding requirements. Upload a PDF containing embedded Factur-X XML and receive a detailed validation report.
https://api.invoicexml.com/v1/validate/facturx
Code Example
curl -X POST https://api.invoicexml.com/v1/validate/facturx \ -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 Factur-X XML, or standalone Factur-X 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 facturx 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 does Factur-X validation check?
The validator runs three layers of checks: (1) XML schema conformance against the Factur-X XSD, (2) EN 16931 Schematron business rules (BR-01 through BR-65 and all co-occurrence rules), and (3) profile-specific rules for the declared Factur-X profile (Minimum, Basic WL, Basic, EN 16931, or Extended).
Can I validate a standalone XML file?
Yes. You can upload either a Factur-X PDF (with embedded XML) or a standalone factur-x.xml file. When you upload a PDF, the API extracts the embedded XML automatically before running validation.
What are the BR rules in the error response?
BR rules are business rules defined by EN 16931. For example, BR-01 requires a specification identifier, BR-06 requires the seller name, and BR-16 requires at least one invoice line. Each violated rule appears in the errors.xml array.
Is Factur-X validation required before submitting to Chorus Pro?
While not technically required, validating before submission prevents rejections. Chorus Pro (France's B2G portal) enforces the same Schematron rules — catching errors beforehand saves time and avoids failed submissions.
Which Factur-X versions are supported?
The validator supports Factur-X 1.0 and 1.07, covering all profiles from Minimum to Extended. The profile is auto-detected from the XML's GuidelineSpecifiedDocumentContextParameter.