Help us shape the future of Go! Take the 2026 Go Developer Survey

dian

package module
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 17, 2026 License: AGPL-3.0 Imports: 0 Imported by: 0

README

GOBL ➡️ Colombia DIAN

Colombia DIAN (Dirección de Impuestos y Aduanas Nacionales) e-invoicing addon for GOBL.

Copyright Invopop S.L. 2026. Released publicly under the GNU Affero General Public License v3.0. For commercial licenses please contact the dev team at invopop.

Lint Test Go Go Report Card codecov GoDoc Latest Tag

This module implements the Colombia DIAN e-invoicing requirements as a GOBL tax addon (co-dian-v2), based on UBL 2.1 and the DIAN "Anexo Técnico de la Factura Electrónica de Venta". It covers sales invoices, credit notes, and debit notes, with validation rules registered under the CO-DIAN namespace.

The addon lives in the addon/ subpackage and registers into GOBL's global registry on import; the module root is reserved for future DIAN tooling. The Colombian tax regime (regimes/co) stays in GOBL core.

Usage

Add a blank import of the addon, then declare it on documents:

import (
	_ "github.com/invopop/gobl.co.dian/addon"
)
{
	"$schema": "https://gobl.org/draft-0/bill/invoice",
	"$regime": "CO",
	"$addons": ["co-dian-v2"]
}

Note: co-dian-v2 is an approved external addon key in GOBL core, but documents declaring it fail validation unless this module is imported.

Extensions

Key Description
co-dian-municipality DANE municipality code for party addresses. Required for Colombian parties.
co-dian-fiscal-responsibility Party fiscal responsibility (TaxLevelCode). Required; defaults to R-99-PN.
co-dian-tax-scheme Party tributo (PartyTaxScheme/TaxScheme): 01, 04, ZA, ZZ. Optional.
co-dian-item-identification Product-coding standard for line item codes. Optional.
co-dian-credit-code Correction concept, required on credit note preceding references.
co-dian-debit-code Correction concept, required on debit note preceding references.

Simplified (B2C) customers may be identified with DIAN document types via org.Identity keys (co-citizen-id, co-passport, …), and corrections via GOBL's Correct process copy the dian-cude stamp onto the preceding reference.

Development

The go.mod pins github.com/invopop/gobl to a branch pseudo-version until the external-addon registration ships in a tagged release.

examples/ holds sample documents with golden envelopes under examples/out/; regenerate them with:

go test . -run TestExamples -update

Sources

Documentation

Overview

Package dian is the root of the Colombia DIAN module for GOBL. The GOBL addon itself lives in the addon subpackage; this root package is reserved for converters and other DIAN tooling built on top of the addon.

Directories

Path Synopsis
Package dian provides the DIAN UBL 2.1 extensions used in Colombia.
Package dian provides the DIAN UBL 2.1 extensions used in Colombia.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL