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.

Related terms

CII (UN/CEFACT Cross Industry Invoice)CII stands for Cross Industry Invoice and is the UN/CEFACT XML document format for invoices. It is one of the two syntaxes permitted by EN 16931 alongside UBL and forms the basis of ZUGFeRD and Factur-X. CII documents use the namespace `urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100`.EN 16931EN 16931 is the European standard that defines the semantic data model of a core invoice. It specifies the mandatory and optional fields (Business Terms), their meaning, and the validation rules that apply to all conforming electronic invoices in the EU. Nationally implemented standards such as XRechnung, ZUGFeRD (EN 16931 profile), and Factur-X must comply with this standard.XRechnungXRechnung is the German standard for structured electronic invoices in public sector procurement (B2G). It is based on the European standard EN 16931 and is available in two syntaxes: UBL 2.1 and UN/CEFACT CII. Since 27 November 2020, federal public buyers have been required to accept electronic invoices in XRechnung format, and state and municipal authorities have been progressively included.PeppolPeppol (Pan-European Public Procurement On-Line) is an international network and infrastructure for the secure electronic exchange of business documents, especially invoices and orders. It is based on a four-corner model with Access Points, a central directory (SMP/SML), and standardised document formats (e.g., Peppol BIS Billing 3.0 based on UBL). In Germany, KoSIT operates the Peppol directory.SchematronSchematron is a rule-based validation language for XML documents, based on XPath expressions. In the context of XRechnung and EN 16931, Schematron rules are used to perform content-level plausibility checks that go beyond pure schema validation (XSD). The official Schematron rules for XRechnung are maintained by KoSIT and are part of the open-source Validator.