fakturai blog

API & Agents

Create e-invoices: ZUGFeRD / Factur-X with fakturai (API & MCP)

Creating a German B2B e-invoice means producing structured EN 16931-compliant files — primarily ZUGFeRD 2.0.1+ / Factur-X (COMFORT or Extended profiles) or XRechnung — that are both human-readable and machine-processable. fakturai generates these files and validates them before delivery against the German tax authority’s official KoSIT validator.

Important: A plain PDF is not an e-invoice. Structured data (hybrid PDF+XML or pure XML) has been mandatory for receipt since 1 Jan 2025 and is phasing in for issuance from 2027/2028.

Practical steps: create compliant e-invoices with fakturai

  1. Validate existing invoices first (recommended) — Upload current outgoing or incoming PDFs to the free validator to confirm your master data and processes are already compatible.
  2. Prepare the data (Seller, Buyer, line items) — Collect required fields: invoice number, dates, seller and buyer details (incl. VAT ID), individual line items with description, quantity, unit price (net), VAT rate, and totals.
  3. Generate via API or MCP — POST a structured payload (JSON) to the fakturai API or use the MCP server from AI agents (Claude, Cursor, n8n etc.). Example payload (illustrative; production uses the full model):
    {
      "invoice_number": "RE-2026-042",
      "invoice_date": "2026-06-11",
      "due_date": "2026-06-25",
      "seller": { "name": "Muster GmbH", "street": "Musterstr. 1", "zip": "12345", "city": "Berlin", "country": "DE", "vat_id": "DE123456789" },
      "buyer": { "name": "Kunde AG", "street": "Kundenweg 2", "zip": "54321", "city": "München", "country": "DE", "vat_id": "DE987654321" },
      "lines": [
        { "description": "Consulting and implementation", "quantity": 5, "unit_price": "1200.00", "vat_rate": 19 },
        { "description": "Travel flat", "quantity": 1, "unit_price": "250.00", "vat_rate": 19 }
      ],
      "notes": "Net payment within 14 days."
    }
  4. Receive the KoSIT-accepted file — fakturai returns the ZUGFeRD/Factur-X file (PDF/A-3b + embedded CII-XML) only when all validation layers pass. Pure XML / XRechnung variants are also available.
  5. Embed in automation or agent — Call the endpoint from n8n/Make/Zapier, backends, or directly from AI tools via MCP. Store the file GoBD-compliant (PDF/A-3b + XML).

What fakturai checks (the KoSIT acceptance gate)

fakturai generates ZUGFeRD / Factur-X invoices and runs them through multiple validators before delivery:

Only invoices that pass all checks (including the government’s own engine) are returned. This is the core quality promise: format compliance that the reference validator accepts.

What fakturai does not replace (and does not promise)

The substantive and tax correctness of the invoice (amounts, correct VAT rates, service description, taxability, reverse-charge, Kleinunternehmerregelung etc.). This responsibility lies entirely with the invoice issuer.

Accounting, dunning or full ERP functions. Tax or legal advice. Setting up and documenting a GoBD-compliant archival process beyond the file format (procedural documentation, index, immutability etc.). Correct assignment and timely reporting in the VAT return.

We check format, structure, semantic EN 16931 conformity and PDF/A archivability against the official reference validators (KoSIT as the authoritative instance). The correctness of invoice content, compliance with all VAT mandatory details, tax treatment and GoBD archiving in the operational context remain your responsibility.

No hard guarantees or financial promises — see GHOA-1671. “KoSIT-checked” means: the format was classified ACCEPTABLE by the tax authority’s reference engine. It is not a free pass for the facts of the invoice.

Next steps for your company

Test now for free whether your current invoices are already compliant:

Free e-invoice validator (ZUGFeRD / Factur-X / XRechnung)

For automatic, KoSIT-checked generation of e-invoices:

Request API key / Signup · API documentation for developers, n8n, agents · MCP server for AI tools (Claude, Cursor etc.)

Further helpful articles: German e-invoicing mandate 2025/2027 · ZUGFeRD, Factur-X, XRechnung and EN 16931 · Technical validation — KoSIT, EN 16931 and sum validation · Why a PDF is not an e-invoice

Free validator · Create API key · API docs