GOBL ⬅️➡️ Danish OIOUBL 2.1
Danish OIOUBL 2.1 support for GOBL, for
invoices and credit notes exchanged over the NemHandel network. Invoice
Responses and Reminders are a planned follow-up, not yet implemented here.
Released under the Apache 2.0 LICENSE, Copyright 2026 Invopop S.L..

This module is two things: a GOBL tax addon (dk-oioubl-v2) carrying the OIOUBL
rules and extensions, and a converter in both directions built on
gobl.ubl's EN 16931 base.
ConvertInvoice(env) — GOBL → OIOUBL 2.1
Parse(data) / ParseInvoice(data) — OIOUBL 2.1 → GOBL
Both target the OIOUBL 2.1 profile, schematron v1.17.2.
The addon
dk-oioubl-v2 Requires the EN 16931 addon and layers OIOUBL on top:
- Tax categories — VAT is restricted to what OIOUBL's
taxcategoryid-1.1
codelist supports: standard-rated, zero-rated and reverse-charge. There is no
exempt category on the wire, so an exempt VAT key is rejected rather than
relabelled — state the supply as zero-rated instead. Excise and other non-VAT
duties are modelled as charges (as in EN 16931 / Peppol BIS), not tax
categories, and carry a SKAT duty code extension.
- Payment — the OIOUBL payment channel is derived from the payment means:
IBAN, DK:GIRO, DK:FIK, DK:BANK and DK:NEMKONTO. Each shape has its
own account rules (Giro's 7-8 digit account, FIK's 8-character creditor
account, the 4-digit registration number a domestic transfer needs), and
NemKonto rejects account details outright, since it resolves the payee's
registered account.
- Participants — parties are routed by their participant identifier, the
same URI Peppol uses: the scheme, the code naming the OIOUBL register and the
party's code (
iso6523-actorid-upis::0184:12345674 for a CVR, ::0198:DK12345674
for an SE number, ::0088:5798009883735 for a GLN). The prefix follows the
ICD rather than the XML: 0184 is the bare CVR, which the converter prefixes
with DK on the way out, while the DK of 0198 is part of the identifier.
Every register OIOUBL accepts has a code in this scheme, retired ones such as
DK:CPR (9901) and DK:VANS (9905) included, so an endpoint has one shape
and only this one. The earlier DK:CVR:12345674 spelling is still read, as are
the codes Peppol replaced when it re-coded a register. Precedence: a party
already addressed by a participant identifier keeps it as its one address,
whatever register it names; otherwise an inbox naming an OIOUBL register
becomes the endpoint; otherwise a Danish tax identity derives the CVR one.
Endpoints on other networks, such as mailto:, are kept alongside.
- Invoice / credit note — the document type must be an OIOUBL-supported code
(325/380/393, or 381 for a credit note), the customer must resolve to an
endpoint for NemHandel to route to, every line needs a VAT category and a
non-zero quantity, and ordering is required once any line carries an order
reference. The customer also needs a contact identifier, since OIOUBL
requires a
Contact with an ID on the customer: the first person's
identity code, or failing that the first email, which the OIOUBL contact
guideline recommends as the identifier.
Rules the OIOUBL schematron already enforces are generally left to it rather
than duplicated here; the addon aims at the paths a sender realistically hits.
The addon registers extensions, normalizers and validation rules into GOBL's
global registry, and lives in its own module so only projects handling Danish
documents take on its weight.
The UBL document structs and their XML mapping come from gobl.ubl, reused here
as type Invoice ubl.Invoice. There is no OIOUBL context in gobl.ubl — the
outbound converter asks it for a plain EN 16931 document
(ubl.WithContext(ubl.ContextEN16931)) and does the OIOUBL-specific shaping in
this module, so gobl.ubl stays free of anything Danish.
Usage
Import the addon for its side effects to register it, then declare the
dk-oioubl-v2 addon on a GOBL document:
import _ "github.com/invopop/gobl.dk.oioubl/addon"
$schema: "https://gobl.org/draft-0/bill/invoice"
$regime: "DK"
$addons:
- "dk-oioubl-v2"
supplier:
name: "Eksempel A/S"
tax_id:
country: "DK"
code: "12345674"
# endpoints may be omitted: the addon derives
# iso6523-actorid-upis::0184:12345674 from the tax identity.
See examples/ for complete invoice and credit note documents with
their calculated envelopes.