XRechnung & ZUGFeRD / Factur-X Parser – E-Invoice to JSON avatar

XRechnung & ZUGFeRD / Factur-X Parser – E-Invoice to JSON

Pricing

Pay per usage

Go to Apify Store
XRechnung & ZUGFeRD / Factur-X Parser – E-Invoice to JSON

XRechnung & ZUGFeRD / Factur-X Parser – E-Invoice to JSON

Convert German and EU e-invoices to clean JSON: XRechnung (UBL & CII), ZUGFeRD and Factur-X PDFs (embedded XML extracted automatically). Seller, buyer, Leitweg-ID, IBAN, totals, VAT breakdown, line items and plausibility checks. Pay only per parsed invoice.

Pricing

Pay per usage

Rating

0.0

(0)

Developer

Fast Data

Fast Data

Maintained by Community

Actor stats

0

Bookmarked

1

Total users

0

Monthly active users

15 days ago

Last modified

Features

Limited permissions

Share

XRechnung & ZUGFeRD / Factur-X E-Invoice Parser – XML/PDF to JSON

Turn German and EU e-invoices into clean, flat JSON in seconds. Give the actor links to XRechnung XML files (UBL or CII) or ZUGFeRD / Factur-X PDFs – it extracts the embedded XML from the PDF automatically, detects the format and profile, and returns one row per invoice with seller, buyer, Leitweg-ID, IBAN/BIC, payment terms, preceding invoice reference, totals, VAT breakdown, line items and structured plausibility findings (rule ID, severity, field, message).

Price: $0.003 per successfully parsed invoice ($3 per 1,000). Files that fail to download or parse are free.

Who is it for?

  • Accounts payable & bookkeeping teams that receive XRechnung / ZUGFeRD invoices and want the data in a spreadsheet, ERP, DATEV pipeline or database
  • Developers & automation builders (n8n, Make, Zapier, AI agents) who need one stable JSON schema instead of two XML syntaxes and dozens of profiles
  • SaaS tools, tax advisors and auditors who want to bulk-read invoice archives and spot calculation errors
  • AI / LLM workflows – the output is flat and self-describing, ideal for agents via MCP

What it does

FeatureDetails
Supported formatsXRechnung UBL (Invoice + CreditNote), XRechnung CII, ZUGFeRD 2.x / Factur-X (MINIMUM, BASIC WL, BASIC, EN16931, EXTENDED, XRECHNUNG), generic EN 16931 / Peppol UBL
PDF supportExtracts factur-x.xml, zugferd-invoice.xml or xrechnung.xml from hybrid PDFs (pypdf, BSD licence)
Unified schemaSame field names for UBL and CII – no XPath needed
Plausibility checksSum of lines vs. line total (BR-CO-10), line total ± allowances/charges = tax basis (BR-CO-13), tax basis + VAT = grand total (BR-CO-15), grand total − prepaid = amount due (BR-CO-16), VAT breakdown sums and rates, required EN 16931 fields, XRechnung rules BR-DE-1/2/3/4/5/6/7/8/9/14/15/23-a, credit note / corrected invoice without preceding invoice reference
Structured findingsvalidationFindings with rule, severity (error / warning), field (BT/BG number) and message, plus errorCount / warningCount
Preceding invoiceBT-25 / BT-26 from UBL BillingReference and CII InvoiceReferencedDocument as precedingInvoice
Safe XML parsingdefusedxml – protects against XXE and entity-expansion attacks
Fast & cheap3 invoices in ~3 seconds on 256 MB, no browser, no proxy

Important: This is a fast parser with plausibility checks, not a certified validator. It does not run the official KoSIT validator / EN 16931 Schematron rules. The rule IDs in validationFindings point to the corresponding EN 16931 / XRechnung rule, but only a subset of those rules is checked, and severity is this actor's own classification. An invoice with errorCount: 0 can still be rejected by the official validator. For legally binding conformance checks use the KoSIT validator.

Why this actor?

  • One schema for everything – XRechnung UBL, XRechnung CII and ZUGFeRD/Factur-X come out identical.
  • Low, predictable price – $0.003 per document, and failed files are free.
  • Ready for automation – flat numbers (not strings), ISO dates, nested seller / buyer objects, validationFindings with rule IDs and errorCount for routing (e.g. send invoices with errors back to the supplier).

