Automation MCP Server Blog Pricing

AI PDF to Factur-X API

Convert a PDF invoice into a Factur-X compliant PDF/A-3 with embedded XML.

POST https://api.invoicexml.com/v1/transform/to/facturx
  • Typed, scanned or photographed PDFs
  • PDF/A-3 with embedded CII XML
  • Option to keep your original PDF
  • Validated against EN 16931

Technical reference

Convert a PDF invoice into a Factur-X compliant PDF with embedded XML. The API extracts invoice data, maps it to the EN 16931 semantic model, and returns a PDF/A-3 with the structured factur-x.xml attachment.

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/facturx \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "[email protected]" \
  -F "language=auto" \
  -F "validationLanguage=fr"

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 Factur-X PDF as a binary file.

Content-Type: application/pdf

AI output requires human review of the structured data before use

With Factur-X, 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 a Factur-X invoice?

Factur-X is a Franco-German e-invoicing standard (also known as ZUGFeRD in Germany). It embeds a structured XML file inside a PDF/A-3, making the invoice both human-readable and machine-processable.

What PDF formats are accepted?

The API accepts any standard PDF invoice. The conversion engine extracts invoice data using AI and maps it to the EN 16931 semantic model before generating the compliant Factur-X output.

Which Factur-X profile is generated?

By default the API generates a Factur-X EN 16931 (Comfort) profile, which covers the vast majority of B2B invoicing requirements in the EU.

How large can the PDF file be?

The API supports PDF files up to 20 MB and up to 10 pages. Split longer documents into one file per invoice before sending them.

Is the output PDF/A-3 compliant?

Yes. The returned PDF conforms to PDF/A-3b and contains the embedded factur-x.xml attachment, fully meeting Factur-X specification requirements.

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