Automation MCP Server Blog Pricing

AI PDF to ZUGFeRD API

Convert a PDF invoice into a ZUGFeRD compliant PDF/A-3 with embedded XML for German e-invoicing.

POST https://api.invoicexml.com/v1/transform/to/zugferd
  • Typed, scanned or photographed PDFs
  • PDF/A-3 with embedded CII XML
  • New PDF in English, German or French
  • Validated against EN 16931

Technical reference

Convert a PDF invoice into a ZUGFeRD hybrid invoice. The API extracts structured data from your PDF, validates it against EN 16931 business rules, and returns a PDF/A-3 with an embedded factur-x.xml attachment for German B2B and B2G exchange.

Review every result before you use it

AI can make mistakes. Before you send the invoice or submit it to an authority, check every value in the XML against the source PDF, including the XML embedded in a ZUGFeRD or Factur-X PDF, not only the visual layer.

Code Example

curl -X POST https://api.invoicexml.com/v1/transform/to/zugferd \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "[email protected]" \
  -F "language=auto" \
  -F "validationLanguage=de"

Request

Parameter Type Description
file * binary The invoice file to process.
language string Language of the rendered PDF (labels and date format) and of the default texts the XML states on the invoice's behalf, such as the VAT exemption reason. Values: en, de, fr, auto. Defaults to auto: the language the invoice is written in, or English when that is none of the three or the AI cannot tell. Any other value is rejected with a 400 (errorCode 4002).
preserveOriginalPdf boolean true keeps your uploaded PDF as the visual layer and only embeds the XML into it, so the layout stays exactly as it was. Defaults to false: the API renders a new PDF from the extracted data, so the visible invoice shows the values the XML carries. A digital signature on the uploaded PDF does not survive the embedding.
includeAdvancedProperties boolean Adds an "Electronic invoice details" section at the end of the rendered PDF that lists the technical properties the embedded XML carries but a classic invoice layout does not show: specification and business process identifiers, party identifiers with their schemes, electronic addresses and line-level references. That way those values can be checked on the pages themselves. Defaults to true; send false for the classic layout alone. Has no effect when preserveOriginalPdf is true.
validationLanguage string Language of the finding messages when the generated invoice is rejected. Values: en, de, fr. Defaults to en. Only each finding's message changes; rule ids and field paths stay the same. Independent of language. Any other value is rejected with a 400 (errorCode 4002). See localized error messages.

Content-Type: multipart/form-data

The source and target formats are part of the endpoint path, and everything else (syntax, declared profile, specification identifier) is read from the document itself.

Headers

Header Value
Authorization * Bearer YOUR_API_KEY
Content-Type multipart/form-data

Response

200 Converted invoice

Returns the ZUGFeRD PDF as a binary file.

Content-Type: application/pdf

AI output requires human review of the structured data before use

With ZUGFeRD, one file holds two things: the PDF you see and the XML inside it. The XML is what the recipient's software and the tax authority process, so that is what you must check.

By default the visual layer is drawn from the same AI data as the XML and ends with an "Electronic invoice details" section that lists the technical properties of the XML (identifiers, electronic addresses, references), so the pages also show the technical values of the XML. If you keep your original PDF (preserveOriginalPdf), it always looks right, even when the XML is not. Either way, compare these values in the XML against your source PDF:

  • Seller and buyer names, addresses and tax identifiers
  • Invoice number, issue date, due date and payment terms
  • Line items, quantities, unit prices and line totals
  • Tax rates, tax amounts and invoice totals
  • Payment details, such as the IBAN

To see the XML in a readable form:

The rendered PDF is built only from the XML values, so what you read there is exactly what the recipient's system receives. Only send, book or submit the invoice once every value matches. Our Terms of Service require this review for all AI output.

Useful resources

Companion material for integrating against the API.

Frequently Asked Questions

What is ZUGFeRD?

ZUGFeRD (Zentraler User Guide des Forums elektronische Rechnung Deutschland) is the German e-invoicing standard. Version 2.x is technically identical to Factur-X and embeds a CII-based XML file inside a PDF/A-3 container.

Which ZUGFeRD version is generated?

The API generates ZUGFeRD, the current release, aligned with EN 16931 and the German e-invoicing mandate.

How does ZUGFeRD differ from Factur-X?

They are the same technical format. ZUGFeRD is the German branding while Factur-X is the French branding. Both embed identical CII XML inside PDF/A-3.

Is ZUGFeRD mandatory in Germany?

Starting January 2025, all German businesses must be able to receive e-invoices. From 2027, sending structured e-invoices becomes mandatory for most B2B transactions. ZUGFeRD is one of the accepted formats.

Can I use this for XRechnung as well?

ZUGFeRD and XRechnung are complementary. ZUGFeRD produces a hybrid PDF, while XRechnung produces a standalone XML. Use the /v1/transform/to/xrechnung endpoint if you need pure XML for German B2G portals.

Start free today

Ready to automate your invoices?

Validate, convert and embed compliant e-invoices through one API. Start your 30-day free trial. No credit card required.

GDPR Compliant No credit card required Setup in minutes
Peppol UBL
Factur-X
EN 16931
142 / 142 passed
Compliant
PDF/A-3 embedded