# xrechnung-zugferd-to-pdf-datev-bridge (`dach_automation_tools/xrechnung-zugferd-to-pdf-datev-bridge`) Actor

Transform German E-Invoices (XRechnung 3.0, ZUGFeRD, UBL, CII, EN 16931) into human-readable PDFs (Sicht-PDF), structured accounting JSON, and ready-to-import DATEV packages (belege.zip + EXTF CSV) for n8n & Make workflows.

- **URL**: https://apify.com/dach_automation_tools/xrechnung-zugferd-to-pdf-datev-bridge.md
- **Developed by:** [Bart](https://apify.com/dach_automation_tools) (community)
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$50.00 / 1,000 processed e-invoice (pdf & datev)s

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/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## 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.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## XRechnung & ZUGFeRD to Readable PDF, JSON & DATEV Archive (`belege.zip`) Converter

The all-in-one automation bridge for the **German B2B E-Invoicing Mandate (E-Rechnungspflicht 2025 / 2027 – EN 16931)**.

Transform cryptic incoming **XRechnung (`.xml` UBL & CII)** and **ZUGFeRD** XML files into:

1. \*\* A Clean Human-Readable PDF (`Sichtrechnung.pdf`)\*\* for team approval workflows in Slack, Teams, Email, or DMS.
2. \*\* A Ready-to-Import DATEV Beleg-ZIP (`DATEV_Belege.zip` including `document.xml`)\*\* for **DATEV Unternehmen Online** and tax advisors (*Steuerberater*).
3. \*\* Structured JSON Data\*\* (Seller, Buyer, Invoice ID, Issue Date, Net, Tax, Gross Amounts, Currency) for **n8n**, **Make.com**, Lexoffice, SevDesk, or SAP/ERP integration.

***

### 🇩🇪 Deutsch: XRechnung & ZUGFeRD in Sicht-PDF, JSON & DATEV-Belegarchiv umwandeln

Spätestens zum **01.01.2027** versenden Großhändler, Lieferanten und Dienstleister in Deutschland ihre Rechnungen als reine XML-Dateien (`XRechnung`). Normale Mitarbeiter, Bauleiter und Einkäufer können diese `.xml`-Dateien zur Rechnungsprüfung nicht lesen.

Dieser Actor löst das Problem vollautomatisch in **n8n**, **Make.com** oder per API:

- **Sicht-PDF Generator:** Erzeugt aus jeder XRechnung (UBL 2.1 & UN/CEFACT CII) sofort ein übersichtliches PDF-Dokument für die interne Rechnungsfreigabe.
- **DATEV-Paket (`belege.zip`):** Packt das Original-XML, das Sicht-PDF und die strukturierte `document.xml` in ein fertiges ZIP-Archiv für die Übergabe an die Buchhaltung / DATEV.
- **Sofort testen:** Klicke einfach auf **Start** (auch ohne eigene XML-Datei) – der Actor erstellt sofort ein Beispiel-PDF und ein Beispiel-DATEV-ZIP anhand einer integrierten Muster-XRechnung!

***

### n8n Integration (Ready-to-Use Workflow)

You can import this complete workflow directly into your n8n instance. It includes a manual trigger, a sample XRechnung 3.0 XML test payload, and the HTTP Request node connected to this Apify Actor.

1. Copy the JSON code below.
2. Open n8n, click on **Workflows** -> **Import from Clipboard** (`Strg + V`).
3. Replace `DEIN_APIFY_TOKEN_HIER_EINTRAGEN` in the HTTP Request node with your personal Apify API Token (found in *Settings -> Integrations*).

````json
{
  "name": "XRechnung (XML) to Sicht-PDF & DATEV Bridge (via Apify)",
  "nodes": [
    {
      "parameters": {},
      "id": "1a2b3c4d-0001-0001-0001-000000000001",
      "name": "1. Klick auf Test Workflow",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [240, 300]
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "xml-field",
              "name": "xmlContent",
              "value": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><ubl:Invoice xmlns:ubl=\"urn:oasis:names:specification:ubl:schema:xsd:Invoice-2\" xmlns:cac=\"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2\" xmlns:cbc=\"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2\"><cbc:CustomizationID>urn:cen.eu:en16931:2017#compliant#urn:xeinkauf.de:kosit:xrechnung_3.0</cbc:CustomizationID><cbc:ID>RE-2026-999</cbc:ID><cbc:IssueDate>2026-10-30</cbc:IssueDate><cbc:DocumentCurrencyCode>EUR</cbc:DocumentCurrencyCode><cac:AccountingSupplierParty><cac:Party><cac:PartyName><cbc:Name>Mustermann IT GmbH</cbc:Name></cac:PartyName></cac:Party></cac:AccountingSupplierParty><cac:LegalMonetaryTotal><cbc:TaxExclusiveAmount currencyID=\"EUR\">1000.00</cbc:TaxExclusiveAmount><cbc:TaxInclusiveAmount currencyID=\"EUR\">1190.00</cbc:TaxInclusiveAmount><cbc:PayableAmount currencyID=\"EUR\">1190.00</cbc:PayableAmount></cac:LegalMonetaryTotal></ubl:Invoice>",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "id": "1a2b3c4d-0001-0001-0001-000000000002",
      "name": "2. Beispiel XRechnung 3.0 XML",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [460, 300]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "[https://api.apify.com/v2/acts/DACH_Automation_Tools~xrechnung-zugferd-to-pdf-datev-bridge/run-sync-get-dataset-items?token=DEIN_APIFY_TOKEN_HIER_EINTRAGEN](https://api.apify.com/v2/acts/DACH_Automation_Tools~xrechnung-zugferd-to-pdf-datev-bridge/run-sync-get-dataset-items?token=DEIN_APIFY_TOKEN_HIER_EINTRAGEN)",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n  \"xmlContent\": {{ JSON.stringify($json.xmlContent) }},\n  \"generatePdf\": true,\n  \"generateDatevZip\": true,\n  \"creditorAccount\": \"70000\",\n  \"expenseAccount\": \"4900\"\n}",
        "options": {
          "timeout": 60000
        }
      },
      "id": "1a2b3c4d-0001-0001-0001-000000000003",
      "name": "3. Apify XRechnung-DATEV Bridge",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [700, 300]
    }
  ],
  "connections": {
    "1. Klick auf Test Workflow": {
      "main": [
        [
          {
            "node": "2. Beispiel XRechnung 3.0 XML",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "2. Beispiel XRechnung 3.0 XML": {
      "main": [
        [
          {
            "node": "3. Apify XRechnung-DATEV Bridge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}



# Actor input Schema

## `xmlContent` (type: `string`):

Füge hier den XML-Code der E-Rechnung (UBL oder CII) ein.
## `fileUrl` (type: `string`):

Link zur XML-Datei aus Make.com oder n8n.

## Actor input object example

```json
{}
````

# Actor output Schema

## `results` (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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("dach_automation_tools/xrechnung-zugferd-to-pdf-datev-bridge").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("dach_automation_tools/xrechnung-zugferd-to-pdf-datev-bridge").call(run_input=run_input)

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

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

```

## CLI example

```bash
echo '{}' |
apify call dach_automation_tools/xrechnung-zugferd-to-pdf-datev-bridge --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,dach_automation_tools/xrechnung-zugferd-to-pdf-datev-bridge"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/eerV7mcvcibDcsHXx/builds/E0vxD5KnIGJlk4Zy7/openapi.json
