Anatomy of a CII invoice¶
CII — UN/CEFACT's Cross Industry Invoice — is the second of the two XML
syntaxes that can carry an EN16931 invoice (the other is
UBL). It is the syntax embedded inside
Factur-X / ZUGFeRD hybrid PDF invoices, central
to France's and Germany's e-invoicing mandates. A CII invoice is a single XML
document rooted at
<rsm:CrossIndustryInvoice>.
This page walks the same small invoice as the UBL anatomy — identical parties, items and amounts — so you can read the two syntaxes side by side. The business terms are the same; only the elements differ.
Three namespaces¶
Where UBL splits leaves (cbc) from containers (cac), CII splits by role in
the standard, and you will see these prefixes everywhere:
| Prefix | Namespace ends in… | Holds |
|---|---|---|
rsm |
…CrossIndustryInvoice:100 |
the message structure — the root and its three top-level parts |
ram |
…ReusableAggregateBusinessInformationEntity:100 |
almost everything — both aggregates and leaf business fields |
udt |
…UnqualifiedDataType:100 |
low-level typed values — date strings, ID/amount wrappers |
The mental model is different from UBL's. CII does not distinguish leaf from
container by namespace — ram: is used for both ram:SellerTradeParty (a group)
and ram:Name (a value). What CII does impose instead is a strict three-part
spine, described next.
The three-part spine¶
Every CII invoice has exactly three children under the root, in this order:
flowchart TD
R["rsm:CrossIndustryInvoice"] --> C["rsm:ExchangedDocumentContext<br/>which rulebook applies"]
R --> D["rsm:ExchangedDocument<br/>header: number, type, date"]
R --> T["rsm:SupplyChainTradeTransaction<br/>everything else"]
T --> L["ram:IncludedSupplyChainTradeLineItem ×N<br/>the lines"]
T --> A["ram:ApplicableHeaderTradeAgreement<br/>seller, buyer, references"]
T --> DL["ram:ApplicableHeaderTradeDelivery<br/>where/when delivered"]
T --> S["ram:ApplicableHeaderTradeSettlement<br/>currency, tax, totals, payment"]
The last part, SupplyChainTradeTransaction, carries the lines first and then
three "Applicable…Trade…" blocks: Agreement (who, and on what terms),
Delivery (where the goods went), and Settlement (money — currency, VAT, and the
totals). Almost everything you look for lives in one of those three.
A complete invoice¶
- BT-24, Specification identifier — the same field as UBL's
cbc:CustomizationID, but reached via a much deeper path:ExchangedDocumentContext / GuidelineSpecifiedDocumentContextParameter / ID. This is the field rule BR-01 checks, and the abstract Schematron pattern binds its$BT-24parameter to exactly this path. ExchangedDocument— the document header.ram:IDis BT-1, the invoice number.- BT-3, Invoice type code —
380("commercial invoice"), the same UNCL1001 value as UBL. - BT-2, Issue date. Note the CII twist: the date is a child
udt:DateTimeStringwithformat="102", meaningCCYYMMDD— so20260620is 2026-06-20. The date format is a coded attribute, not the ISO text UBL uses. - BG-25, an invoice line. In CII the lines come first inside the transaction, before the header blocks — the reverse of UBL's order.
- BT-146, item net price — the unit price, inside the line's Agreement.
- BT-129, billed quantity with
unitCode="C62"(one/piece), inside the line's Delivery. - BT-131, line net amount —
2 × 10.90 = 21.80, inside the line's Settlement. Notice the line itself has the same three-part Agreement / Delivery / Settlement spine as the whole document. - BG-4 Seller and BG-7 Buyer, both inside
ApplicableHeaderTradeAgreement. The party shape (Name,PostalTradeAddress,CountryID) parallels UBL'scac:Party. ApplicableHeaderTradeDelivery— present but empty here. CII often requires the element even when there is nothing to say; the schema fixes the order and presence of these three blocks.ApplicableHeaderTradeSettlement— currency (BT-5), the tax breakdown, and the totals.- BG-23, a VAT breakdown group — one per category.
CategoryCodeS(standard), 25 %, on a basis of 21.80 → 5.45 tax. - BG-22, the document totals — the amounts rule BR-CO-10 and friends tie
together.
GrandTotalAmount27.25 = net 21.80 + VAT 5.45.
Business terms vs elements¶
EN16931 defines a syntax-neutral semantic model: numbered business terms (BT)
and business groups (BG). The CII binding maps those numbers to rsm:/ram:
elements — the same numbers UBL maps to cbc:/cac::
| EN16931 | Means | CII element (relative path) |
|---|---|---|
| BT-24 | Specification identifier | …ExchangedDocumentContext/…ContextParameter/ram:ID |
| BT-1 | Invoice number | rsm:ExchangedDocument/ram:ID |
| BT-2 | Issue date | …/ram:IssueDateTime/udt:DateTimeString |
| BT-3 | Invoice type code | rsm:ExchangedDocument/ram:TypeCode |
| BT-5 | Currency | …Settlement/ram:InvoiceCurrencyCode |
| BG-4 | Seller | …Agreement/ram:SellerTradeParty |
| BG-25 | Invoice line | ram:IncludedSupplyChainTradeLineItem |
| BT-131 | Line net amount | …LineMonetarySummation/ram:LineTotalAmount |
| BT-106 | Sum of line net amounts | …HeaderMonetarySummation/ram:LineTotalAmount |
The same model, a different syntax
Compare this table with the UBL one:
BT-1 is cbc:ID in UBL and rsm:ExchangedDocument/ram:ID in CII — the
business term is identical, only the binding differs. This is exactly why
EN16931's Schematron is written as one
abstract pattern bound twice —
one rulebook, two syntaxes.
Decoding the names¶
CII's element names are long and repetitive — SpecifiedTradeSettlementHeaderMonetarySummation
is not unusual. They look intimidating, but they are systematic: every name is
built from a small vocabulary of qualifier words, so once you learn the pieces the
names parse themselves.
Why the names are built this way¶
UN/CEFACT designs its vocabularies with CCTS — the Core Component Technical Specification. Every element is a Business Information Entity (BIE) whose name is mechanically composed as Object · Property · Representation. That is why the names are verbose and why the same concept keeps its full name everywhere it appears — there is no short alias. Three BIE kinds map directly onto what you see:
| CCTS kind | What it is | Example here |
|---|---|---|
| ABIE (aggregate) | a group of other entities | ram:SellerTradeParty |
| ASBIE (association) | a group that links to another aggregate | ram:ApplicableHeaderTradeAgreement |
| BBIE (basic) | a single typed value | ram:LineTotalAmount |
This is the deeper reason CII does not colour-code leaf vs container by namespace
the way UBL does with cbc/cac: the distinction is encoded in the name's
structure instead, and all three kinds share the ram: namespace.
The qualifier vocabulary¶
The recurring leading words are context qualifiers — they say how the thing is attached, and they are the main thing to learn:
| Word | Meaning | Seen in |
|---|---|---|
| Exchanged | belongs to the document being exchanged (the message) | ExchangedDocument, ExchangedDocumentContext |
| Included | a child contained in its parent | IncludedSupplyChainTradeLineItem (lines inside the transaction) |
| Specified | a concrete instance filled in for this document | SpecifiedTradeProduct, SpecifiedLineTradeAgreement |
| Applicable | a rule/context that applies to the parent | ApplicableHeaderTradeAgreement, ApplicableTradeTax |
| Associated | linked metadata about the parent | AssociatedDocumentLineDocument |
| Header vs Line | scope: whole-document vs one line | …HeaderMonetarySummation vs …LineMonetarySummation |
The Trade* family¶
Trade marks the business-of-trading domain. The nouns after it name the thing:
| Name | Is | EN16931 sense |
|---|---|---|
…SupplyChainTradeTransaction |
the whole trade | the body of the invoice |
…TradeParty |
a participant | seller / buyer (BG-4 / BG-7) |
…TradeAgreement |
the terms agreed | prices, references, order |
…TradeDelivery |
the movement of goods | where/when delivered |
…TradeSettlement |
the money | currency, tax, totals, payment |
…TradeProduct |
the item sold | the product (BG-31) |
…TradePrice |
a price | net/gross unit price |
…TradeTax |
a tax | a VAT breakdown line |
…MonetarySummation |
a totals block | summed amounts (a "summation") |
Why an invoice talks about the \"supply chain\"
SupplyChainTradeTransaction and IncludedSupplyChainTradeLineItem surprise
people: this is an invoice, what is the supply chain doing here? The answer is
that CII's vocabulary is not invoice-specific. It is one member of a family
of UN/CEFACT Cross Industry documents — Cross Industry Order, Despatch Advice,
Remittance Advice, and the Invoice — that all describe the same trade as it
moves along a supply chain, reusing one shared set of ram: components. So
SupplyChainTradeTransaction means "the trade transaction within a supply
chain", and a line is an IncludedSupplyChainTradeLineItem — a line in that
transaction. The name is generic on purpose: the same element does duty in an
order and a despatch advice, not just the invoice. (UBL, designed
invoice-first, simply calls it InvoiceLine.)
Read in those pieces, the scary names decompose cleanly. For example:
SpecifiedTradeSettlementHeaderMonetarySummation
= Specified (this document's) · Trade Settlement (the money side) ·
Header (document-level, not per-line) · Monetary Summation (a totals block)
→ "the document-level totals block" — i.e. UBL's cac:LegalMonetaryTotal.
udt vs qdt — the datatype layer¶
Both namespaces hold the low-level wrappers that carry a typed value plus its metadata attributes:
udt— Unqualified Data Type: the raw CCTS primitives.udt:DateTimeStringwith itsformatattribute (102=CCYYMMDD) is the one you meet constantly; amount and ID wrappers live here too.qdt— Qualified Data Type: audttype restricted for invoicing — e.g. a code list narrowed to the allowed values. You will not always seeqdtin a minimal invoice, but it appears in the schemas.
Don't memorise the names — parse them
You never need to recall SpecifiedLineTradeDelivery from scratch. Build it:
a line's (Line) delivery (TradeDelivery) as filled in here
(Specified). Every CII name yields to that decomposition.
UBL and CII, side by side¶
The two syntaxes carry the same four header fields completely differently:
| Field | UBL | CII |
|---|---|---|
| Invoice number | cbc:ID |
rsm:ExchangedDocument/ram:ID |
| Issue date | cbc:IssueDate (2026-06-20) |
udt:DateTimeString format="102" (20260620) |
| Currency | cbc:DocumentCurrencyCode |
ram:InvoiceCurrencyCode |
| Seller name | cac:…Party/cac:PartyName/cbc:Name |
ram:SellerTradeParty/ram:Name |
CII's paths are longer and more deeply nested (the line net amount sits five
elements deep), and it leans on a fixed structural spine rather than UBL's
cbc/cac colour-coding. Neither is "better"; receivers must accept both, which
is the whole reason EN16931 keeps the rules syntax-neutral.
Reading the invoice with XPath¶
Because it is just XML, every XPath technique applies — you
just bind the rsm/ram prefixes first. The totals rule BR-CO-10 — document line
total equals the sum of the lines — reads:
sum(//ram:IncludedSupplyChainTradeLineItem
/ram:SpecifiedLineTradeSettlement
/ram:SpecifiedTradeSettlementLineMonetarySummation/ram:LineTotalAmount)
= //ram:SpecifiedTradeSettlementHeaderMonetarySummation/ram:LineTotalAmount
And a human-readable summary is ordinary XSLT:
<xsl:value-of select="rsm:ExchangedDocument/ram:ID"/> —
<xsl:value-of select="//ram:BuyerTradeParty/ram:Name"/>:
<xsl:value-of select="//ram:DuePayableAmount"/>
<xsl:value-of select="//ram:InvoiceCurrencyCode"/>
INV-001 — Contoso Wholesale AB: 27.25 EUR
The output is identical to the UBL version — same invoice, same answer, different paths.
Next¶
To see this vocabulary stretched across a full, real document, continue to
A CII invoice in detail — the verbatim CEN EN16931
example (the same TOSL108 business case as the UBL walkthrough) taken apart block
by block. Or jump to The validation pipeline — the layered
checks every invoice runs through, regardless of whether it arrived as UBL or CII.