Key: co-dian-v2 Extensions to support the Colombian DIAN (Dirección de Impuestos y Aduanas Nacionales) specifications for electronic invoicing based on UBL 2.1.

Correction Definitions

Auto-generation of corrective invoices or credit and debit notes is supported. A reason is required in the reason field when submitting the correction options.

Invoice Types

The types of invoices that can be created with a preceding definition:
  • credit-note
  • debit-note

Stamp Keys

Stamp keys from the previous invoice that need to be referenced:
  • dian-cude

Extension Keys

One or all of the following extensions may be required as part of the correction options. See the Extensions section for possible values.
  • co-dian-credit-code
  • co-dian-debit-code

Extensions

DIAN Municipality Code

The municipality code as defined by the DIAN. Set the 5-digit code for the municipality where the issuer is located in both the supplier and customer:
"supplier": {
	"name": "EXAMPLE SUPPLIER S.A.S.",
	"tax_id": {
		"country": "CO",
		"code": "9014514812"
	},
	"ext": {
		"co-dian-municipality": "11001" // Bogotá, D.C.
	},
	// [...]
},
"customer": {
	"name": "EXAMPLE CUSTOMER S.A.S.",
	"tax_id": {
		"country": "CO",
		"code": "9014514805"
	},
	"ext": {
		"co-dian-municipality": "05001" // Medellín
	},
	// [...]
},

Credit Code

The DIAN correction code is required when issuing credit notes in Colombia and is not automatically assigned by GOBL. It must be be included inside the preceding document references. The extension will be offered as an option in the invoice correction process. Usage example:
"preceding": [
	{
		"uuid": "0190e063-7676-7000-8c58-2db7172a4e58",
		"type": "standard",
		"series": "SETT",
		"code": "1010006",
		"issue_date": "2024-07-23",
		"reason": "Reason",
		"stamps": [
			{
				"prv": "dian-cude",
				"val": "57601dd1ab69213ccf8cfd5894f2e9fbfe23643f3a24e2f2526a5bb88d058a0842fffcb339694b6704dc105a9d813327"
			}
		],
		"ext": {
			"co-dian-credit-code": "3"
		}
	}
],

Debit Code

The DIAN correction code is required when issuing debit notes in Colombia and is not automatically assigned by GOBL. The extension will be offered as an option in the invoice correction process.

Fiscal Responsibility Code

The fiscal responsibility code as defined by the DIAN for Colombian electronic invoicing. Maps to the UBL’s TaxLevelCode field. The DIAN requires that Colombian invoices specify the fiscal responsibilities of the supplier or customer using specific codes. If no value is provided, GOBL will automatically set R-99-PN as the default.
CodeDescription
O-13Gran contribuyente
O-15Autorretenedor
O-23Agente de retención IVA
O-47Régimen simple de tributación
R-99-PNNo aplica - Otros
For example:
"customer": {
	"name": "EXAMPLE CUSTOMER S.A.S.",
	"tax_id": {
		"country": "CO",
		"code": "9014514812"
	},
	"ext": {
		"co-dian-fiscal-responsibility": "O-13"
	}
}