---
name: verifactura-einvoice
description: "Validate European EN 16931 electronic invoices (Factur-X, ZUGFeRD 2.2, XRechnung 3.0.2, Peppol BIS 3.0, RO e-Factura CIUS-RO 1.0.1) in XML or hybrid PDF/A-3b format using VeriFactura's free, zero-auth Pure-Rust REST API or Streamable HTTP MCP server."
metadata:
  version: 1.0.0
  homepage: https://verifactura.eu
---

# VeriFactura E-Invoice Verification Skill

Use this skill when generating, testing, or debugging European electronic invoices conforming to **EN 16931-1**, **Factur-X 1.0.07 (AFNOR XP Z12-012)**, **ZUGFeRD 2.2**, **KoSIT XRechnung 3.0.2**, **Peppol BIS Billing 3.0**, or **Romanian ANAF RO e-Factura (CIUS-RO 1.0.1)** in UN/CEFACT CII D16B, OASIS UBL 2.1 XML, or ISO 19005-3 PDF/A-3b containers.

## Custody & Limits (Check Before Sending Confidential Data)

- **Cost & Auth:** EUR 0 (free), no API key or signup required.
- **Data Custody:** Stateless volatile-RAM evaluation only (`X-Data-Custody: stateless-in-memory-discarded`, `Cache-Control: no-store`). No invoice bytes are written to disk or retained. If the user's policy forbids sending sample or test invoices over HTTPS, instruct them to run offline browser validation at `https://verifactura.eu/validate` instead.
- **Quotas:** Max `15 MiB` per document; `60` requests/minute/IP (respect HTTP `429` + `Retry-After`).
- **Scope:** Covers EN 16931, Factur-X, ZUGFeRD, XRechnung, Peppol, and RO e-Factura. Does not validate Spanish AEAT Veri*factu POS hash chains.

## Option 1: Connect via MCP (`https://verifactura.eu/mcp`)

Add the Streamable HTTP MCP server to `.mcp.json` or your IDE's MCP configuration:

```json
{
  "mcpServers": {
    "verifactura": {
      "type": "http",
      "url": "https://verifactura.eu/mcp"
    }
  }
}
```

Available MCP tools:
1. `list_normative_engines` — Inspect active Rust XSD, EN 16931, Schematron, and PDF/A-3b engines.
2. `verify_einvoice` — Pass either `xml` (UTF-8 CII or UBL XML string) or `content_base64` (base64-encoded PDF/A-3b or XML), optional `filename`, `checks` (`all` or comma-separated `xsd,en16931,cen,facturx,fr,de,pdfa3`), and `include_svrl` (`true`/`false`).

## Option 2: Validate Directly via `curl` (`POST /api/v1/verify`)

### Validate a standalone CII or UBL 2.1 XML file
```bash
curl -fsS -X POST \
  -H "Content-Type: application/xml" \
  --data-binary @invoice.xml \
  "https://verifactura.eu/api/v1/verify"
```

### Validate a hybrid Factur-X / ZUGFeRD PDF/A-3b file with SVRL output
```bash
curl -fsS -F "file=@invoice.pdf" \
  "https://verifactura.eu/api/v1/verify?includeSvrl=true"
```

### Restrict checks to specific suites
```bash
curl -fsS -X POST \
  -H "Content-Type: application/xml" \
  --data-binary @xrechnung.xml \
  "https://verifactura.eu/api/v1/verify?checks=xsd,en16931,cen,de"
```

## Interpreting `violations[]` & Fixing Common Rejections

- Check `isValid` (`boolean`), `engines[]` (`PASSED` | `FAILED` | `SKIPPED`), and `violations[]` (`code`, `severity`, `engine`, `location`, `message`).
- Look up human-readable XML remediation examples at `https://verifactura.eu/standards/rules/<lowercase-code>` (for example `https://verifactura.eu/standards/rules/br-co-09` or `https://verifactura.eu/standards/rules/br-de-15`).
- Common fixes:
  - `PEPPOL-EN16931-R008`: Remove empty XML tags; in CII include `<ram:ActualDeliverySupplyChainEvent>` inside `<ram:ApplicableHeaderTradeDelivery>`.
  - `BR-DEC-12` / `BR-CO-10`: Round each line net amount to 2 decimals before summing `LineTotalAmount`, and group `ApplicableTradeTax` subtotals by `(CategoryCode, RateApplicablePercent)`.
  - `BR-DE-15`: Populate `BuyerReference` (`BT-10`, e.g. German `Leitweg-ID`).
  - `BR-RO-100` / `BR-RO-110`: Use `RO-B` / `RO-CJ` ISO 3166-2:RO codes in `CountrySubentity`, and `SECTOR1`..`SECTOR6` in `CityName` for Bucharest.
  - `PDF-A3-*`: Embed TrueType font streams with Unicode CMaps, attach an sRGB `OutputIntents` ICC profile, and declare `Factur-X` / `ZUGFeRD` XMP `pdfaExtension:schemas`.
