E-invoice validation API
Validate XRechnung, ZUGFeRD / Factur-X and Peppol BIS 3.0 invoices from your code or CI pipeline with the same official rules as our online validator. One POST, a JSON answer, no API key.
Request
POST https://invoiceer.io/api/validate as multipart/form-data with the invoice in the field file. It accepts UBL or CII XML, or a ZUGFeRD / Factur-X PDF with embedded XML (up to 10 MB).
curl -F "file=@invoice.xml" https://invoiceer.io/api/validate
Need a test file? Download our valid sample e-invoices.
import httpx
with open("invoice.xml", "rb") as f:
r = httpx.post("https://invoiceer.io/api/validate", files={"file": f}, timeout=60)
result = r.json()
if not result["valid"]:
for e in result["errors"]:
print(e["code"], e["text"])
Response
A valid invoice:
{"valid": true, "format": "Peppol BIS Billing 3.0 (UBL Invoice)", "source": "xml", "errors": [], "warnings": []}
An invalid one (amount due doesn't match the totals):
{
"valid": false,
"format": "Peppol BIS Billing 3.0 (UBL Invoice)",
"source": "xml",
"errors": [
{
"level": "error",
"code": "BR-CO-16",
"text": "[BR-CO-16]-Amount due for payment (BT-115) = Invoice total amount with VAT (BT-112) -Paid amount (BT-113) +Rounding amount (BT-114).",
"location": "/Invoice[1]/LegalMonetaryTotal[1]",
"fix": {"field": "PayableAmount", "bt": "BT-115", "expected": "428.30", "actual": "1.00"}
}
],
"warnings": []
}
| Field | Meaning |
|---|---|
valid | true if no errors (warnings allowed). |
format | Detected format, e.g. XRechnung (UBL or CII), Peppol BIS 3.0, EN 16931 CII / ZUGFeRD. null if not recognised. |
source | xml or pdf (XML extracted from a ZUGFeRD / Factur-X PDF). |
fix | For the arithmetic rules BR-CO-10, BR-CO-13, BR-CO-14, BR-CO-15, BR-CO-16, BR-CO-17, BR-S-08 and BR-S-09: the field to change and the correct value, computed from the invoice itself. |
errors, warnings | Each with level, rule code (e.g. BR-CO-16, BR-DE-15, PEPPOL-EN16931-R001, or an XML schema error), text and location (XPath or line and column). |
Every business rule has a plain-language explanation at https://invoiceer.io/rules/<code>, for example /rules/BR-CO-16. Link your users there.
Errors in the request itself (empty file, not XML, a PDF without embedded XML, XML with a DOCTYPE) return HTTP 400 with {"error": "..."}.
Create an e-invoice
POST https://invoiceer.io/api/einvoice with a JSON body returns a valid XRechnung 3.0 (UBL or CII), ZUGFeRD / Factur-X PDF (EN 16931) or Peppol BIS 3.0 invoice. Every file is checked with the official validator before it is returned. If it fails, you get HTTP 422 with the rule errors instead of a file. Add ?raw=1 to get the file itself instead of JSON.
curl -s https://invoiceer.io/api/einvoice?raw=1 -H "Content-Type: application/json" -o invoice.xml -d '{
"format": "xrechnung-ubl", "number": "RE-2026-17", "buyer_reference": "991-33333TEST-33", "iban": "DE89370400440532013000",
"seller": {"name": "Muster GmbH", "street": "Hauptstr. 1", "zip": "10115", "city": "Berlin", "country": "DE",
"vat": "DE123456789", "email": "rechnung@muster.de", "contact": "Max Muster", "phone": "+49 30 123456"},
"buyer": {"name": "Kunde AG", "street": "Weg 2", "zip": "80331", "city": "München", "country": "DE", "email": "ap@kunde.de"},
"lines": [{"name": "Beratung", "qty": 10, "unit": "HUR", "price": 100, "vat_category": "S", "vat_rate": 19}]
}'
- format:
xrechnung-ubl(default),xrechnung-cii,zugferd(PDF) orpeppol. - seller / buyer: name, street, zip, city, country (2 letters), vat, legal_id, email, contact, phone, peppol_id (e.g. 0208:0123456749).
- lines: name, qty, unit (C62, HUR, DAY, MON, KGM, MTR, LS), price (net unit price), vat_category (S, Z, E, AE, K, O, G), vat_rate.
- Optional: issue_date, due_date (YYYY-MM-DD), currency, buyer_reference (Leitweg-ID), order_reference, payment_terms, iban, bic, payment_reference, note, credit_note (true/false), preceding_invoice, period_start, period_end.
- VAT exemptions: exempt_reason (BT-120 text) and exempt_reason_code (BT-121, a code from the CEF VATEX list). Example: travel agency margin scheme (§ 25 UStG): lines with
"vat_category": "E", "vat_rate": 0plus"exempt_reason_code": "VATEX-EU-D"; the text defaults to "Sonderregelung für Reisebüros" (§ 14a Abs. 6 UStG). Codes not on the list, including VATEX-EU-306, are rejected because they fail BR-CL-22. Margin scheme guide. - XRechnung needs a seller contact (contact, phone, email), a buyer email or Peppol ID, a buyer_reference and payment details. Peppol needs peppol_id for seller and buyer.
The JSON response has valid, format, filename, warnings and either xml (text) or pdf_base64.
Rules used
- XRechnung: the official KoSIT validator with the XRechnung configuration (UBL and CII).
- Peppol BIS Billing 3.0: OpenPeppol schematron, including EN 16931.
- EN 16931 (CEN) for UBL and CII, which covers ZUGFeRD / Factur-X EN 16931 profiles.
- Current versions: KoSIT validator 1.6.3 · XRechnung 3.0.2 (config 2026-08-31) · EN 16931 rules 1.3.16 · Peppol BIS 3.0.21. Every API and MCP response includes them in the
rulesetsfield.
MCP server for AI assistants
The same checks are available as a free remote Model Context Protocol server, so Claude, Cursor and other MCP clients can validate e-invoices for you. No sign-up, no API key. It's listed in the official MCP Registry as io.invoiceer/einvoicing.
Server URL (Streamable HTTP): https://invoiceer.io/mcp
- Claude (claude.ai or the desktop app): Settings → Connectors → Add custom connector → paste the URL.
- Claude Code:
claude mcp add --transport http invoiceer https://invoiceer.io/mcp
- Cursor and other clients with a JSON config:
{ "mcpServers": { "invoiceer": { "url": "https://invoiceer.io/mcp" } } }
| Tool | What it does |
|---|---|
validate_einvoice | Validates XRechnung (UBL/CII), ZUGFeRD / Factur-X PDFs and Peppol BIS 3.0 with the official rules. Pass the XML as text, or a file as base64. Returns every error with its rule code and, for common calculation errors, the corrected value. |
peppol_lookup | Checks whether a company can receive Peppol invoices, by Peppol ID, VAT number or Belgian enterprise number. |
create_einvoice | Creates a valid XRechnung (UBL or CII), ZUGFeRD / Factur-X PDF or Peppol BIS 3.0 invoice from structured data. Checked with the official validator before it is returned; otherwise you get the rule errors. |
check_leitweg_id | Checks a German Leitweg-ID's structure and check digits. |
read_invoice_pdf | Reads an ordinary PDF invoice (seller, buyer, number, dates, IBAN, verified lines) and returns it as create_einvoice input, plus a list of missing fields. No AI guessing: unreadable fields are left out. |
explain_rule | Explains a rule code such as BR-DE-15 or BR-CO-10, with an English translation for German-only rules. |
Validation and lookups share the API's fair-use limit (40 per hour per IP address). Rule explanations are not limited. Try asking: "Validate this XRechnung and tell me how to fix the errors."
Use it in CI (GitHub Actions, no key)
Fail the build when an e-invoice your code generates breaks a rule. Every error becomes an annotation with a link to the rule explanation. No secret needed, because the API needs no key:
- name: Validate e-invoices
run: |
status=0
for f in invoices/*.xml; do
r=$(curl -s -F "file=@$f" https://invoiceer.io/api/validate)
if [ "$(echo "$r" | jq -r .valid)" != "true" ]; then
status=1
echo "$r" | jq -r --arg f "$f" '.errors[] | "::error file=\($f)::[\(.code)] \(.text) — https://invoiceer.io/rules/\(.code)"'
fi
done
exit $status
OpenAPI: the machine-readable description is at /openapi.json (import it into Postman, Insomnia or an AI agent). n8n / Make / Zapier: use the HTTP request module with POST https://invoiceer.io/api/validate (multipart, field file) or POST https://invoiceer.io/api/einvoice (JSON).
For platforms (Stripe Connect, marketplaces)
If your sellers are businesses that must send e-invoices, you can produce them per seller with the same endpoints: POST /api/einvoice creates an XRechnung, ZUGFeRD / Factur-X or Peppol BIS invoice from JSON with the seller's details and returns it only if it passes the official rules; POST /api/validate checks files your sellers bring; the MCP tool peppol_lookup and the bulk Peppol lookup find a buyer's Peppol ID from a VAT or company number. Nothing is stored. The fair-use limit below is per IP address, so a platform sending many invoices should email [email protected] about volume first.
Limits and privacy
- Free, no sign-up. Fair use: 40 checks per hour per IP address. Above that you get HTTP 429.
- Files are processed in memory and discarded immediately. We don't store invoices or results.
- Provided as is, without guarantees. For production volumes or an SLA, email [email protected].
Creating e-invoices from Stripe
If you bill with Stripe, you don't need to generate and validate e-invoices yourself: Invoiceer for Stripe turns every Stripe invoice into a validated XRechnung, ZUGFeRD or Peppol invoice automatically.