Skip to main content
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.

Invoice Series & Code

Invoices (“Facturas de Venta”) as expected in many countries require a series and unique sequential code to be issued for each document. The DIAN in Colombia however have gone a step further and require invoice series to be pre-registered with the government. Details on how to do this are available here.

Municipality codes

The DIAN requires that Colombian addresses in the invoice specify its municipality code. The list of municipality codes is available here. In a GOBL invoice, you can provide the supplier’s or customer’s municipality code using the co-dian-municipality extension. For example:
"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
	},
	// [...]
},

Customer identities

While the DIAN requires suppliers of invoices to identify themselves using their NIT, in the case of customers, it allows various identification types. Each identification type has a specific code that must be sent to the DIAN.

B2B

In a GOBL invoice, Colombian business customers are required to provide a Tax ID with the company’s NIT to be reported with the 31 (NIT) DIAN ID type. Foreign business customers must also provide a Tax ID with their country’s VAT code, and that will be reported to the DIAN using the 50 (NIT de otro país) type. For example:
"customer": {
	"name": "EXAMPLE CUSTOMER S.A.S.",
	"tax_id": {
		"country": "CO",
		"code": "9014514805" // NIT. DIAN type 31
	},
	"ext": {
		"co-dian-municipality": "11001"
	},
	"addresses": [
		{
			"street": "CRA 8 113 31 OF 703",
			"locality": "Bogotá, D.C.",
			"region": "Bogotá",
			"country": "CO"
		}
	]
}

B2C

In the case of non-business customers, the GOBL invoice will need to include the tax tag simplified. That will allow to omit the customer or identify it with any of the other document types accepted by the DIAN. They’ll just need to include an Identity object with any of the keys below:
GOBL Identity KeyDIAN ID typeDescription
co-civil-register11Registro civil
co-id-card12Tarjeta de identidad
co-citizen-id13Cédula de ciudadanía
co-foreigner-id-card21Tarjeta de extranjería
co-foreigner-id22Cédula de extranjería
co-passport41Pasaporte
co-foreign-id42Documento de identificación extranjero
co-pep47PEP (Permiso Especial de Permanencia)
co-nuip91NUIP
For example:
"tax": {
	"tags": ["simplified"]
},
"customer": {
	"name": "Ángel Pérez",
	"identities": [
		{
			"key": "co-passport", // DIAN type 41
			"code": "1234567890"
		}
	]
}
Note that GOBL simplified invoices don’t require a customer (or its identity) to be present. In the lack of a customer identity, the reserved code for final consumers (222222222222) will be automatically sent to the DIAN (i.e., no need to set it explicitly) For example:
"tax": {
	"tags": ["simplified"]
},
"customer": { // The customer could be fully omitted as well
	"name": "Juan Fernández"
}

Credit and debit correction codes

The DIAN requires credit and debit notes sent to them to specify a code with a cause of the correction. In a GOBL invoice, you’ll need to include the extension co-dian-credit-code (for credit notes) or co-dian-debit-code (for debit notes) as part of the Preceding section of the document. Each extension allows a different set of values: co-dian-credit-code
CodeDescription
1Partial refund
2Revoked
3Discount
4Adjustment
5Other
co-dian-debit-code
CodeDescription
1Interest
2Pending charges
3Change in value
4Other
For 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-debit-code": "3"
		}
	}
],

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
	},
	// [...]
},
Pattern: ^\d$

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"
		}
	}
],
CodeName
1Partial refund
2Revoked
3Discount
4Adjustment
5Other

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.
CodeName
1Interest
2Pending charges
3Change in value
4Other

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"
	}
}
CodeName
O-13Major taxpayer
O-15Self-withholder
O-23VAT withholding agent
O-47Simple tax regime
R-99-PNNot applicable – Others