Automation MCP Server Blog Pricing

AI PDF to UBL API

Convert a PDF invoice into an EN 16931 UBL XML document for European and global e-invoicing.

POST https://api.invoicexml.com/v1/transform/to/ubl
  • Typed, scanned or photographed PDFs
  • EN 16931 UBL invoice XML
  • Totals checked against the PDF
  • Validated before delivery

Technical reference

Convert a PDF invoice into a UBL XML document that declares the EN 16931 baseline, validated against the EN 16931 business rules before it is returned. UBL (Universal Business Language) is the OASIS XML standard used by Peppol BIS Billing and is the mandated e-invoicing syntax in Norway, Denmark, Sweden, Singapore, Australia, New Zealand, and across the broader Peppol ecosystem.

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/ubl \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "[email protected]" \
  -F "validationLanguage=en"

Request

Parameter Type Description
file * binary The invoice file to process.
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. 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, so there is nothing more to configure.

Default texts the XML needs but the invoice does not state, such as the payment terms or the VAT exemption reason, are written in the language the invoice is written in: English, German or French, or English for any other language.

Headers

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

Response

200 Converted invoice

Returns the UBL XML document.

Content-Type: application/xml

AI output requires human review of the structured data before use

With UBL, the XML is the invoice. It is what the recipient's software and the tax authority process, so every value in it must be checked before you send it.

The XML is what the AI produced from your PDF. Compare these values in it 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 UBL?

UBL (Universal Business Language) 2.1 is an OASIS XML standard for electronic business documents. It is one of the two official syntaxes of the European EN 16931 e-invoicing standard and is the native XML format of the Peppol network.

Which rules is the output validated against?

The EN 16931 business rules, the European baseline that every UBL profile builds on. The invoice declares plain EN 16931, and it is only returned when it passes. As with all AI output, review the values before you send it.

Which countries require Peppol UBL invoicing?

Peppol UBL invoicing is mandatory for public sector B2G in Norway, Denmark, Sweden, Finland, Singapore, Australia, and New Zealand. The Netherlands, Belgium, and Italy are rapidly expanding Peppol adoption to B2B transactions.

How does UBL differ from CII?

Both UBL and CII are valid EN 16931 syntaxes. UBL is the format of Peppol BIS Billing, use it when transmitting over the Peppol network. CII is used by ZUGFeRD and Factur-X hybrid PDFs, which are more common in Germany and France.

How do I send the invoice over the Peppol network?

Peppol access points expect Peppol BIS Billing. Read the PDF with POST /v1/parse/json, review the values, and send the JSON to POST /v1/create/ubl: it creates a Peppol BIS Billing invoice by default and validates it against the Peppol rules. The EN 16931 UBL from this endpoint goes straight into ERP and accounting systems that import UBL.

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