UBL to CII Converter API
Turn any UBL 2.1 invoice or credit note into a UN/CEFACT CII D16B document with one REST call. Every EN 16931 Business Term is mapped from UBL's flat cac:/cbc: components into the CII nested trade model, and the output is Schematron-validated before you receive it.
The typical use case: you receive Peppol BIS or plain EN 16931 UBL, but your downstream system, your archive, or your German and French trading partners speak CII, ZUGFeRD, or Factur-X. Instead of self-hosting a Java conversion library and tracking CEN artefact releases yourself, call one endpoint that is kept current for you.
curl -X POST https://api.invoicexml.com/v1/convert/ubl/to/cii \ -H "Authorization: Bearer YOUR_API_KEY" \ -F "[email protected]" \ -o invoice-cii.xml
<?xml version="1.0" encoding="UTF-8"?> <rsm:CrossIndustryInvoice xmlns:rsm="urn:un:unece:uncefact:data :standard:CrossIndustryInvoice:100"> <rsm:ExchangedDocumentContext> … </rsm:ExchangedDocumentContext> <rsm:ExchangedDocument> … </rsm:ExchangedDocument> <rsm:SupplyChainTradeTransaction> … </rsm:SupplyChainTradeTransaction> </rsm:CrossIndustryInvoice>
Convert a UBL invoice to CII now
This demo calls the same POST /v1/convert/ubl/to/cii endpoint your integration will use. Drop a UBL 2.1 XML file and the converted CII D16B document downloads immediately.
Drop a UBL 2.1 XML file to test the API
or browse files to upload
REST API demo · POST /v1/convert/ubl/to/cii · XML · Max 20 MB
Your file is processed in memory and deleted immediately. Nothing is stored.
What the UBL to CII conversion actually does
UBL and CII express the same EN 16931 semantic model in two very different XML shapes. The converter is a full semantic mapping, not an XSLT find-and-replace.
Flat components to nested trade model
UBL organises data in flat cac:/cbc: components (AccountingSupplierParty, InvoiceLine, TaxTotal). CII nests everything inside SupplyChainTradeTransaction with separate agreement, delivery, and settlement branches. Each Business Term is relocated to its correct CII position, including the ones whose grouping differs between the two syntaxes.
Invoice and credit note normalisation
UBL uses two root elements, Invoice and CreditNote, with diverging element names. CII expresses both through one CrossIndustryInvoice root and a type code (BT-3). The converter accepts either UBL document type and produces the correct CII type coding automatically.
Every EN 16931 Business Term preserved
Parties, VAT breakdowns, payment means, allowances and charges, line-level data, attachments (BG-24): the complete Business Term catalogue is mapped. Nothing is dropped, summarised, or approximated, so document totals reconcile identically on both sides.
Schematron-validated output
Before the CII document leaves the API it is validated against the EN 16931 business rules. A source document that cannot produce a compliant result returns HTTP 400 with structured findings, so an invalid file never enters your downstream pipeline silently.
Where UBL to CII fits in your pipeline
Peppol in, ZUGFeRD out
You receive Peppol BIS Billing 3.0 (UBL) from the network, but your German customers or your archive expect ZUGFeRD or Factur-X hybrids. Convert the UBL to CII here, then embed it with POST /v1/embed/zugferd, or produce the finished PDF in one call with /v1/convert/ubl/to/zugferd.
CII-only consumers
Many ERP integrations, tax platforms, and legacy EDI bridges accept only the UN/CEFACT CII syntax. A conversion step in front of the intake queue lets you accept UBL from any sender without touching the consumer side.
Retire the self-hosted converter
Teams commonly run an open-source UBL-to-CII Java library in a container just for this one transformation. The API replaces the runtime, the artefact tracking, and the re-testing on every EN 16931 release with a single authenticated HTTP call.
One request, one converted document
Send the UBL file as multipart/form-data. The response body is the converted CII XML, ready to save or forward.
$ curl -X POST https://api.invoicexml.com/v1/convert/ubl/to/cii \ -H "Authorization: Bearer YOUR_API_KEY" \ -F "[email protected]" \ -o invoice-cii.xml
On success you receive the CII document with Content-Type application/xml. On a validation failure you receive HTTP 400 with structured, human-readable findings.
Complete CII Toolkit
Everything you need to create, convert, validate, and preview CII invoices, via REST API or online.
Frequently Asked Questions
Why would I convert UBL to CII instead of using a library?
Open-source converters like the en16931-ubl2cii Java library work, but you own the hosting, the version tracking, and the re-testing whenever CEN updates the EN 16931 artefacts. The API is one HTTP call: you send UBL 2.1, you get validated CII D16B back, and the mapping tables are kept current server-side. No Java runtime, no dependency upgrades, no redeploys.
Is any invoice data lost in the conversion?
No. UBL and CII are two syntax bindings of the same EN 16931 semantic model. The conversion maps every Business Term (BT) present in your UBL document to its CII location. Only the XML syntax changes; the semantic content is preserved one to one.
Can I feed the CII output into ZUGFeRD or Factur-X?
Yes, that is the most common pipeline. The generated CII D16B is structurally identical to the XML embedded in ZUGFeRD 2.x and Factur-X files. Pass it to POST /v1/embed/zugferd or /v1/embed/facturx together with your PDF to get the hybrid PDF/A-3, or use /v1/convert/ubl/to/zugferd to do both steps in one call.
Does the endpoint accept Peppol BIS Billing 3.0 invoices?
Yes. Peppol BIS Billing 3.0 documents are UBL 2.1 invoices conforming to EN 16931, so they convert cleanly. Both Invoice and CreditNote root elements are supported.
Is the output validated before I receive it?
Yes. The generated CII document is validated against the EN 16931 Schematron business rules before delivery. If the source document carries a rule violation that survives the mapping, the API returns HTTP 400 with the specific findings instead of shipping you a broken file.
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.