Syntax
UBL (Universal Business Language)
Definition
UBL (Universal Business Language) is an OASIS-standardised XML vocabulary for business documents, including invoices, orders, and delivery notes. UBL 2.1 is one of the two permitted syntaxes for EN 16931-compliant invoices and is used for XRechnung as well as Peppol BIS Billing 3.0, among others. UBL invoices use the namespace `urn:oasis:names:specification:ubl:schema:xsd:Invoice-2`.
Background & context
UBL (Universal Business Language) is an open set of XML schemas for electronic business documents, standardised by OASIS. Beyond the invoice, UBL covers over 80 document types such as Order, DespatchAdvice, CreditNote, and reminders. UBL separates components into two building-block libraries: CBC (Common Basic Components, simple values such as cbc:ID or cbc:IssueDate) and CAC (Common Aggregate Components, composite structures such as cac:AccountingSupplierParty). A UBL invoice begins with the root element `<Invoice>` in the namespace `urn:oasis:names:specification:ubl:schema:xsd:Invoice-2`; a credit note with `<CreditNote>`. UBL 2.1 is one of the two syntaxes permitted by EN 16931 and forms the technical basis of XRechnung as well as Peppol BIS Billing 3.0. Anyone generating XRechnung in UBL format therefore maps the syntax-independent Business Terms (e.g. BT-1 invoice number) to concrete UBL elements (cbc:ID).
In practice — a worked example
The invoice number (Business Term BT-1) is mapped in UBL as `<cbc:ID>RE-2024-00123</cbc:ID>` directly under the root element, and the invoice date (BT-2) as `<cbc:IssueDate>2024-07-15</cbc:IssueDate>`. The seller (BG-4) sits in `<cac:AccountingSupplierParty>` with nested elements for name (cbc:RegistrationName), address (cac:PostalAddress) and tax registration (cac:PartyTaxScheme). It is exactly this structure that the KoSIT validator checks against the UBL 2.1 XSD and then against the EN 16931 and BR-DE Schematron rules.
Common mistakes
- •Do not confuse CBC and CAC: simple values belong in cbc elements, composite structures in cac elements — wrong namespaces break schema validation.
- •For credit notes the root element `<CreditNote>` with its own namespace must be used, not `<Invoice>` with type code 381.
- •UBL and CII must never be mixed in the same document — this leads to SCHEMA-002 errors.
Frequently asked questions
What do cbc and cac mean in UBL?
cbc stands for Common Basic Components (simple data fields such as IDs, dates, amounts), cac for Common Aggregate Components (composite structures such as parties, addresses, tax groups). They are the two central UBL namespaces.
Is UBL better than CII?
Neither syntax is superior — EN 16931 treats them as equivalent. UBL is more common in the B2G and Peppol environment, while CII forms the basis of ZUGFeRD/Factur-X. The choice depends on recipient and software.
Which namespace does a UBL invoice use?
A UBL invoice uses urn:oasis:names:specification:ubl:schema:xsd:Invoice-2, and a credit note the corresponding CreditNote-2 namespace. A wrong or missing namespace causes error SCHEMA-002.