AI PDF to UBL API
Convert a PDF invoice into an EN 16931 UBL XML document for European and global e-invoicing.
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
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.
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:
- Upload it to our online UBL preview.
- Or use our API: render it as a PDF with POST /v1/render/xml/to/pdf.
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.
Runnable UBL integration samples in C#, Java, PHP, Python, Node.js, and browser JavaScript, ready to clone and adapt.
InvoiceXML/ubl-api-examples
Run this endpoint on your own file or data straight from your browser, no code and no sign-up required.
www.invoicexml.com/api/transform/ubl
The full OpenAPI 3.1 document. Drop it into Postman, Insomnia, or any code generator to scaffold a client.
api.invoicexml.com/v1/openapi
Browse and call every endpoint directly from the browser, powered by Scalar.
api.invoicexml.com/v1/scalar
Frequently Asked Questions
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.