Input

FieldTypeDefaultDescription
fileUrlsarray of URLs3 public sample invoicesDirect links to XML or PDF e-invoices (public or presigned URLs, e.g. S3, Google Cloud Storage, Apify key-value store records)
includeLineItemsbooleantrueAdds the lineItems array
includeRawXmlbooleanfalseAdds the complete invoice XML as rawXml
{
"fileUrls": [
"https://raw.githubusercontent.com/itplr-kosit/xrechnung-testsuite/master/src/test/business-cases/standard/01.01a-INVOICE_ubl.xml",
"https://raw.githubusercontent.com/itplr-kosit/xrechnung-testsuite/master/src/test/business-cases/standard/02.01a-INVOICE_uncefact.xml",
"https://raw.githubusercontent.com/ZUGFeRD/mustangproject/master/library/src/test/resources/EN16931_Einfach.pdf"
],
"includeLineItems": true,
"includeRawXml": false
}

The default samples come from the official XRechnung test suite (KoSIT) and the Mustangproject ZUGFeRD library.

Output

Real result for the ZUGFeRD sample PDF (EN16931_Einfach.pdf, shortened):

{
"fileUrl": "https://raw.githubusercontent.com/ZUGFeRD/mustangproject/master/library/src/test/resources/EN16931_Einfach.pdf",
"status": "ok",
"format": "ZUGFeRD/Factur-X",
"syntax": "CII",
"profile": "EN16931",
"invoiceNumber": "471102",
"issueDate": "2024-11-15",
"typeCode": "380",
"typeName": "Commercial invoice",
"currency": "EUR",
"seller": {
"name": "Lieferant GmbH",
"vatId": "DE123456789",
"taxNumber": "201/113/40209",
"street": "Lieferantenstraße 20",
"postalCode": "80333",
"city": "München",
"country": "DE"
},
"buyer": { "name": "Kunden AG Mitte", "id": "GE2020211", "city": "Frankfurt", "country": "DE" },
"paymentTerms": "Zahlbar innerhalb 30 Tagen netto bis 15.12.2024, 3% Skonto innerhalb 10 Tagen bis 25.11.2024",
"lineTotal": 473.0,
"taxBasis": 473.0,
"taxTotal": 56.87,
"grandTotal": 529.87,
"prepaid": 0.0,
"payableAmount": 529.87,
"vatBreakdown": [
{ "category": "S", "rate": 7.0, "taxable": 275.0, "tax": 19.25 },
{ "category": "S", "rate": 19.0, "taxable": 198.0, "tax": 37.62 }
],
"lineItems": [
{ "id": "1", "name": "Trennblätter A4", "sellerItemId": "TB100A4", "quantity": 20.0, "unit": "H87", "netPrice": 9.9, "lineTotal": 198.0, "vatCategory": "S", "vatRate": 19.0 },
{ "id": "2", "name": "Joghurt Banane", "sellerItemId": "ARNR2", "quantity": 50.0, "unit": "H87", "netPrice": 5.5, "lineTotal": 275.0, "vatCategory": "S", "vatRate": 7.0 }
],
"sourceType": "PDF",
"pdfAttachmentName": "factur-x.xml",
"lineItemCount": 2,
"precedingInvoice": null,
"validationWarnings": [],
"validationWarningCount": 0,
"validationFindings": [],
"errorCount": 0,
"warningCount": 0
}

The XRechnung samples from the same run: XRechnung-UBL invoice 123456XX, Leitweg-ID 04011000-12345-03, IBAN DE79000000001234567890, grand total 336.90 EUR; XRechnung-CII invoice 1234567, Leitweg-ID 90000000-03083-72, grand total 12,829.69 EUR – all with 0 warnings.

Validation findings

Every parsed invoice gets a list of findings. Each finding has:

KeyMeaning
ruleRule ID: BR-… / BR-CO-… (EN 16931), BR-DE-… (XRechnung, KoSIT Schematron), or FD-… for an own plausibility hint without an official rule number
severityerror = a required field is missing or an amount does not add up; warning = plausibility hint
fieldBusiness term or group of EN 16931, e.g. BT-115, BG-6
messageHuman-readable text (identical to the entry in validationWarnings)

