Guide · Invoicing

EU e-invoicing: generating the human-readable invoice document

EU e-invoicing mandates are about structured, machine-readable XML — not PDFs. But in a real invoicing flow you still need a document a human can read: for the customer, for sales, for your own records. This guide covers that second artifact, and how to generate it inside the same automation that builds the XML.

What Docmill is and isn't: Docmill generates the human-readable PDF/DOCX side of an invoicing flow. It does not generate UBL or other structured e-invoice XML, and it is not a compliance product. For the regulatory side, use a dedicated e-invoicing/access-point provider and verify your country's current rules with your tax advisor.

What the mandates mean in practice

Across the EU, "e-invoice" has a specific legal meaning: a structured data file a tax platform or the buyer's system can parse automatically. In practice that ecosystem looks like this:

The two-artifact pattern

Teams that automate invoicing under these mandates almost always end up producing two artifacts from the same invoice data:

Artifact 1 · for machines

The structured XML

UBL/CII built to EN 16931, validated, and submitted via your access point or national platform. Built by your e-invoicing provider, an XML-building step in your workflow, or your accounting system.

Not Docmill's job.

Artifact 2 · for humans

The readable invoice

The PDF (or DOCX) your customer opens, accounts payable prints, sales attaches to the deal, and your archive keeps alongside the XML. Same data, rendered for people.

This is what Docmill generates — inside the same n8n, Make, or Zapier flow.

The XML satisfies the tax platform; the readable document satisfies everyone else. Generating both from one data source keeps them consistent — the classic failure mode is a PDF produced by one system and XML produced by another, drifting apart on totals or terms.

Hybrid formats such as ZUGFeRD / Factur-X embed the XML inside a PDF/A-3 file. Docmill produces a standard PDF; embedding XML into PDF/A-3 is a separate step handled by dedicated tooling. The two-artifact pattern above works regardless.

Building the document side in n8n or Make

Wherever your flow already assembles invoice data and builds/submits the XML, add one Docmill step branching off the same data. In n8n, for example:

  1. Trigger + data assembly

    Order created (webhook, Stripe, your database) → a Set/Code node shapes the invoice data: seller and buyer details, VAT identifiers, line items, tax rates, totals.

  2. Branch A — structured XML

    Your existing XML-building step and submission to your access point or national platform, via your e-invoicing provider's node or API.

  3. Branch B — Docmill: Generate Document

    The same data object goes into the Docmill node (or Make module / Zapier action): template ID, Data (JSON), Output Format PDF or DOCX. The file comes back as binary output ready for the next step.

  4. Deliver and archive

    Email the PDF to the customer, and store XML + PDF together (Drive, S3, your DMS) so every invoice's two artifacts stay paired.

Setup for each platform is covered step by step in the n8n guide, the Make guide, and the Zapier guide — including credentials, field mapping, and troubleshooting.

Starting point: the invoice starter template

Every Docmill account ships with starter:invoice — line items, totals, payment terms — which renders a finished invoice PDF in one call:

# one POST, one invoice
curl https://api.docmill.io/v1/documents \
  -H "Authorization: Bearer dk_live_…" \
  -H "Content-Type: application/json" \
  -d '{
    "template_id": "starter:invoice",
    "data": { "client": {"name": "Northwind Traders"},
              "items": [{"description": "Design sprint",
                         "quantity": 1, "unitPrice": 4800}],
              "total": 4800 },
    "output": "pdf"
  }' --output invoice.pdf
# → %PDF-1.7 …

For EU invoices you'll usually want a richer layout — both parties' VAT identifiers, per-line VAT rates, a tax breakdown table, the invoice number and dates displayed prominently. Rather than hand-building that, describe it once and let Docmill draft a reusable template:

curl https://api.docmill.io/v1/templates/generate \
  -H "Authorization: Bearer dk_live_…" \
  -H "Content-Type: application/json" \
  -d '{ "prompt": "An EU-style invoice: seller and buyer blocks with
        VAT identifiers, invoice number and issue/due dates, line items
        with per-line VAT rate, a VAT breakdown table by rate, totals
        net/VAT/gross, 30-day payment terms and bank details." }'
# → template id + sample data showing exactly which fields to send

The response includes sample data that tells you the exact field names to map from your workflow — the same fields your XML step already has. Templates are plain HTML underneath, so you can adjust wording, add your logo, or translate labels. The same template renders as PDF or DOCX (and XLSX for tabular documents) by switching the output format.

FAQ

Does Docmill make my invoices compliant with EU e-invoicing rules?

No. Compliance in the mandate sense is about the structured XML, its validation, and how it's transmitted — that's the domain of e-invoicing providers and access points. Docmill generates the human-readable document that travels alongside. Verify your obligations with your tax advisor or local authority.

Does Docmill generate UBL, CII, or Peppol XML?

No. Docmill's outputs are PDF, DOCX, and XLSX. Build the XML with your e-invoicing provider or an XML step in your workflow, and use Docmill for the readable document in the same flow.

If the XML is the legal invoice, why produce a PDF at all?

Because people still read invoices. Customers expect an attachment they can open, accounts-payable teams print and file them, and your own records are easier to audit with a readable copy next to the XML. Some workflows and formats also pair the two by design (see the hybrid-format note above).

Can the PDF and the XML come from the same data?

Yes — that's the point of doing it in one n8n/Make/Zapier flow. One assembled invoice object feeds both the XML builder and the Docmill step, so amounts, dates, and parties can't drift apart.

What about ZUGFeRD / Factur-X hybrid invoices?

Those embed the XML inside a PDF/A-3 container. Docmill produces a standard PDF; if you need the hybrid container, the embedding is a separate step with dedicated tooling. Many flows simply keep XML and PDF as two paired files instead.

What does the document side cost?

The free tier covers 50 documents a month (watermarked) — enough to prototype the whole flow. Paid plans meter per document: $19/mo for 1,000, $49/mo for 5,000, $99/mo for 15,000. One generated file is one document, no multipliers.

Prototype the document side today.

Free tier: 50 documents/month, no card. The XML side stays with your e-invoicing provider — Docmill handles the copy humans read.

Start free API docs

More guides

Generate PDFs from n8n

Install the community node, map data, handle async bulk jobs.

Generate PDFs from Make

The Docmill app's modules and a worked scenario with binary output.

Generate PDFs from Zapier

The Generate Document action, field mapping, and a worked Zap.