ZUGFeRD Parser API: Parse Hybrid Invoices Without an LLM

How to parse ZUGFeRD and Factur-X e-invoices using the Parsurai API — deterministic XML extraction, no OCR, no LLM cost.

What Is ZUGFeRD?

ZUGFeRD (Zentraler User Guide des Forums elektronische Rechnung Deutschland) is a German e-invoice standard that embeds structured XML inside a regular PDF. The result is a hybrid PDF/A-3 file: human-readable on screen, machine-readable inside.

Factur-X is the French/European equivalent. Technically they are the same standard — Factur-X is ZUGFeRD 2.x with a French name.

Why ZUGFeRD Matters for Developers

Starting 2025, German B2B invoices must support structured e-invoice formats under the EU Directive 2014/55/EU. ZUGFeRD is the dominant format in the DACH market. If you are building accounting software, ERP integrations, or expense tools for European companies, you will encounter ZUGFeRD invoices.

The challenge: extracting data from ZUGFeRD invoices the wrong way — OCR + LLM — is slow, expensive, and introduces hallucination risk. The embedded XML already has every field you need.

How Parsurai Parses ZUGFeRD

Parsurai Pro and Business plans include a dedicated ZUGFeRD extraction endpoint. When you send a hybrid PDF, we:

  1. Detect the embedded ZUGFeRD-invoice.xml or factur-x.xml attachment
  2. Parse the XML directly against the EN 16931 schema
  3. Return structured JSON — no OCR, no LLM call

This means deterministic output. The same invoice always returns the same fields. No confidence variance, no hallucinations.

API Usage

curl -X POST https://api.parsurai.com/v1/extract/zugferd \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "file=@invoice.pdf"

Response:

{
  "invoice_number": "RE-2026-00042",
  "issue_date": "2026-04-15",
  "vendor": {
    "name": "Muster GmbH",
    "vat_id": "DE123456789"
  },
  "buyer": {
    "name": "Kunde AG"
  },
  "total_net": 1000.00,
  "vat_amount": 190.00,
  "total_gross": 1190.00,
  "currency": "EUR",
  "line_items": [
    { "description": "Beratungsleistung", "quantity": 10, "unit_price": 100.00, "total": 1000.00 }
  ],
  "extraction_method": "zugferd_xml",
  "zugferd_profile": "EN16931"
}

The extraction_method: "zugferd_xml" field confirms no LLM was used.

ZUGFeRD Profiles

ZUGFeRD 2.x has five profiles with increasing field richness:

| Profile | Fields | Use case | |---|---|---| | MINIMUM | 8 core fields | Cross-border B2G | | BASIC WL | Line items | Standard B2B | | BASIC | Extended line items | Most DACH invoices | | EN16931 | Full EN 16931 | Recommended | | EXTENDED | Custom fields | ERP-to-ERP |

Parsurai parses all five profiles and maps them to the same output schema.

Fallback: Non-ZUGFeRD PDFs

If you send a regular PDF (no embedded XML), the API automatically falls back to LLM-based extraction and returns "extraction_method": "llm". Your code does not need to branch — the output schema is the same.

Python Example

import httpx

with open("invoice.pdf", "rb") as f:
    response = httpx.post(
        "https://api.parsurai.com/v1/extract/zugferd",
        headers={"Authorization": "Bearer YOUR_API_KEY"},
        files={"file": f},
    )

data = response.json()
print(data["total_gross"], data["extraction_method"])

Getting Started

ZUGFeRD extraction is available on the Pro plan and above. Read the full API docs for authentication, error codes, and rate limits.