Example: the KoSIT test invoice 01.01a-INVOICE_ubl.xml, deliberately modified (telephone, buyer post code and IBAN removed, amount due changed to 363.90):

{
"invoiceNumber": "FEHLER-001",
"paymentMeansCode": "58",
"grandTotal": 336.9,
"payableAmount": 363.9,
"validationFindings": [
{ "rule": "BR-CO-16", "severity": "error", "field": "BT-115", "message": "Grand total - prepaid + rounding = 336.9, but amount due is 363.9 (BR-CO-16)" },
{ "rule": "BR-DE-6", "severity": "error", "field": "BT-42", "message": "XRechnung: missing seller contact telephone number (BT-42) (BR-DE-6)" },
{ "rule": "BR-DE-9", "severity": "error", "field": "BT-53", "message": "XRechnung: missing buyer post code (BT-53) (BR-DE-9)" },
{ "rule": "BR-DE-23-a", "severity": "error", "field": "BG-17", "message": "XRechnung: payment means 58 (credit transfer) but no payment account / IBAN (BT-84) (BR-DE-23-a)" }
],
"errorCount": 4,
"warningCount": 0
}

A credit note (type code 381) without BillingReference returns {"rule": "FD-PRECEDING", "severity": "warning", "field": "BT-25", "message": "Credit note (381) without preceding invoice reference (BT-25)"}. With a reference, the actor returns "precedingInvoice": {"number": "123456XX", "date": "2016-04-04"}.

Checked rules

RuleSeverityCheck
BR-02, BR-03, BR-04, BR-05, BR-13, BR-14, BR-15errorInvoice number, issue date, type code, currency, total without VAT, total with VAT, amount due present
BR-06, BR-07, BR-09, BR-11errorSeller / buyer name and country code present
BR-CO-26error (warning if a seller identifier BT-29 exists)Seller VAT ID, tax number or legal registration ID present
BR-CO-18errorVAT breakdown present (not checked for MINIMUM)
BR-CO-10, BR-CO-13, BR-CO-14, BR-CO-15, BR-CO-16errorTotals add up (tolerance 0.01)
FD-VAT-RATEwarningTaxable amount × VAT rate matches the VAT amount (tolerance 0.02)
FD-PRECEDINGwarningType code 381 or 384 without preceding invoice reference (BT-25)
BR-DE-1, BR-DE-15, BR-DE-7error (XRechnung only)Payment means, buyer reference / Leitweg-ID, seller contact e-mail
BR-DE-2, BR-DE-5, BR-DE-6error (XRechnung only)Seller contact group, contact point, telephone number
BR-DE-3, BR-DE-4, BR-DE-8, BR-DE-9error (XRechnung only)Seller / buyer city and post code
BR-DE-14error (XRechnung only)VAT rate in every VAT breakdown entry
BR-DE-23-aerror (XRechnung only)Payment means 30 / 58 (credit transfer) with a payment account (BT-84)

For ZUGFeRD / Factur-X MINIMUM and BASIC WL, which are not complete EN 16931 invoices by design, missing EN 16931 fields are reported as warning. validationWarnings (list of strings) and validationWarningCount are kept unchanged for existing integrations; new checks are appended at the end of the list.

All output fields

fileUrl, status (ok / error), error, format (XRechnung-UBL, XRechnung-CII, ZUGFeRD/Factur-X, UBL (EN 16931 / Peppol)), syntax, profile, specificationId, documentType, invoiceNumber, issueDate, dueDate, typeCode, typeName, currency, buyerReference (Leitweg-ID), orderReference, contractReference, precedingInvoice {number (BT-25), date (BT-26)}, precedingInvoices (only when more than one), notes, seller / buyer {name, tradingName, id, vatId, taxNumber, legalRegistrationId, street, postalCode, city, country, email, phone, contactName, contactDepartment, electronicAddress}, paymentTerms, paymentMeansCode, iban, bic, accountName, lineTotal, allowanceTotal, chargeTotal, taxBasis, taxTotal, grandTotal, prepaid, roundingAmount, payableAmount, vatBreakdown, lineItems, lineItemCount, sourceType, pdfAttachmentName, validationWarnings, validationWarningCount, validationFindings [{rule, severity, field, message}], errorCount, warningCount, rawXml (optional).

