Logo
POST /api/pdf/einvoice/create

ZUGFeRD & XRechnung API

Send your PDF invoice and its data, get a ZUGFeRD / Factur-X e-invoice back — totals calculated and checked against its profile, XRechnung included.

  • Free plan
  • No credit card

Request

curl -X POST https://apdf.io/api/pdf/einvoice/create \
  -H "Authorization: Bearer TOKEN" \
  -d file="FILE_URL" \
  -d invoice[number]="RE-2026-0042" \
  -d invoice[issue_date]="2026-11-11" \
  -d invoice[due_date]="2026-11-25" \
  -d invoice[currency]="EUR" \
  -d invoice[seller][name]="Acme GmbH" \
  -d invoice[seller][vat_id]="DE123456789" \
  -d invoice[seller][address][line1]="Hauptstraße 1" \
  -d invoice[seller][address][city]="Berlin" \
  -d invoice[seller][address][postcode]="10115" \
  -d invoice[seller][address][country]="DE" \
  -d invoice[buyer][name]="Contoso AG" \
  -d invoice[buyer][address][line1]="Am Markt 5" \
  -d invoice[buyer][address][city]="Hamburg" \
  -d invoice[buyer][address][postcode]="20095" \
  -d invoice[buyer][address][country]="DE" \
  -d invoice[payment][iban]="DE02120300000000202051" \
  -d invoice[lines][0][name]="Consulting" \
  -d invoice[lines][0][quantity]="8" \
  -d invoice[lines][0][unit]="HUR" \
  -d invoice[lines][0][unit_price]="120" \
  -d invoice[lines][0][vat_rate]="19" \
  -d invoice[charges][0][amount]="4.95" \
  -d invoice[charges][0][reason]="Shipping" \
  -d invoice[charges][0][vat_rate]="19"

Your invoice.
Now machine-readable.

The invoice looks exactly as before, pages and links included. Its data travels inside as XML that accounting software reads.

invoice-RE-2026-0042.pdf EN 16931 · PDF/A-3
Acme GmbH
Hauptstraße 1, 10115 Berlin
factur-x.xml
Invoice RE-2026-0042 1
Consulting · 8 × 120.00 2960.00
Shipping4.95
Net964.95
VAT 19 % 3183.34
Amount due 41,148.29 EUR
factur-x.xml
1 <ram:ID>RE-2026-0042</ram:ID>
<ram:Name>Acme GmbH</ram:Name>
2 <ram:Name>Consulting</ram:Name>
<ram:BilledQuantity unitCode="HUR">8</ram:BilledQuantity>
3 <ram:CalculatedAmount>183.34</ram:CalculatedAmount>
4 <ram:DuePayableAmount>1148.29</ram:DuePayableAmount>
One file: people read the page, accounting software reads the XML, and both say the same.
The profiles you can create
BASIC
Lines and totals, for simple invoices
EN 16931
The European standard, the default
EXTENDED
The standard with room for more detail
XRECHNUNG
For German public authorities

Line amounts, the VAT breakdown and the totals are calculated from your lines, discounts and charges.

Invoices that book themselves.

Keep the invoice PDF your customers know, and add the data their accounting reads without typing.

Keep your invoice layout

Turn the PDF your billing already makes into an e-invoice, with its branding, pages and links kept.

Invoices to authorities

Send XRechnung invoices to German public authorities, with the Leitweg-ID as the buyer reference.

Credit notes and corrections

Issue credit notes and corrected invoices that point back to the invoices they refer to.

Every way to get paid

State a bank transfer, SEPA direct debit, card or online payment, with discounts and charges.

E-invoices from anywhere.

Turn invoices into e-invoices right where they are made. One account and one monthly allowance behind every route.

Your code

One authenticated POST from any language. Copy-paste samples in cURL, Node.js, Python and more.

POST /api/pdf/einvoice/create
Open the endpoint docs
Zapier

Pick the action in any Zap and map files from earlier steps. No code and no servers to run.

Create E-Invoice
Use it in Zapier
n8n

Add the Apdf node to any workflow, on n8n Cloud or self-hosted, and chain it with your automation.

Create electronic invoice
Use it in n8n
AI agents

Let Claude, ChatGPT, Gemini or your own agent run it through the MCP server, on any paid plan.

create-e-invoice
See what agents can do

1,000 e-invoices
a month. Free.

Start on the free plan and move up only when your volume does — up to 1,000,000 operations a month on Business.

  • One call is one operation, however many pages.
  • Only calls that do the work are counted.
  • Hard limits, so no surprise overage charges.
Plan PDF operations / month
Hobby Free
$0 / month
1,000
Pro
$39–$99 / month
20,000 – 60,000
Business
$149–$899 / month
100,000 – 1,000,000

Creating e-invoices, answered

EN 16931, the default, follows the European standard that e-invoicing rules like the German and French ones build on. Choose XRECHNUNG for invoices to German public authorities, EXTENDED when your invoices need more detail than the standard allows, and BASIC for simple invoices.
From your billing as it is today: send the URL of the invoice PDF you already make. If you build invoices from HTML, create the PDF with the HTML to PDF API first and pass its URL on. In Zapier and n8n you can map the file from an earlier step.
You get no e-invoice back. The job fails with a 422 and lists every violation with its rule, like BR-CO-16, so you can fix the data and send it again. Nothing invalid leaves the API.
Yes. Pass a ready ZUGFeRD, Factur-X or XRechnung XML as xml instead of the invoice data, and it is embedded and checked the same way, in the profile it declares. A PDF that already is an e-invoice gets its XML replaced.
Its pages, links and form fields stay as they are. The file is saved as PDF/A-3, the archive format e-invoices use, so a PDF whose fonts aren't embedded can't become one. The download URL stays valid for 60 minutes.
After the API call

Your code made the PDF.
Then it went dark.

Opened, read, signed or ignored — you never see any of it. Send the PDFs you generate as personal links, and every open, page read, comment and signature comes back to your software as a webhook. Need it signed? Same link. Same account, same API key, one more call.

Your PDF, after sending Live
document:loaded CFO
page:read p4 · 38s
signature:signed 11:48

API · Webhook · MCP

Send invoices
that book themselves.