Skip to content

How to convert XRechnung to ZUGFeRD (and UBL to CII) without losing data

Convert an XRechnung into a ZUGFeRD / Factur-X PDF, UBL into CII or EN 16931 into Peppol BIS. Which conversions are possible, what can be lost and how to check the result.

Updated November 23, 20263 min read

You convert an XRechnung into ZUGFeRD by writing its EN 16931 data as CII, embedding that XML in a PDF/A-3 with a readable invoice page, and validating the result with the Factur-X rules. Done by hand that is three tools and a lot of detail. Over the API it is one call:

curl -s "https://einvoiceengine.com/v1/invoices/convert?target=zugferd-facturx" \
  -H "Authorization: Bearer $EINV_KEY" -H "Content-Type: application/xml" \
  --data-binary @xrechnung.xml

The response holds the PDF in base64, the profile it was written in and the validation of the new file.

Which conversions are possible?

From To
XRechnung 3.0 UBL or CII XRechnung in the other syntax, Peppol BIS Billing 3.0, ZUGFeRD / Factur-X PDF, Facturae 3.2.2, KSeF FA(3)
EN 16931 UBL or CII the other syntax, Peppol BIS Billing 3.0, ZUGFeRD / Factur-X PDF, Facturae 3.2.2, KSeF FA(3)
Peppol BIS Billing 3.0 EN 16931 CII, Facturae 3.2.2, KSeF FA(3)
ZUGFeRD / Factur-X (BASIC, EN 16931, EXTENDED) EN 16931 UBL
Facturae 3.2.x, KSeF FA(3) EN 16931 UBL or CII

ZUGFeRD MINIMUM and BASIC WL have no invoice lines and cannot be converted into a complete invoice.

Which ZUGFeRD profile do I get?

The profile follows the source: an XRechnung becomes the profile XRECHNUNG, any other EN 16931 invoice the profile EN 16931. Pass profile=EN 16931, XRECHNUNG or EXTENDED to choose. The PDF is PDF/A-3b with embedded fonts and the Factur-X metadata, and the embedded file is named factur-x.xml.

Can a conversion lose data?

Yes, when the target format has no place for a value. Examples:

  • XRechnung extension elements, such as sub-lines, have no place in plain EN 16931 or Peppol;
  • CII holds only one preceding invoice reference, UBL several;
  • Facturae has no field for many EN 16931 terms, such as electronic addresses.

A safe conversion never drops data silently. The service checks for such values before writing and fails with 422 semantic_loss, listing each field. After writing, it reads the result again and compares it field by field with the source. You can accept a listed loss with allowDataLoss=true; the loss is then named in dataLoss. Details in conversion.

How do I check a converted invoice?

Two checks answer two questions:

  1. Is the new file valid? It is validated with the official rules of the target before it is returned.
  2. Does it say the same thing? POST /v1/invoices/compare compares the source and the result field by field in the EN 16931 model and marks every difference in amounts, tax data and identifiers. Comparing is not billed.

Frequently asked questions

Can I convert a PDF invoice without XML into ZUGFeRD?

Not by conversion: a plain PDF has no structured data. Create the e-invoice from your invoice data instead — see is a PDF an e-invoice.

Can I convert ZUGFeRD back into XRechnung?

ZUGFeRD converts into EN 16931 UBL. Whether that is also a valid XRechnung depends on the German fields such as the buyer reference; validate the result against XRechnung to see.

Is the converted invoice a new invoice?

It is the same invoice in another format, with the same number and amounts. Send only one of the two versions to the customer.

Does converting count as a document?

Yes, one conversion counts as one document; comparing the result does not. See pricing.

Check your invoice against the official rules

Upload an XML or PDF invoice. You get every failing rule with an explanation, the fix and the line in the file. Free, without sign-up; the check on this page stores nothing.

Drop an invoice hereXRechnung, EN 16931 or Peppol (UBL / CII), a ZUGFeRD / Factur-X PDF, Facturae or KSeF FA(3). Up to 2 MB.
No invoice at hand?

Processed in memory and not stored. No sign-up needed.