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 /v1/validate/cii

Request

Parameter Type Description
file * binary The invoice file to validate. Accepted format: standalone CII XML document.

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": "cii"
}
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/cii \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "[email protected]"

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.