ZUGFeRD & XRechnung from n8n, Make or Zapier

Many no-code automations end with “now send the customer an invoice”. From 2027 many German B2B senders must send structured e-invoices (ZUGFeRD or XRechnung) instead of plain PDFs. This page shows how to create them with a single HTTP request to the Invoice PDF, ZUGFeRD & XRechnung Generator on Apify – no library, no server of your own.

How it works

  1. Get an Apify API token (Apify console → Settings → API & Integrations).
  2. POST your invoice JSON to https://api.apify.com/v2/acts/rm.solutions~invoice-pdf-generator/run-sync-get-dataset-items?token=YOUR_TOKEN.
  3. The response is a JSON array with pdfUrl (ZUGFeRD hybrid PDF/A-3) and xrechnungXmlUrl (EN 16931 CII XML). Download the file and attach it to your e-mail node.

Set "eInvoice": "zugferd" for a hybrid PDF, "xrechnung" for PDF + XRechnung 3.0 XML (public sector, Leitweg-ID via buyer.leitwegId), or leave it out for a normal PDF. Our sample ZUGFeRD output passed the Factur-X EN 16931 rules with 0 errors; please validate your own first invoices before going live.

Request body

{
 "eInvoice": "zugferd",
 "language": "de",
 "currency": "EUR",
 "taxRate": "19",
 "seller": {
  "name": "Example GmbH",
  "address": "Musterstr. 1",
  "postalCode": "10115",
  "city": "Berlin",
  "country": "DE",
  "taxId": "DE123456789",
  "email": "rechnung@example.com"
 },
 "bank": {
  "iban": "DE89370400440532013000"
 },
 "invoice": {
  "invoiceNumber": "2026-042",
  "dueDate": "2026-12-11",
  "serviceDate": "2026-11-27",
  "buyer": {
   "name": "Kunde AG",
   "address": "Hauptstr. 5",
   "postalCode": "80331",
   "city": "München",
   "email": "ap@kunde.de"
  },
  "items": [
   {
    "description": "Webdesign",
    "quantity": 12,
    "unit": "h",
    "unitPrice": 85
   }
  ]
 }
}

n8n

Import the workflow below (n8n → Workflows → Import from file / paste). It uses two HTTP Request nodes: one creates the invoice, the second downloads the PDF as binary so you can pass it to Gmail, Outlook or an S3 node. The token is read from the environment variable APIFY_TOKEN – or replace the expression with an n8n credential. File: examples/n8n-zugferd-invoice.json.

{
 "name": "Create ZUGFeRD invoice (Apify)",
 "nodes": [
  {
   "parameters": {},
   "name": "Manual Trigger",
   "type": "n8n-nodes-base.manualTrigger",
   "typeVersion": 1,
   "position": [
    200,
    300
   ],
   "id": "a1"
  },
  {
   "parameters": {
    "method": "POST",
    "url": "https://api.apify.com/v2/acts/rm.solutions~invoice-pdf-generator/run-sync-get-dataset-items",
    "sendQuery": true,
    "queryParameters": {
     "parameters": [
      {
       "name": "token",
       "value": "={{$env.APIFY_TOKEN}}"
      }
     ]
    },
    "sendBody": true,
    "specifyBody": "json",
    "jsonBody": "{\n \"eInvoice\": \"zugferd\",\n \"language\": \"de\",\n \"currency\": \"EUR\",\n \"taxRate\": \"19\",\n \"seller\": {\n  \"name\": \"Example GmbH\",\n  \"address\": \"Musterstr. 1\",\n  \"postalCode\": \"10115\",\n  \"city\": \"Berlin\",\n  \"country\": \"DE\",\n  \"taxId\": \"DE123456789\",\n  \"email\": \"rechnung@example.com\"\n },\n \"bank\": {\n  \"iban\": \"DE89370400440532013000\"\n },\n \"invoice\": {\n  \"invoiceNumber\": \"2026-042\",\n  \"dueDate\": \"2026-12-11\",\n  \"serviceDate\": \"2026-11-27\",\n  \"buyer\": {\n   \"name\": \"Kunde AG\",\n   \"address\": \"Hauptstr. 5\",\n   \"postalCode\": \"80331\",\n   \"city\": \"München\",\n   \"email\": \"ap@kunde.de\"\n  },\n  \"items\": [\n   {\n    \"description\": \"Webdesign\",\n    \"quantity\": 12,\n    \"unit\": \"h\",\n    \"unitPrice\": 85\n   }\n  ]\n }\n}",
    "options": {}
   },
   "name": "Create invoice",
   "type": "n8n-nodes-base.httpRequest",
   "typeVersion": 4.2,
   "position": [
    420,
    300
   ],
   "id": "a2"
  },
  {
   "parameters": {
    "url": "={{$json.pdfUrl}}",
    "options": {
     "response": {
      "response": {
       "responseFormat": "file"
      }
     }
    }
   },
   "name": "Download PDF",
   "type": "n8n-nodes-base.httpRequest",
   "typeVersion": 4.2,
   "position": [
    640,
    300
   ],
   "id": "a3"
  }
 ],
 "connections": {
  "Manual Trigger": {
   "main": [
    [
     {
      "node": "Create invoice",
      "type": "main",
      "index": 0
     }
    ]
   ]
  },
  "Create invoice": {
   "main": [
    [
     {
      "node": "Download PDF",
      "type": "main",
      "index": 0
     }
    ]
   ]
  }
 },
 "settings": {}
}

Tip: map fields from your previous node (CRM, Airtable, Google Sheets, Stripe) into the JSON body with expressions like {{$json.customer_name}}. To create many invoices in one call, send "invoices": [ ... ] instead of "invoice" (batch mode).

Make (Integromat)

  1. Add module HTTP → Make a request.
  2. URL: https://api.apify.com/v2/acts/rm.solutions~invoice-pdf-generator/run-sync-get-dataset-items, method POST, query string token = your Apify token.
  3. Body type: Raw, content type JSON (application/json), paste the request body and map your fields.
  4. Enable Parse response. Add a second HTTP → Get a file module with URL 1.pdfUrl (first array item) and attach the file to your e-mail module.

Alternatively use Make's official Apify app (“Run an Actor”) with actor rm.solutions/invoice-pdf-generator and read the dataset items.

Zapier

Use Webhooks by Zapier → Custom Request (POST, the URL above with ?token=…, data = JSON body, header Content-Type: application/json). The response fields pdfUrl and xrechnungXmlUrl are available in the next steps, e.g. as attachment URL in Gmail.

Python

import requests
body = {...}  # request body from above
r = requests.post("https://api.apify.com/v2/acts/rm.solutions~invoice-pdf-generator/run-sync-get-dataset-items",
                  params={"token": APIFY_TOKEN}, json=body, timeout=120)
item = r.json()[0]
pdf = requests.get(item["pdfUrl"]).content
open(item["fileName"], "wb").write(pdf)

curl

curl -X POST "https://api.apify.com/v2/acts/rm.solutions~invoice-pdf-generator/run-sync-get-dataset-items?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" -d @invoice.json

Cost

Billed per generated document through your Apify account (prices on the actor page). Rows with missing required fields return ok: false and are not charged.

Need bank payment files from the same workflow? See the SEPA XML + GiroCode API.