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.
/v1/validate/facturx
Request
| Parameter | Type | Description |
|---|---|---|
| file * | binary | The invoice file to validate. Accepted formats: PDF with embedded Factur-X XML, or standalone Factur-X 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": "facturx"
}
{
"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/facturx \ -H "Authorization: Bearer YOUR_API_KEY" \ -F "[email protected]"
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.