Skip to main content

Create ZUGFeRD Invoice

What this endpoint does

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.

Related Blog Posts
No blog post yet for this feature — coming soon.
In the meantime, browse the PDF4me blog for tutorials and workflows across every platform.
Visit the blog →

Authenticating Your API Request​

Every call needs your PDF4me key in the Authorization header as Basic <your API key>.

Endpoint​

MethodPOST
URLhttps://api.pdf4me.com/api/v2/CreateZugferdInvoice
Operation IDCreateZugferdInvoice_V2
Content typeapplication/json
AuthorizationBasic <your API key>

Important Facts You Should Not Miss​

  • The action object is required. The body must contain a zugferdCreatorAction object. Leave it out and the call fails with ZugferdCreatorAction is required.
  • docContent is required too, and it is separate from the invoice. It is the source document of the request envelope; an empty value fails with File is empty. The invoice itself goes into the zugferdCreatorAction fields.
  • XRechnung is a profile here, not a separate endpoint. Ask for it with conformanceLevel set to XRECHNUNG.
  • 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, COMFORT and EXTENDED. 2.0 and later take MINIMUM, BASICWL, BASIC, EN16931, EXTENDED and XRECHNUNG. Pairing a 1.0 profile with a 2.x version is the most common mistake.
  • Retry-After on an async job is always 10 seconds.

Request body​

The body is the standard v2 envelope plus one action object.

Envelope fields​

FieldTypeRequiredWhat it is
docContentstringYesThe source file: base64 content, a pdf4meblobid://<id> reference, or an https URL. An empty value fails with File is empty.
docNamestringRecommendedSource file name including its extension. Actions dispatch on the extension, so always set it.
docContentBytesbyteNoAlternative raw byte payload for the source file.
isAsyncbooleanNotrue processes the job asynchronously and gives you a job to poll at /api/v2/GetActionStatus.
callBackUrlstringNoURL notified when an asynchronous job finishes.
jobIdExtstringNoYour 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​

FieldTypeWhat it does
outputModeXmlOnly | XmlWithPdfXmlOnly returns only the invoice XML; XmlWithPdf embeds the XML in a PDF.
zugferdVersionstringThe ZUGFeRD version, for example 2.1.
conformanceLevelstringThe ZUGFeRD / Factur-X profile, for example EN16931.
renderInvoiceOnPdfbooleanRender the invoice data as a visible invoice on the PDF.
inputFormatXML | JSON | CSVThe format of the data you put in invoiceXmlData, invoiceJsonData or invoiceCsvData.
invoiceDataobjectThe invoice as structured fields. See below.
invoiceXmlDatabyteThe invoice as base64-encoded XML.
invoiceJsonDatabyteThe invoice as base64-encoded JSON.
invoiceCsvDatabyteThe invoice as base64-encoded CSV.
invoiceXmlPathstringPath to an invoice XML file.
languagestringLanguage 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.

VersionProfiles it takes
1.0BASIC, COMFORT, EXTENDED
2.0, 2.1, 2.2, 2.4MINIMUM, BASICWL, BASIC, EN16931, EXTENDED, XRECHNUNG

What each 2.x profile means:

ProfileWhat it carries
MINIMUMThe minimal machine-readable core.
BASICWLBasic without line items.
BASICLine items, over a broader CII subset.
EN16931The EU e-invoice baseline.
EXTENDEDEN 16931 plus extensions.
XRECHNUNGThe German CIUS on EN 16931.

ZUGFeRD, Factur-X and XRechnung​

Three names, one endpoint.

NameWhat it isHow you get it here
ZUGFeRDThe German hybrid e-invoice: a PDF/A-3 file with the invoice XML embedded inside it.The default. Pick a 2.x zugferdVersion.
Factur-XThe 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.
XRechnungThe 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:

FieldNotes
invoiceIdInvoice number.
issueDateInvoice date (date-time).
invoiceTypeKind of invoice.
typeCodeInvoice type code (UNTDID 1001), for example 380 for a commercial invoice.
notesArray of free-text notes printed on the invoice.
isTestMark the invoice as a test document.
seller / buyerThe two parties.
paymentPayment details.
lineItemsThe invoice lines.
totalsThe invoice totals.
deliveryDateDelivery 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​

StatusWhat you get
200The 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).
202The 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.
204Empty result.
400Bad request.
401Not authorized. Check the Authorization header.
402No credit available.
500Server 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​

PlatformPage
MakeCreate ZUGFeRD Invoice
Power AutomateCreate ZUGFeRD Invoice
ZapierCreate ZUGFeRD Invoice
n8nCreate ZUGFeRD Invoice

Get Help​