How to Read a UBL Invoice XML: Element-by-Element Guide
How to read a UBL 2.1 invoice XML: what cbc and cac mean, where to find the invoice number, parties, VAT IDs, IBAN, VAT breakdown, totals and lines, and how to check that the numbers add up.
Use this guide with
4 ToolsWebPro tools
Open the free tool(s) below and follow the steps in this guide.
Quick answer: how to read a UBL invoice
The quickest way is to drop the file into a UBL Invoice Viewer, which lays it out like a normal invoice. If you want to read the XML itself, start at the top: the header elements (cbc:ID, cbc:IssueDate, cbc:DocumentCurrencyCode) tell you which invoice it is, the two party blocks tell you who sent it to whom, and cac:LegalMonetaryTotal near the end tells you what to pay.
Direct answer: cbc = a single value, cac = a group of values. Read ID and dates first, then AccountingSupplierParty and AccountingCustomerParty, then TaxTotal, LegalMonetaryTotal and the InvoiceLine elements.
Open the tool:
cbc and cac: the two prefixes
UBL uses XML namespaces. Elements with the cbc: prefix (Common Basic Components) hold one value, such as <cbc:IssueDate>2026-02-15</cbc:IssueDate>. Elements with cac: (Common Aggregate Components) are containers, such as <cac:PostalAddress>, which hold other elements. Amounts carry their currency as an attribute: <cbc:PayableAmount currencyID="EUR">2420.00</cbc:PayableAmount>.
Walking through a UBL invoice from top to bottom
- CustomizationID and ProfileID: which rule set applies, e.g. Peppol BIS Billing 3.0.
- cbc:ID, cbc:IssueDate, cbc:DueDate: invoice number and dates.
- cbc:InvoiceTypeCode: 380 for an invoice. Credit notes use a CreditNote root with code 381.
- cbc:DocumentCurrencyCode and cbc:BuyerReference: currency and the buyer's reference.
- cac:AccountingSupplierParty / cac:AccountingCustomerParty: cbc:EndpointID (Peppol ID), cac:PartyName, cac:PostalAddress, cac:PartyTaxScheme/cbc:CompanyID (VAT ID), cac:PartyLegalEntity/cbc:RegistrationName (legal name).
- cac:PaymentMeans: code 58 = SEPA credit transfer, cbc:PaymentID = payment reference, cac:PayeeFinancialAccount/cbc:ID = IBAN.
- cac:TaxTotal: total VAT, then one cac:TaxSubtotal per VAT rate with taxable amount, VAT amount and category (S = standard rate).
- cac:LegalMonetaryTotal: LineExtensionAmount (sum of lines), TaxExclusiveAmount (net), TaxInclusiveAmount (gross), PayableAmount (to pay).
- cac:InvoiceLine: per line cbc:InvoicedQuantity with unitCode (HUR = hour, C62 = piece), cbc:LineExtensionAmount, cac:Item/cbc:Name and cac:Price/cbc:PriceAmount.
Check that the numbers add up
In a correct invoice, the line amounts add up to LineExtensionAmount, TaxExclusiveAmount plus the VAT total equals TaxInclusiveAmount, and TaxInclusiveAmount minus any PrepaidAmount equals PayableAmount. The PEPPOL Invoice Validator does these sums for you and shows which rule fails.
Practice on a real file: download the sample Peppol BIS 3.0 invoice, open it in a text editor next to the UBL Invoice Viewer, and match each value on the invoice to its element.
Frequently asked questions
What do cbc and cac mean in UBL?
cbc stands for Common Basic Components (single values such as a date), cac for Common Aggregate Components (groups such as an address).
Where is the amount to pay in a UBL invoice?
In cac:LegalMonetaryTotal/cbc:PayableAmount, with the currency in the currencyID attribute.
Where is the seller's VAT number?
In cac:AccountingSupplierParty/cac:Party/cac:PartyTaxScheme/cbc:CompanyID.
See your UBL file as an invoice
Open the XML in the UBL Invoice Viewer and switch to Raw XML to match each value to its element.
Muhammad Saqlain
Cybersecurity Practitioner & Lead EngineerSecurity researcher, web developer, and founder of ToolsWebPro. Tests password entropy, GPU cracking speeds, and client-side encryption systems.
Read full author bio & credentials →Related ToolsWebPro tools
Open the free tool(s) for this guide — no signup required.
- UBL Invoice ViewerRead UBL 2.1 Invoice and CreditNote XML (incl. Peppol BIS 3.0) as a normal invoice, with the raw XML alongside. Free, no upload.
- Peppol Invoice Pre-CheckSpot a selection of missing fields and arithmetic issues before running full invoice validation in your receiving or access-point system.
- Peppol Invoice ViewerOpen supported structured invoice XML, inspect the seller, buyer, line items and totals, then export a readable copy or spreadsheet.
- PEPPOL XML to PDFConvert Peppol BIS 3.0, UBL or XRechnung XML invoices to a clean A4 PDF in your browser. EN, DE, NL or FR labels. No upload.
More from ToolsWebPro