Automation Blog Pricing Contact
POST /v1/validate/cii

CII Validation API

The InvoiceXML CII validation API validates any UN/CEFACT Cross-Industry Invoice XML against the official CII D16B XSD schema and all EN 16931 Schematron business rules. Accepts standalone CII XML from ERP exports, EDI pipelines, and Peppol networks.

Drop your CII XML or ZUGFeRD PDF here

or browse files to upload

POST /v1/validate/cii · Accepted: CII XML or ZUGFeRD/Factur-X PDF · Max 20 MB

Submit any standalone CII XML document or extract from a ZUGFeRD/Factur-X PDF. The API detects the EN 16931 profile from the GuidelineSpecifiedDocumentContextParameter, validates against the CII D16B XSD schema, and runs all 200+ EN 16931 Schematron business rules. Every violation returned with its rule ID, severity, and XPath location in the CII document tree.

Validate CII REST API Request

Submit standalone CII XML or extracted from a ZUGFeRD/Factur-X PDF — profile detection is fully automatic:

Request
$ curl -X POST https://api.invoicexml.com/v1/validate/cii \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "[email protected]"

Validate CII API Response

Both valid and invalid documents return HTTP 200. The response includes the detected EN 16931 profile and the full specification identifier read from the GuidelineSpecifiedDocumentContextParameter — so you can verify the invoice declares the profile you intended before it goes into production.

