Automatisation Blog Tarifs Contact

Validate EN 16931 Invoice using REST-API

Validate an electronic invoice against the European EN 16931 standard — the semantic data model mandated by EU Directive 2014/55/EU for all public-sector invoicing. This endpoint accepts both CII and UBL syntaxes and checks the full set of EN 16931 Schematron business rules.

POST /v1/validate/en16931

Request

Parameter Type Description
file * binary The invoice file to validate. Accepted formats: CII XML, UBL XML, or PDF with embedded XML.

Content-Type: multipart/form-data

Headers

Header Value
Authorization * Bearer YOUR_API_KEY
Content-Type multipart/form-data

Response

200 The invoice is valid. Returns a JSON object with the validation result.
Content-Type: application/json
{
  "valid": true,
  "message": "The invoice is valid.",
  "profile": "EN16931",
  "standard": "en16931"
}
400 Validation failed. Returns a ProblemDetails object with structured error information.
{
  "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/en16931 \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "[email protected]"

Frequently Asked Questions

What is EN 16931 validation?

EN 16931 validation checks your electronic invoice against the European standard's business rules (BR-01 through BR-65, plus co-occurrence constraints). It is syntax-agnostic — the same semantic rules apply whether your invoice is in CII or UBL format.

Does this endpoint detect the syntax automatically?

Yes. The validator auto-detects whether the uploaded file is CII (CrossIndustryInvoice) or UBL (Invoice/CreditNote) and applies the appropriate syntax binding of the EN 16931 rules.

Is EN 16931 validation sufficient for German B2G?

For German B2G, you also need to pass XRechnung CIUS rules which add additional constraints. EN 16931 validation covers the European core — use /v1/validate/zugferd or the XRechnung validator for the full German compliance check.

Which EU countries require EN 16931?

All EU member states require EN 16931 for B2G invoicing since April 2020. France, Germany, Italy, Spain, and Poland are extending this to B2B transactions between 2024 and 2028.

Can I validate a PDF invoice?

Yes. If you upload a PDF with embedded XML (ZUGFeRD or Factur-X), the validator extracts the XML and checks it against EN 16931 rules. You can also upload a standalone XML file directly.