This page provides a comprehensive comparison of all supported e-invoicing standards in the gobl.cii package. Each standard is implemented as a Context struct that defines the guideline identifiers, business process parameters, CII schema versions, required GOBL addons, and validation specifications used during conversion.
For detailed implementation guides for individual standards, see:
The gobl.cii package defines eight predefined contexts, each representing a specific e-invoicing standard or profile. These contexts are implemented as Context structs in cii.go54-61 and control how GOBL invoices are converted to CII XML documents.
| Context | GuidelineID | BusinessID | Version | VESID | Addons |
|---|---|---|---|---|---|
ContextEN16931V2017 | urn:cen.eu:en16931:2017 | (none) | D16B | eu.cen.en16931:cii:1.3.13 | eu-en16931-v2017 |
ContextPeppolV3 | urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0 | urn:fdc:peppol.eu:2017:poacc:billing:01:1.0 | D16B | eu.cen.en16931:cii:1.3.13 | eu-en16931-v2017 |
ContextXRechnungV3 | urn:cen.eu:en16931:2017#compliant#urn:xeinkauf.de:kosit:xrechnung_3.0 | urn:fdc:peppol.eu:2017:poacc:billing:01:1.0 | D16B | de.xrechnung:cii:3.0.2 | de-xrechnung-v3 |
ContextZUGFeRDV2 | urn:cen.eu:en16931:2017 | (none) | D16B | de.zugferd:en16931:2.4 | de-zugferd-v2 |
ContextFacturXV1 | urn:cen.eu:en16931:2017 | (none) | D22B | fr.factur-x:en16931:1.0.8 | fr-facturx-v1 |
ContextChorusProV1 | A1 | (none) | D16B | (none) | fr-choruspro-v1 |
ContextPeppolFranceFacturXV1 | urn:cen.eu:en16931:2017#conformant#urn:peppol:france:billing:Factur-X:1.0 | urn:peppol:france:billing:regulated | D16B | fr.factur-x:en16931:1.0.8 | fr-ctc-flow2-v1 |
ContextPeppolFranceCIUSV1 | urn:cen.eu:en16931:2017#compliant#urn:peppol:france:billing:cius:1.0 | urn:peppol:france:billing:regulated | D22B | eu.cen.en16931:cii:1.3.13 | fr-ctc-flow2-v1 |
Sources: cii.go64-137
The following diagram illustrates how the various contexts relate to each other and to the base EN16931 standard:
Sources: cii.go64-137
This diagram maps each context to its implementation details and the XML structures it generates:
Sources: cii.go1-19 cii.go64-137
The CII schema version is a critical differentiator between contexts. Only two contexts use the newer D22B schema version, while the majority use D16B.
| Version | Contexts Using This Version | Schema Namespace |
|---|---|---|
| D16B | EN16931, Peppol, XRechnung, ZUGFeRD, Chorus Pro, Peppol France Factur-X | urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100 |
| D22B | Factur-X, Peppol France CIUS | urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100 |
Key Differences:
Sources: cii.go46-49
The GuidelineID field encodes compliance information in URN format. Several distinct patterns emerge:
urn:cen.eu:en16931:2017
Used by: ContextEN16931V2017, ContextFacturXV1, ContextZUGFeRDV2
urn:cen.eu:en16931:2017#compliant#<extension>
Used by:
ContextPeppolV3: #compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0ContextXRechnungV3: #compliant#urn:xeinkauf.de:kosit:xrechnung_3.0ContextPeppolFranceCIUSV1: #compliant#urn:peppol:france:billing:cius:1.0urn:cen.eu:en16931:2017#conformant#<extension>
Used by:
ContextPeppolFranceFacturXV1: #conformant#urn:peppol:france:billing:Factur-X:1.0A1, A2, etc.
Used by: ContextChorusProV1 (special case for French public procurement)
Sources: cii.go64-129
The BusinessID field specifies the business process context. Only four contexts use this field:
| Context | BusinessID | Purpose |
|---|---|---|
ContextPeppolV3 | urn:fdc:peppol.eu:2017:poacc:billing:01:1.0 | Peppol BIS Billing 3.0 process |
ContextXRechnungV3 | urn:fdc:peppol.eu:2017:poacc:billing:01:1.0 | XRechnung uses Peppol business process |
ContextPeppolFranceFacturXV1 | urn:peppol:france:billing:regulated | French regulated Peppol network |
ContextPeppolFranceCIUSV1 | urn:peppol:france:billing:regulated | French regulated Peppol network |
Contexts without BusinessID:
ContextEN16931V2017ContextFacturXV1ContextZUGFeRDV2ContextChorusProV1This results in different XML output structures:
Sources: cii.go40-43 test/data/convert/peppol/out/invoice-complete.xml3-10 test/data/convert/en16931/out/invoice-complete.xml3-7
The VESID (Validation Exchange Specification ID) field enables external validation via the Phive service. Each context specifies a unique VESID that corresponds to a specific validation ruleset:
| Context | VESID | Validation Ruleset |
|---|---|---|
ContextEN16931V2017 | eu.cen.en16931:cii:1.3.13 | EN 16931 CII 1.3.13 |
ContextPeppolV3 | eu.cen.en16931:cii:1.3.13 | EN 16931 CII 1.3.13 (same as base) |
ContextXRechnungV3 | de.xrechnung:cii:3.0.2 | XRechnung CII 3.0.2 |
ContextZUGFeRDV2 | de.zugferd:en16931:2.4 | ZUGFeRD EN 16931 2.4 |
ContextFacturXV1 | fr.factur-x:en16931:1.0.8 | Factur-X EN 16931 1.0.8 |
ContextChorusProV1 | (none) | No external validation |
ContextPeppolFranceFacturXV1 | fr.factur-x:en16931:1.0.8 | Factur-X EN 16931 1.0.8 |
ContextPeppolFranceCIUSV1 | eu.cen.en16931:cii:1.3.13 | EN 16931 CII 1.3.13 |
Note: Chorus Pro does not specify a VESID as it uses internal French government validation systems rather than Phive.
Sources: cii.go59 cii.go64-129
Each context requires specific GOBL addons to be present in the source invoice. The conversion process validates addon presence at cii.go213-218:
Sources: cii.go11-16 cii.go67 cii.go76 cii.go84 cii.go94 cii.go102 cii.go110 cii.go119 cii.go127
The Context is selected during conversion using the WithContext option. If no context is specified, the system defaults to ContextEN16931V2017 cii.go205
Sources: cii.go201-244 cii_test.go15-56
When parsing CII XML documents back to GOBL, the system uses the FindContext function cii.go141-152 to reverse-lookup the context based on the GuidelineID and optional BusinessID found in the XML.
The lookup algorithm:
GuidelineID from ExchangedDocumentContext/GuidelineContext/IDBusinessID from ExchangedDocumentContext/BusinessContext/IDGuidelineID firstBusinessID, ensure it matches the document's BusinessIDnil if not foundSources: cii.go131-152
Two profile ID constants are defined for reuse across contexts:
| Constant | Value | Used By |
|---|---|---|
ProfileIDPeppolBilling | urn:fdc:peppol.eu:2017:poacc:billing:01:1.0 | Peppol, XRechnung |
ProfileIDPeppolFranceBilling | urn:peppol:france:billing:regulated | Peppol France variants |
These constants are defined at cii.go40-43 and referenced in the relevant context definitions.
Sources: cii.go40-43 cii.go74 cii.go91 cii.go100 cii.go118
| Aspect | Variation | Contexts |
|---|---|---|
| CII Version | D16B | EN16931, Peppol, XRechnung, ZUGFeRD, Chorus Pro, Peppol France Factur-X |
| D22B | Factur-X, Peppol France CIUS | |
| Business Process | Peppol Billing | Peppol, XRechnung |
| Peppol France | Peppol France variants | |
| None | EN16931, Factur-X, ZUGFeRD, Chorus Pro | |
| GuidelineID Pattern | Base | EN16931, Factur-X, ZUGFeRD |
| #compliant# | Peppol, XRechnung, Peppol France CIUS | |
| #conformant# | Peppol France Factur-X | |
| Framework code | Chorus Pro | |
| Validation | Phive VESID | All except Chorus Pro |
| None | Chorus Pro | |
| Geographic Focus | European | EN16931, Peppol |
| German | XRechnung, ZUGFeRD | |
| French | Factur-X, Chorus Pro, Peppol France variants | |
| Pan-European | Peppol |
Sources: cii.go54-137
Refresh this wiki