CII validation errors often originate deep in the nested trade transaction structure. The friendly message array translates cryptic XPath expressions like /*:CrossIndustryInvoice[...]/*:SupplyChainTradeTransaction[...]/*:IncludedSupplyChainTradeLineItem[2] into plain line-item references that your team can act on immediately.

Valid CII Response

Response — valid invoice
// 200 OK
{
  "valid": true,
  "detail": "Your CII invoice is EN 16931 compliant.",
  "data": {
    "schemaValid": true,
    "schematronValid": true,
    "conformanceLevel": "EN16931",
    "specificationIdentifier": "urn:cen.eu:en16931:2017"
  }
}

Invalid CII Response

Response — invalid invoice
// 200 OK
{
  "valid": false,
  "detail": "Validation failed with 3 error(s)",
  "data": {
    "conformanceLevel": "EN16931",
    "specificationIdentifier": "urn:cen.eu:en16931:2017"
  },
  "errors": {
    "xml": [
      "[BR-01] An invoice shall have a specification identifier (BT-24).",
      "[BR-CO-15] AccountingCurrencyCode must equal InvoiceCurrencyCode.",
      "[BR-S-08] An invoice line with standard-rated VAT shall have a VAT greater than 0."
    ],
    "friendly": [
      {
        "rule": "BR-01",
        "message": "The GuidelineSpecifiedDocumentContextParameter/ID element is missing." 
      },
      {
        "rule": "BR-CO-15",
        "message": "The tax currency code does not match the invoice currency code." 
      },
      {
        "rule": "BR-S-08",
        "line": 3,
        "message": "Standard-rate VAT category (S) must have a VAT rate greater than 0%." 
       }
    ]
  }
}

What the CII validation API checks

CII D16B XSD Schema

Validates the CII XML against the UN/CEFACT CrossIndustryInvoice D16B XSD schema — the schema referenced by EN 16931 and used inside every ZUGFeRD and Factur-X file. Catches structural errors in the deeply nested CII element hierarchy: missing required trade agreement elements, incorrect data types in monetary amounts, invalid date format codes, and namespace declaration errors in the rsm:, ram:, and udt: prefixes.

EN 16931 Schematron Business Rules

Validates all 200+ EN 16931 CII business rules. Covers arithmetic consistency (BR-CO-14: invoice VAT total must equal sum of VAT breakdown amounts), cross-field rules (BR-CO-15: tax currency must match invoice currency when tax is present), VAT category rules (BR-AE-05: reverse charge rate must be zero), and mandatory field rules (BR-06: seller name required, BR-07: seller address required).

Profile Detection and Scoped Rules

Reads the GuidelineSpecifiedDocumentContextParameter/ID element to detect the declared EN 16931 profile and applies the corresponding rule scope. A MINIMUM CII invoice is not required to contain IncludedSupplyChainTradeLineItem elements. A BASIC invoice must contain line items but not allowances and charges at line level. The EN 16931 profile activates the full rule set. The API validates the invoice against the profile it declares — not the one you assume it is.

Automatic XML Extraction from PDF

Accepts ZUGFeRD and Factur-X PDFs directly. The embedded CII XML attachment is extracted from the PDF/A-3 container before validation — no pre-processing required on your side. This lets you validate the CII data layer of a hybrid invoice independently of the PDF container, useful when checking that the structured data layer of a ZUGFeRD file is correct before distributing it to trading partners or importing it into ERP systems.

Response schema

Both valid and invalid documents return HTTP 200. The specificationIdentifier field in the response is read directly from the submitted XML — if your invoice declares the wrong profile identifier, the response tells you exactly what was found. Create/convert endpoints return HTTP 400 with the same errors structure on validation failure.

Field Type Description
Always present
validbooleanPrimary flag to branch on. true when the CII XML passes both XSD schema and all EN 16931 Schematron rules for its declared profile.
detailstringHuman-readable summary, e.g. "Your CII invoice is EN 16931 compliant." or "Validation failed with 2 error(s)".
data.conformanceLevelstringDetected EN 16931 profile, e.g. EN16931, EXTENDED, BASIC, MINIMUM.
data.specificationIdentifierstringFull specification identifier read from GuidelineSpecifiedDocumentContextParameter/ID, e.g. urn:cen.eu:en16931:2017 or urn:cen.eu:en16931:2017#conformant#urn:factur-x.eu:1p0:en16931.
Valid only
data.schemaValidbooleanCII D16B XSD schema check passed.
data.schematronValidbooleanAll EN 16931 Schematron business rules passed for the detected profile.
Invalid only
errors.xmlstring[]Raw Schematron messages with rule codes and XPath context, e.g. "[BR-01] An invoice shall have a specification identifier (BT-24)."
errors.friendlyobject[]Plain-language error objects for UI display. XPath context from the CII nested structure is translated to human-readable references.
friendly[].rulestringRule identifier, e.g. BR-01, BR-CO-14, BR-S-08.
friendly[].lineint?Invoice line item number derived from the IncludedSupplyChainTradeLineItem index, or null for header-level violations.
friendly[].messagestringHuman-readable error description that references the plain invoice concept — not the CII element path.

Integrate CII validation into your workflow

REST API

Call POST /v1/validate/cii from any language. Submit standalone CII XML or a ZUGFeRD/Factur-X PDF — the API handles both without any pre-processing. Returns structured JSON in under 2 seconds. Use the specificationIdentifier field to log which profile and version your trading partners are sending.

API docs

Zapier / Make / n8n

Add a CII validation step before your ERP import or Peppol transmission. On failure, route the friendly errors[].message values to a Slack notification or email — giving your team the plain-language violation description they need to contact the supplier or fix the generation pipeline, without decoding CII XPath expressions manually.

Automation integrations

CI/CD Pipeline

CII is the XML layer inside every ZUGFeRD and Factur-X invoice your pipeline generates. Validate the CII output on every build — before PDF/A-3 embedding. Catching a BR-CO-14 VAT arithmetic error or a missing BR-06 seller name at build time costs nothing. Catching it after a batch of non-compliant invoices reaches customers costs considerably more.

View cURL example

Complete CII Toolkit

Everything you need to create, convert, validate, and preview CII invoices — via REST API or online.

Build a validated CII D16B XML from structured data — ready for ERP import or PDF/A-3 embedding.

Validate CII XML against CII D16B schema and EN 16931 Schematron business rules.

Convert any PDF invoice into a standalone CII XML using AI extraction.

Render a CII XML as a human-readable PDF for review and approval.

Frequently Asked Questions

What is the difference between validating CII and validating ZUGFeRD?

The CII validation endpoint accepts standalone CII XML — the raw UN/CEFACT D16B document with no PDF wrapper. The ZUGFeRD validation endpoint accepts a PDF/A-3 container, extracts the embedded zugferd-invoice.xml, and additionally checks the PDF/A-3b conformance layer. If you have a standalone CII file from an ERP export, EDI pipeline, or CII extraction, use this endpoint. If you have a full ZUGFeRD or Factur-X PDF, use the respective validator or submit it here — the API extracts the embedded XML automatically.

Can I validate the CII XML extracted from a ZUGFeRD or Factur-X file?

Yes. If you upload a ZUGFeRD or Factur-X PDF to the CII validation endpoint, the embedded CII XML is extracted automatically and validated against the CII D16B XSD schema and EN 16931 Schematron. This is useful when you want to check only the XML data layer independently of the PDF/A-3b container — for example to verify that the structured data matches what your ERP will import, without running the full PDF conformance checks.

Which EN 16931 profiles does the CII validation API support?

The API validates all five EN 16931 CII profiles: MINIMUM, BASIC WL, BASIC, EN 16931, and EXTENDED. The profile is detected automatically from the GuidelineSpecifiedDocumentContextParameter/ID element in the submitted XML. The matching XSD schema constraints and Schematron rules are applied for the detected profile — a MINIMUM invoice is not required to contain line items, while an EN 16931 invoice is validated against the full set of 200+ business rules.

Ready to automate your invoices?

Start your 30-day free trial. No credit card required.

Get Started