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 theco-dian-municipality extension. For example:
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 the31 (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:
B2C
In the case of non-business customers, the GOBL invoice will need to include the tax tagsimplified. 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 Key | DIAN ID type | Description |
|---|---|---|
co-civil-register | 11 | Registro civil |
co-id-card | 12 | Tarjeta de identidad |
co-citizen-id | 13 | Cédula de ciudadanía |
co-foreigner-id-card | 21 | Tarjeta de extranjería |
co-foreigner-id | 22 | Cédula de extranjería |
co-passport | 41 | Pasaporte |
co-foreign-id | 42 | Documento de identificación extranjero |
co-pep | 47 | PEP (Permiso Especial de Permanencia) |
co-nuip | 91 | NUIP |
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:
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 extensionco-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
| Code | Description |
|---|---|
| 1 | Partial refund |
| 2 | Revoked |
| 3 | Discount |
| 4 | Adjustment |
| 5 | Other |
co-dian-debit-code
| Code | Description |
|---|---|
| 1 | Interest |
| 2 | Pending charges |
| 3 | Change in value |
| 4 | Other |
Correction Definitions
Auto-generation of corrective invoices or credit and debit notes is supported. A reason is required in thereason 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:co-dian-municipality
co-dian-municipality
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 thepreceding document references.
The extension will be offered as an option in the invoice correction process.
Usage example:
co-dian-credit-code
co-dian-credit-code
| Code | Name |
|---|---|
1 | Partial refund |
2 | Revoked |
3 | Discount |
4 | Adjustment |
5 | Other |
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.co-dian-debit-code
co-dian-debit-code
| Code | Name |
|---|---|
1 | Interest |
2 | Pending charges |
3 | Change in value |
4 | Other |
Fiscal Responsibility Code
The fiscal responsibility code as defined by the DIAN for Colombian electronic invoicing. Maps to the UBL’sTaxLevelCode 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.
| Code | Description |
|---|---|
| O-13 | Gran contribuyente |
| O-15 | Autorretenedor |
| O-23 | Agente de retención IVA |
| O-47 | Régimen simple de tributación |
| R-99-PN | No aplica - Otros |
co-dian-fiscal-responsibility
co-dian-fiscal-responsibility
| Code | Name |
|---|---|
O-13 | Major taxpayer |
O-15 | Self-withholder |
O-23 | VAT withholding agent |
O-47 | Simple tax regime |
R-99-PN | Not applicable – Others |