Empty fields are omitted inside seller, buyer and line items.

Pricing

Pay per event: $0.003 per successfully parsed invoice. Download errors, PDFs without XML, and non-invoice files cost nothing (only the tiny platform start fee). 1,000 invoices ≈ $3.

Use via API, n8n, Make or AI agents

API (sync, returns the dataset items):

curl -X POST "https://api.apify.com/v2/acts/fast_data_asap~xrechnung-zugferd-einvoice-parser/run-sync-get-dataset-items?token=YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"fileUrls": ["https://example.com/invoice.pdf"]}'

Python:

from apify_client import ApifyClient
client = ApifyClient("YOUR_TOKEN")
run = client.actor("fast_data_asap/xrechnung-zugferd-einvoice-parser").call(run_input={"fileUrls": ["https://example.com/rechnung.xml"]})
for inv in client.dataset(run["defaultDatasetId"]).iterate_items():
print(inv["invoiceNumber"], inv.get("grandTotal"), inv.get("validationWarnings"))

n8n / Make / Zapier: use the Apify node, action "Run Actor and get dataset items", actor fast_data_asap/xrechnung-zugferd-einvoice-parser.

MCP (Claude, Cursor, other AI agents): https://mcp.apify.com?tools=fast_data_asap/xrechnung-zugferd-einvoice-parser

Limitations

  • Not a certified KoSIT / EN 16931 validator – plausibility checks only. Rules that need code lists, regular expressions or cross-checks between many elements (e.g. IBAN check digits, BR-DE-18 Skonto syntax) are not checked.
  • ZUGFeRD 1.0 (CrossIndustryDocument) is not supported; ZUGFeRD 2.x, Factur-X and XRechnung are.
  • Files must be reachable via URL (no login). Encrypted PDFs may fail.

Kurzfassung auf Deutsch

XRechnung- und ZUGFeRD-Rechnungen automatisch auslesen. Seit dem 1. Januar 2025 müssen alle Unternehmen in Deutschland E-Rechnungen im B2B-Bereich empfangen können (Wachstumschancengesetz); die Pflicht zum Versand folgt schrittweise bis 2028. Dieser Actor liest XRechnung (UBL und CII) sowie ZUGFeRD-/Factur-X-PDFs (eingebettetes XML wird automatisch extrahiert) und liefert sauberes JSON: Rechnungsnummer, Datum, Fälligkeit, Verkäufer und Käufer inkl. USt-IdNr. und Steuernummer, Leitweg-ID, IBAN/BIC, Zahlungsbedingungen, Summen, USt-Aufschlüsselung und Rechnungspositionen – plus Plausibilitätsprüfungen (Summen, Steuerbeträge, Pflichtfelder, ausgewählte XRechnung-Regeln BR-DE) als strukturierte Liste validationFindings mit Regel-ID, Schweregrad (error / warning) und Feld, sowie die Vorgängerrechnung (BT-25/BT-26) bei Gutschriften und Rechnungskorrekturen. Kein zertifizierter KoSIT-Validator – nur ein Teil der Regeln wird geprüft. Preis: 0,003 $ pro erfolgreich gelesener Rechnung, fehlerhafte Dateien sind kostenlos.

Changelog

  • 2026-11-10 – New fields validationFindings (rule, severity, field, message), errorCount, warningCount, precedingInvoice (BT-25 / BT-26) and seller.contactDepartment (CII). Additional XRechnung checks BR-DE-2, BR-DE-3, BR-DE-4, BR-DE-5, BR-DE-6, BR-DE-8, BR-DE-9, BR-DE-14, BR-DE-23-a, and hint FD-PRECEDING for credit notes (381) and corrected invoices (384) without a preceding invoice reference. New dataset view "Validation findings". validationWarnings keeps its previous texts and order; new checks are appended.
  • 2026-11-07 – First release.