# E-Invoice Parser · XRechnung, ZUGFeRD, Factur-X, UBL (`siccscha/e-invoice-parser`) Actor

Parse EU e-invoices (XRechnung, ZUGFeRD/Factur-X PDFs, EN 16931 UBL & CII, Peppol BIS) into clean JSON — parties, line items, totals, VAT, IBAN — plus EN 16931 validation findings. Deterministic: no OCR, no LLM, no guessed numbers. Only successfully parsed invoices are charged.

- **URL**: https://apify.com/siccscha/e-invoice-parser.md
- **Developed by:** [Chris S](https://apify.com/siccscha) (community)
- **Categories:** Developer tools, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$50.00 / 1,000 invoice parseds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## E-Invoice Parser — XRechnung, ZUGFeRD, Factur-X & UBL to clean JSON

Turn EU e-invoices into **clean, structured JSON**: seller and buyer (with VAT IDs and addresses), invoice number and dates, line items, VAT breakdown, totals, IBAN and payment terms. Feed it XML (**XRechnung**, **EN 16931 UBL or CII**, **Peppol BIS**) or hybrid PDFs (**ZUGFeRD / Factur-X** — the embedded XML is extracted automatically), get back data your accounting pipeline, RPA flow, or AI agent can use directly.

E-invoicing is now mandatory across Europe — Germany (receiving since 2025, issuing 2027/28), France (from Sept 2026), Belgium (since Jan 2026), Italy, Poland, and more. Every business and every automation pipeline suddenly receives XML invoices that generic PDF tools and LLMs handle badly: **this parser is deterministic** — no hallucinated amounts, no OCR guessing. It reads the structured data the law requires to be there.

### What you get per invoice

```json
{
    "fileName": "invoice-4711.pdf",
    "fileType": "pdf",
    "parsed": true,
    "format": "ZUGFeRD/Factur-X (EN16931)",
    "invoice": {
        "number": "471102",
        "issueDate": "2024-11-15",
        "typeLabel": "Invoice",
        "currency": "EUR",
        "seller": { "name": "Lieferant GmbH", "vatId": "DE123456789", "city": "Berlin", "country": "DE" },
        "buyer": { "name": "Kunde AG" },
        "payment": { "iban": "DE02120300000000202051", "terms": "30 days net", "dueDate": "2024-12-15" },
        "lineCount": 4,
        "lines": [{ "name": "Widget A", "quantity": 10, "unitPrice": 12.5, "netAmount": 125.0, "vatRate": 19 }],
        "vatBreakdown": [{ "category": "S", "rate": 19, "taxableAmount": 124.08, "taxAmount": 23.57 }],
        "totals": { "netTotal": 124.08, "vatTotal": 23.57, "grossTotal": 147.65, "payable": 147.65 }
    },
    "findings": [],
    "errorCount": 0,
    "warningCount": 0
}
```

Files that are **not** e-invoices (e.g. a plain PDF without embedded XML) are reported with a clear explanation — **and not charged**.

### Supported formats

| Format | Detection |
|---|---|
| XRechnung (UBL & CII, all versions) | via CustomizationID, version reported |
| ZUGFeRD 1.0 / 2.x & Factur-X (hybrid PDF) | embedded XML extracted from PDF/A-3, profile reported (MINIMUM…EXTENDED) |
| EN 16931 UBL / CII XML | core European norm invoices |
| Peppol BIS Billing 3.0 | UBL profile |
| Credit notes, corrections | type codes reported (380, 381, 384, …) |

### Validation included

Beyond parsing, each invoice is checked against EN 16931 calculation rules and German XRechnung business rules (BR-CO / BR-DE): total consistency, VAT-breakdown arithmetic, required fields like Leitweg-ID (buyer reference), IBAN presence for credit-transfer invoices, and more. Findings come with rule IDs and severity so you can gate your workflow on `errorCount === 0`. (Rule explanations are currently written in German — rule IDs are the international EN 16931 codes.)

### E-invoicing mandates: why pipelines need this now

| Country | Mandate |
|---|---|
| Germany | receiving mandatory since Jan 2025, issuing 2027/28 (XRechnung, ZUGFeRD) |
| France | from Sept 2026 (Factur-X) |
| Belgium | since Jan 2026 (Peppol BIS) |
| Italy, Poland, … | national mandates live or scheduled |

Every accounts-payable inbox in the EU is filling up with structured XML invoices. Generic PDF
tools show them as gibberish and LLMs guess at them — this parser converts XRechnung to JSON,
Factur-X to JSON and UBL to JSON deterministically, with the norm's own validation rules applied.

### How to use it

1. Pass direct URLs to your invoice files (`fileUrls`) — presigned S3/GCS/Azure links or Apify key-value-store URLs work.
2. Run the Actor; each file becomes one dataset item.
3. Read the dataset from the API, Make, Zapier, Google Sheets — or let an AI agent call this Actor as an MCP tool ("parse this invoice and give me the IBAN and total").

Typical pipelines: e-invoice inbox automation (mail attachment → parse → ERP), accounts-payable pre-checks before import, bulk migration of received XML invoices into a bookkeeping system, agent-driven invoice triage.

#### Example input

```json
{
    "fileUrls": [
        "https://your-bucket.s3.amazonaws.com/invoices/2026-07/invoice-4711.pdf?X-Amz-Signature=...",
        "https://example.com/invoices/rechnung-0815.xml"
    ]
}
```

One field is all there is: a list of file URLs, XML or PDF, mixed freely. Each file becomes one
dataset item; files that turn out not to be e-invoices are reported and not charged.

### Use with AI agents (MCP)

This Actor is available as a tool through the [Apify MCP server](https://mcp.apify.com), so agents
in Claude, ChatGPT or any MCP client can parse invoices mid-workflow. Prompts that map onto this
Actor:

- *"Parse this invoice and give me the IBAN, due date and total."*
- *"Check whether these five XRechnung files pass validation and list every error with its rule ID."*
- *"Extract all line items from this ZUGFeRD PDF into a table."*

Because parsing is deterministic, the agent's answer is only ever as wrong as the invoice itself —
every number in the output exists verbatim in the file.

### FAQ

**Why not just ask an LLM to read the invoice?**
LLMs hallucinate amounts and merge line items — a single silently wrong booking is disqualifying in accounting. This parser reads the machine-readable XML the EU norm mandates; every number in the output exists verbatim in the file.

**Is my invoice data safe?**
Files are processed in memory inside your own Actor run and results go only to your own dataset. Nothing is sent to third parties — there is no LLM, no OCR cloud service, no analytics.

**What about plain PDF invoices without embedded XML?**
They are detected and reported as "not an e-invoice" (free of charge). OCR of unstructured PDFs is a different, error-prone problem this Actor deliberately avoids.

**Which countries' invoices work?**
Any invoice following EN 16931 (the EU norm) — German XRechnung and ZUGFeRD, French Factur-X, Peppol BIS used across the EU/EEA, and national CIUS variants that keep the core structure.

### Pricing

**$0.05 per successfully parsed invoice.** Unparseable files cost nothing — you only pay for
invoices that came back as structured JSON.

### Related tools by the same author

- **[E-Invoice Validation API](https://api.rechnungssicht.de/)** — validate EN 16931 / XRechnung /
  ZUGFeRD / Peppol BIS invoices via a single REST call, without running an Actor. Same validation
  engine as this parser.
- **[rechnungssicht.de](https://rechnungssicht.de/)** — free browser tool that renders e-invoices
  readable locally (German; nothing leaves your machine).

### More from this publisher

- **[SEO Audit + AI Visibility](https://apify.com/siccscha/seo-health-auditor)** — technical SEO
  audit plus the check whether AI systems can cite your site.
- **[Core Web Vitals Auditor](https://apify.com/siccscha/core-web-vitals-auditor)** — bulk
  Lighthouse for a list of URLs.
- **[TED Tender Scraper](https://apify.com/siccscha/ted-tender-scraper)** — search and monitor EU
  public procurement notices via the official TED API.

# Actor input Schema

## `fileUrls` (type: `array`):

Direct URLs to the e-invoice files to parse into structured JSON. Accepts XML (XRechnung, EN 16931 UBL/CII, Peppol BIS Billing 3.0) and hybrid PDFs (ZUGFeRD 1.0/2.x, Factur-X — the embedded XML is extracted automatically); formats can be mixed freely in one run. Presigned S3/GCS/Azure URLs and Apify key-value-store URLs work too. Each file becomes one dataset item with parties, line items, VAT breakdown, totals, IBAN and EN 16931 validation findings. Files that are not e-invoices are reported as such — you are only charged for files that parse successfully.

## Actor input object example

```json
{
  "fileUrls": [
    "https://raw.githubusercontent.com/itplr-kosit/xrechnung-testsuite/master/src/test/business-cases/standard/01.01a-INVOICE_ubl.xml"
  ]
}
```

# Actor output Schema

## `invoices` (type: `string`):

One item per file: detected format (XRechnung, ZUGFeRD/Factur-X, EN 16931 UBL or CII), parties, line items, VAT breakdown, totals, IBAN and payment terms, plus rule findings with their severity.

## `overview` (type: `string`):

One row per file: parsed yes/no, format, rule errors, warnings, fatal error, source.

## `runInConsole` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "fileUrls": [
        "https://raw.githubusercontent.com/itplr-kosit/xrechnung-testsuite/master/src/test/business-cases/standard/01.01a-INVOICE_ubl.xml"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("siccscha/e-invoice-parser").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "fileUrls": ["https://raw.githubusercontent.com/itplr-kosit/xrechnung-testsuite/master/src/test/business-cases/standard/01.01a-INVOICE_ubl.xml"] }

# Run the Actor and wait for it to finish
run = client.actor("siccscha/e-invoice-parser").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "fileUrls": [
    "https://raw.githubusercontent.com/itplr-kosit/xrechnung-testsuite/master/src/test/business-cases/standard/01.01a-INVOICE_ubl.xml"
  ]
}' |
apify call siccscha/e-invoice-parser --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=siccscha/e-invoice-parser",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/9Y4g5WvWTocF5OLgN/builds/hmutkYYdnIKZMJcwZ/openapi.json
