Create ZUGFeRD Invoice
PDF4me Create ZUGFeRD Invoice builds a ZUGFeRD / Factur-X electronic invoice from structured invoice data, or from an XML, JSON or CSV source, and optionally embeds it into a PDF/A document. You choose the ZUGFeRD version, the conformance profile (from MINIMUM up to XRECHNUNG), and whether you want the invoice XML on its own or inside a PDF.
Authenticating Your API Request
Every call needs your PDF4me key in the Authorization header as Basic <your API key>.
Endpoint
| Method | POST |
| URL | https://api.pdf4me.com/api/v2/CreateZugferdInvoice |
| Operation ID | CreateZugferdInvoice_V2 |
| Content type | application/json |
| Authorization | Basic <your API key> |
Important Facts You Should Not Miss
- The action object is required. The body must contain a
zugferdCreatorActionobject. Leave it out and the call fails withZugferdCreatorAction is required. docContentis required too, and it is separate from the invoice. It is the source document of the request envelope; an empty value fails withFile is empty. The invoice itself goes into thezugferdCreatorActionfields.- XRechnung is a profile here, not a separate endpoint. Ask for it with
conformanceLevelset toXRECHNUNG. - Factur-X is the same document. The API contract describes this action as creating a ZUGFeRD / Factur-X invoice, so the same versions and profiles cover both names.
- Profiles are version-dependent. ZUGFeRD 1.0 takes
BASIC,COMFORTandEXTENDED. 2.0 and later takeMINIMUM,BASICWL,BASIC,EN16931,EXTENDEDandXRECHNUNG. Pairing a 1.0 profile with a 2.x version is the most common mistake. Retry-Afteron an async job is always 10 seconds.
Request body
The body is the standard v2 envelope plus one action object.
Envelope fields
| Field | Type | Required | What it is |
|---|---|---|---|
docContent | string | Yes | The source file: base64 content, a pdf4meblobid://<id> reference, or an https URL. An empty value fails with File is empty. |
docName | string | Recommended | Source file name including its extension. Actions dispatch on the extension, so always set it. |
docContentBytes | byte | No | Alternative raw byte payload for the source file. |
isAsync | boolean | No | true processes the job asynchronously and gives you a job to poll at /api/v2/GetActionStatus. |
callBackUrl | string | No | URL notified when an asynchronous job finishes. |
jobIdExt | string | No | Your own reference. Stored with the API call log so you can correlate calls with your jobs. |
Ignored by v2: actionId, ipAddress, jobId and document are accepted but not used. Do not build anything on them.
zugferdCreatorAction fields
| Field | Type | What it does |
|---|---|---|
outputMode | XmlOnly | XmlWithPdf | XmlOnly returns only the invoice XML; XmlWithPdf embeds the XML in a PDF. |
zugferdVersion | string | The ZUGFeRD version, for example 2.1. |
conformanceLevel | string | The ZUGFeRD / Factur-X profile, for example EN16931. |
renderInvoiceOnPdf | boolean | Render the invoice data as a visible invoice on the PDF. |
inputFormat | XML | JSON | CSV | The format of the data you put in invoiceXmlData, invoiceJsonData or invoiceCsvData. |
invoiceData | object | The invoice as structured fields. See below. |
invoiceXmlData | byte | The invoice as base64-encoded XML. |
invoiceJsonData | byte | The invoice as base64-encoded JSON. |
invoiceCsvData | byte | The invoice as base64-encoded CSV. |
invoiceXmlPath | string | Path to an invoice XML file. |
language | string | Language of the rendered invoice. |
Versions and conformance profiles
zugferdVersion and conformanceLevel are plain strings in the schema. These are the values the PDF4me integrations send, and the pairing matters.
| Version | Profiles it takes |
|---|---|
1.0 | BASIC, COMFORT, EXTENDED |
2.0, 2.1, 2.2, 2.4 | MINIMUM, BASICWL, BASIC, EN16931, EXTENDED, XRECHNUNG |
What each 2.x profile means:
| Profile | What it carries |
|---|---|
MINIMUM | The minimal machine-readable core. |
BASICWL | Basic without line items. |
BASIC | Line items, over a broader CII subset. |
EN16931 | The EU e-invoice baseline. |
EXTENDED | EN 16931 plus extensions. |
XRECHNUNG | The German CIUS on EN 16931. |
ZUGFeRD, Factur-X and XRechnung
Three names, one endpoint.
| Name | What it is | How you get it here |
|---|---|---|
| ZUGFeRD | The German hybrid e-invoice: a PDF/A-3 file with the invoice XML embedded inside it. | The default. Pick a 2.x zugferdVersion. |
| Factur-X | The French name for the same document. | The same call. The API contract describes this action as creating a ZUGFeRD / Factur-X electronic invoice, and conformanceLevel as the ZUGFeRD / Factur-X profile. |
| XRechnung | The German CIUS on EN 16931, for billing federal, state and municipal authorities. | Set conformanceLevel to XRECHNUNG on a 2.x version. |
Supplying the invoice
There are two ways to hand over the invoice, and you use one of them.
1. Structured fields. Fill invoiceData and let PDF4me build the XML:
| Field | Notes |
|---|---|
invoiceId | Invoice number. |
issueDate | Invoice date (date-time). |
invoiceType | Kind of invoice. |
typeCode | Invoice type code (UNTDID 1001), for example 380 for a commercial invoice. |
notes | Array of free-text notes printed on the invoice. |
isTest | Mark the invoice as a test document. |
seller / buyer | The two parties. |
payment | Payment details. |
lineItems | The invoice lines. |
totals | The invoice totals. |
deliveryDate | Delivery date (date-time). |
2. Your own XML, JSON or CSV. Base64-encode it into invoiceXmlData, invoiceJsonData or invoiceCsvData, and set inputFormat to the matching XML, JSON or CSV. invoiceXmlPath points at an invoice XML file instead.
Language
language sets the language of the rendered invoice. The PDF4me integrations send: cs, nl, en, fr, de, it, pl, pt and es.
Sample payloads
1. Your own XML invoice, embedded in a PDF (EN 16931)
{
"docName": "invoice.pdf",
"docContent": "<base64 of the PDF>",
"isAsync": true,
"zugferdCreatorAction": {
"outputMode": "XmlWithPdf",
"zugferdVersion": "2.1",
"conformanceLevel": "EN16931",
"renderInvoiceOnPdf": true,
"inputFormat": "XML",
"invoiceXmlData": "<base64 of the invoice XML>",
"language": "de"
}
}
2. XRechnung, XML only
{
"docName": "invoice.pdf",
"docContent": "<base64 of the PDF>",
"isAsync": true,
"zugferdCreatorAction": {
"outputMode": "XmlOnly",
"zugferdVersion": "2.1",
"conformanceLevel": "XRECHNUNG",
"inputFormat": "XML",
"invoiceXmlData": "<base64 of the invoice XML>",
"language": "de"
}
}
3. Structured fields instead of XML
{
"docName": "invoice.pdf",
"docContent": "<base64 of the PDF>",
"isAsync": true,
"zugferdCreatorAction": {
"outputMode": "XmlWithPdf",
"zugferdVersion": "2.1",
"conformanceLevel": "EN16931",
"renderInvoiceOnPdf": true,
"invoiceData": {
"invoiceId": "RE-2026-0042",
"issueDate": "2026-11-21T00:00:00Z",
"typeCode": "380",
"isTest": false
},
"language": "de"
}
}
curl
curl -X POST https://api.pdf4me.com/api/v2/CreateZugferdInvoice \
-H "Authorization: Basic YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d @zugferd.json \
--output zugferd_invoice.pdf
Responses
| Status | What you get |
|---|---|
200 | The finished file is the response body. Content-Disposition carries inline; filename=<name>, plus FileName and PageCount headers (PageCount is 0 when it does not apply). |
202 | The job was accepted asynchronously. Location is the absolute /api/v2/GetActionStatus URL for the job, Retry-After is always 10, and traceid and x-job-id identify the job. |
204 | Empty result. |
400 | Bad request. |
401 | Not authorized. Check the Authorization header. |
402 | No credit available. |
500 | Server error. Quote traceid in support requests. |
Accounts on the ATD program get 200 with "Status": "Pending" instead of a 202.
FAQ
What is the difference between XRechnung and ZUGFeRD?
They are not alternatives at this endpoint. ZUGFeRD is the format; XRECHNUNG is one of its conformance profiles, the German CIUS on EN 16931. To produce an XRechnung-conformant document, call this same endpoint with conformanceLevel set to XRECHNUNG.
Is Factur-X the same thing as ZUGFeRD?
For this endpoint, yes. The API contract describes the action as creating a ZUGFeRD / Factur-X electronic invoice. Factur-X is the French name for the same hybrid PDF-plus-XML invoice, and the same versions and profiles apply.
Can I get only the invoice XML, without a PDF?
Yes. Set outputMode to XmlOnly and the response is the invoice XML on its own. XmlWithPdf embeds that same XML in a PDF instead.
Which ZUGFeRD versions does the API accept?
zugferdVersion is a string. The PDF4me integrations send 1.0, 2.0, 2.1, 2.2 and 2.4. Check the profile table above before pairing one with a conformanceLevel.
Do I still have to send docContent if my invoice is XML?
Yes. docContent is required by the request envelope and an empty value fails with File is empty. Send the PDF you want the invoice embedded in; the invoice data itself goes in the zugferdCreatorAction fields.
How does the asynchronous flow work?
Send isAsync as true. A 202 carries a Location header with the absolute /api/v2/GetActionStatus URL for the job, and a Retry-After header which is always 10. GET the Location URL with the same Authorization header until it returns 200.
Same task on other platforms
| Platform | Page |
|---|---|
| Make | Create ZUGFeRD Invoice |
| Power Automate | Create ZUGFeRD Invoice |
| Zapier | Create ZUGFeRD Invoice |
| n8n | Create ZUGFeRD Invoice |