Automation Blog Pricing Contact

Validate CII Invoice using REST-API

Validate a UN/CEFACT Cross Industry Invoice (CII) XML document against the D16B schema and EN 16931 Schematron business rules. CII is the XML syntax used by ZUGFeRD, Factur-X, and many European e-invoicing networks — this endpoint verifies your standalone CII XML is fully compliant.

POST https://api.invoicexml.com/v1/validate/cii

Code Example

curl -X POST https://api.invoicexml.com/v1/validate/cii \
  -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.

Try It Online

Request

Parameter Type Description
file * binary The invoice file to validate. Accepted format: standalone CII XML document.
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

200 The invoice is valid. Returns a JSON object confirming compliance.
Content-Type: application/json
{
  "valid": true,
  "detail": "Your invoice is cii compliant and meets the EN 16931 specifications.",
  "data": {
    "schemaValid": true,
    "schematronValid": true,
    "conformanceLevel": "EN16931"
  }
}
200 The invoice has validation errors. Returns a JSON object with structured error information.
{
  "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 CII validation?

CII validation checks your Cross Industry Invoice XML against the UN/CEFACT D16B schema and the EN 16931 Schematron business rules. This ensures the document has the correct structure and satisfies all mandatory European invoicing requirements.

Should I use CII or UBL validation?

Use CII validation if your invoice follows the UN/CEFACT CII syntax — this is the format used inside ZUGFeRD and Factur-X files. Use EN 16931 validation if you want to validate the semantic model regardless of syntax.

Can I upload a ZUGFeRD PDF to this endpoint?

This endpoint expects a standalone CII XML file. If you have a ZUGFeRD or Factur-X PDF, use the /v1/validate/zugferd or /v1/validate/facturx endpoints — they extract the embedded XML automatically.

What CII schema version is validated against?

The validator uses CII D16B, which is the schema version referenced by EN 16931. This covers the CrossIndustryInvoice root element and all associated complex types.

Are CIUS-specific rules included?

The CII endpoint validates against the EN 16931 core rules. For country-specific CIUS rules (e.g., XRechnung, CIUS-FR), use the dedicated endpoints.