Automation MCP Server Blog Pricing

Factur-X to UBL Conversion API

Extract the embedded CII XML from a Factur-X PDF and convert it to UBL XML.

POST https://api.invoicexml.com/v1/convert/facturx/to/ubl
  • Factur-X PDF in, Peppol-ready UBL out
  • Peppol BIS, NLCIUS, EHF or PINT output
  • Embedded XML found and read for you
  • Missing Peppol data pointed out

Technical reference

Upload a Factur-X PDF/A-3 hybrid invoice and receive a UBL XML document. The API extracts the embedded factur-x.xml, maps every EN 16931 Business Term from the CII nested model to the UBL flat component structure, and validates the result against the EN 16931 Schematron rules. Name a UBL profile in the optional profile field, such as peppol-bis-3, and the invoice declares that profile and is validated against its rules, ready for the Peppol network.

Code Example

curl -X POST https://api.invoicexml.com/v1/convert/facturx/to/ubl \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "[email protected]" \
  -F "profile=peppol-bis-3" \
  -F "validationLanguage=fr"

Request

Parameter Type Description
file * binary The Factur-X or ZUGFeRD PDF to convert.
profile string Optional. UBL profile of the converted invoice: en16931 (the default), peppol-bis-3, nlcius, ehf or pint, in any letter case. The invoice declares the profile's specification identifier (BT-24) and, where the profile requires one, its business process (BT-23), must meet the profile's requirements (for Peppol, the seller and buyer electronic addresses and a buyer or order reference), and is validated against the profile's rule set. With the default, the invoice declares plain EN 16931, whatever the uploaded file declared, and is validated against the EN 16931 rules. Any other value is rejected with a 400 (errorCode 4002).
validationLanguage string Optional. Language of the finding messages when the converted invoice is rejected: en (default), de or fr, in any letter case. Only each finding's message changes; rule, btCodes, fields and raw stay the same. Any other value is rejected with a 400 (errorCode 4002). See localized error messages.

Content-Type: multipart/form-data

Headers

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

Response

200 Converted XML

Returns the converted UBL XML document.

Content-Type: application/xml

Useful resources

Companion material for integrating against the API.

Frequently Asked Questions

Can I send the converted invoice over Peppol?

Yes, with profile=peppol-bis-3. The invoice then declares the Peppol BIS Billing specification and business process, must carry the seller and buyer electronic addresses and a buyer or order reference, and is validated against the Peppol rule set. When the Factur-X lacks Peppol data, the 400 names the Peppol rule and the field, and its invoiceData holds the invoice as read, ready to complete and send to /v1/create/ubl.

What happens if the PDF has no embedded XML?

The API returns a 400 response with errorCode 4006 (NoEmbeddedXml). To turn a plain PDF without embedded XML into UBL, use POST /v1/transform/to/ubl (AI extraction).

Are all EN 16931 fields preserved?

Yes. The conversion maps every EN 16931 Business Term from CII to UBL; no semantic data is lost.

Can I get the validation messages in German or French?

Yes. Send validationLanguage=de or validationLanguage=fr with the upload, and the message of every finding comes back in that language. The rule, btCodes and fields stay the same in every language, so your code can keep matching on them.

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