# XRechnung CII Validator API (EN 16931)
> Validate XRechnung CII documents against the full EN 16931 business-rule set and return exact rule IDs with JSON paths.

- **Canonical URL:** https://stanzaapi.com/tools/factur-x-validator/standards/xrechnung-cii
- **Governing Standard:** XRechnung (CII) / EN 16931-1 (International Standards Organization)
- **Latency:** <5ms
- **Privacy:** In-memory execution only (zero data stored or logged)

## Technical Overview & Governing Rules
XRechnung is the German public-sector e-invoicing standard; this engine accepts the UN/CEFACT CII syntax variant used by Factur-X and ZUGFeRD hybrid invoices.

The XRechnung guideline identifier is detected from the specification identifier (BT-24) and validated with the full EN 16931 BR-* rule set.

Every violation carries the exact rule ID, the failing path, the severity, and a description so ERP and AP systems can route documents deterministically.

## Specification Matrix
| CII node | Field | Rule |
| --- | --- | --- |
| GuidelineSpecifiedDocumentContextParameter/ID | Specification identifier (BT-24) | XRechnung guideline detection |
| ExchangedDocument/ID | Invoice number (BT-1) | BR-02 |
| ApplicableHeaderTradeSettlement/ApplicableTradeTax | VAT breakdown (BG-23) | BR-CO-17 / BR-S-* |
| SpecifiedTradeSettlementHeaderMonetarySummation | Document totals (BG-22) | BR-CO-10 / 11 / 12 / 13 |

## Standard JSON Response Model
```json
{
  "valid": true,
  "syntax": "CII",
  "profile": "XRECHNUNG",
  "profileId": "urn:cen.eu:en16931:2017#compliant#urn:xoev-de:kosit:standard:xrechnung_3.0",
  "summary": {
    "status": "COMPLIANT",
    "fatalCount": 0,
    "warningCount": 0
  },
  "violations": []
}
```

## Frequently Asked Questions & Edge Cases
### Q: Which mandates does this API cover?
**A:** It supports the German B2B e-invoicing mandate (receiving since January 2025, issuing phased through 2027-2028), the French B2B e-invoicing and e-reporting mandate effective for large companies in September 2026, and XRechnung requirements for German public-sector invoicing.

### Q: What happens when an invoice fails validation?
**A:** The API returns HTTP 200 with valid: false, a NON_COMPLIANT summary, and an array of violations carrying the exact rule ID, the failing path, the severity, and a description.
