> ## Documentation Index
> Fetch the complete documentation index at: https://docs.invopop.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Invoicing in Colombia

> Issue invoices, credit notes, and debit notes in Colombia through the DIAN.

## Introduction

The [DIAN](https://www.dian.gov.co/) in Colombia stands for *Dirección de Impuestos y Aduanas Nacionales* (National Directorate of Taxes and Customs). It is the government agency responsible for managing and overseeing tax collection, customs operations, and facilitating international trade.

Electronic invoicing in Colombia is mandatory and operates on a real-time clearance model whereby every invoice must receive a unique identifier called a CUFE (*Código Único de Factura Electrónica*) issued by the DIAN; credit and debit notes receive the equivalent CUDE.

Invopop has partnered with [Alegra](https://www.alegra.com), an authorized technology provider for DIAN electronic invoicing, to issue documents in Colombia. This guide walks you through setting up the workflow that issues [GOBL](https://docs.gobl.org) documents through the DIAN. For onboarding suppliers, see the companion guide: [Supplier registration in Colombia](https://docs.invopop.com/guides/co-dian-registration.md).

| - | Sandbox | Live |
| - | - | - |
| **Supplier** | Only Alegra's test NIT (`9005590882`) | Registered supplier required |
| **Series** | `SETP` with codes `990000000`–`995000000` (shared range) | Series from the supplier's DIAN numbering resolutions |

Please refer to the docs of the [GOBL Colombia tax regime](https://docs.gobl.org/regimes/co) and the [DIAN add-on](https://docs.gobl.org/addons/co-dian-v2) to learn about the specifics of Colombian GOBL documents.

## Prerequisites

In order to complete this guide, you will need:

* **A registered supplier**: follow the [supplier registration guide](https://docs.invopop.com/guides/co-dian-registration.md) to create the supplier's Alegra account and complete the DIAN enablement before issuing.
* Customer details for B2B transactions, including name, NIT or international ID, and address, plus the DIAN municipality code for customers identified by a Colombian NIT (see [When is the municipality code required?](#when-is-the-municipality-code-required)).
* Line and item details, including quantity, price, description, and taxes to apply. Colombia can be complicated, as a single invoice may need to apply up to three different value added and retained taxes.

## Document types

The same workflow handles all three DIAN document types:

| Type | DIAN identifier | Requirements |
| - | - | - |
| `standard` invoice | CUFE | Series and code within an active numbering resolution |
| `credit-note` | CUDE | References the corrected invoice in `preceding`; the correction concept comes from the [`co-dian-credit-code`](https://docs.gobl.org/addons/co-dian-v2) extension. When the preceding entry carries no `dian-cude` stamp, the note is cleared as a *nota crédito sin referencia* |
| `debit-note` | CUDE | Every `preceding` entry must carry the `dian-cude` stamp of the original invoice; the concept comes from the `co-dian-debit-code` extension |

Cleared invoices can't be cancelled or edited; correct them with a credit or debit note. Only invoices need a numbering resolution, so notes can use any series.

## Setup

> [!NOTE]
>
> The supplier must already be registered and enabled with the DIAN. This is covered in the [supplier registration guide](https://docs.invopop.com/guides/co-dian-registration.md).

**1. Create the send workflow**

> [card] [Colombia send invoice workflow](https://console.invopop.com/redirect/workflows/new?template=co-send-invoice)
>
> Add to my workspace →

> [tab] Workflow

> [tab] Code
>
> Copy and paste into a new [Empty Invoice workflow](https://console.invopop.com/redirect/workflows/new?template=empty-invoice) code view.
>
> ```json Colombia send invoice workflow theme={"system"}
> {
>     "name": "Colombia send invoice",
>     "description": "Issue an invoice through the DIAN and generate a PDF",
>     "schema": "bill/invoice",
>     "steps": [
>         {
>             "id": "4ede1ca2-7550-4ca9-b007-ebef2bd58dac",
>             "name": "Set state",
>             "provider": "silo.state",
>             "summary": "Set state to `processing`{.state .processing}",
>             "config": {
>                 "state": "processing"
>             }
>         },
>         {
>             "id": "1e35463c-2fb3-4157-a589-4afbafe5fc5b",
>             "name": "Add sequential code",
>             "provider": "sequence.enumerate",
>             "summary": "Dynamic · DIAN · 1",
>             "config": {
>                 "name": "Colombia",
>                 "padding": 1,
>                 "prefix": "",
>                 "start": 1
>             }
>         },
>         {
>             "id": "ade3b20b-5d0c-4663-8907-b439f6e7baaa",
>             "name": "Sign envelope",
>             "provider": "silo.close"
>         },
>         {
>             "id": "20d33e51-2086-4507-a170-946168ba14af",
>             "name": "Send to DIAN",
>             "provider": "gov-co.send"
>         },
>         {
>             "id": "3cbd4b30-4259-46b4-9be1-ec7bad1d7cda",
>             "name": "Generate PDF",
>             "provider": "pdf",
>             "summary": "Spanish · A4",
>             "config": {
>                 "date_format": "%Y-%m-%d",
>                 "layout": "A4",
>                 "locale": "es",
>                 "logo_height": 40
>             }
>         },
>         {
>             "id": "871259a3-85f0-4066-b7cc-655f383ec66d",
>             "name": "Set state",
>             "provider": "silo.state",
>             "summary": "Set state to `sent`{.state .sent}",
>             "config": {
>                 "state": "sent"
>             }
>         }
>     ],
>     "rescue": [
>         {
>             "id": "58582217-f8c2-4b5f-8b1f-576b0680ad84",
>             "name": "Set state",
>             "provider": "silo.state",
>             "summary": "Set state to `error`{.state .error}",
>             "config": {
>                 "state": "error"
>             }
>         }
>     ]
> }
> ```

> [!NOTE]
>
> The **Add sequential code** step uses a dynamic sequence: each document `series` gets its own counter, starting at `1`. Invoice codes must fall within the series' numbering resolution, so if the authorized range starts elsewhere (the sandbox `SETP` range starts at `990000000`), create a [series](https://docs.invopop.com/console/series.md) with a matching start number and select it in the step instead.

Setup is complete. You can now use the workflow you created to issue invoices, credit notes, and debit notes in Colombia.

## Send an invoice

Upload the invoice as a silo entry and run the workflow on it, either from the [Invopop Console](https://console.invopop.com) or via the API.

> [!NOTE]
>
> The recommended approach for running jobs is to perform two steps: first upload the document to the [silo](https://docs.invopop.com/api-ref/silo/entries/create-an-entry-put.md), then [create a job](https://docs.invopop.com/api-ref/transform/jobs/create-a-job-post.md).

On success, the workflow:

* adds the `dian-cude` stamp to the envelope, holding the CUFE (invoices) or CUDE (credit and debit notes),
* adds the `dian-qr` stamp with the DIAN QR code content, used by the PDF step to render a compliant invoice,
* adds the `dian-resolution` stamp with the numbering resolution (invoices only) and the `email-subject` stamp with the subject the DIAN expects on the email notification, and,
* attaches the signed DIAN XML (AttachedDocument) to the entry as a file.

While the DIAN hasn't responded, the job stays queued and is checked again every 15 minutes. If the DIAN rejects the document, the job fails with the DIAN's error details.

### Validation notes

Before sending, the document is validated against the [DIAN add-on](https://docs.gobl.org/addons/co-dian-v2) rules plus a few DIAN transmission requirements:

* The issue date must be the current date in Colombia: the DIAN rejects back-dated documents.
* The `code` must contain digits only; letters belong in the `series`.
* For invoices, the series must match one of the supplier's numbering resolutions, and the code must be within the authorized range and validity dates. Resolutions are refreshed from the DIAN automatically once the range is [linked to Alegra](https://docs.invopop.com/guides/co-dian-registration.md#numbering-resolutions).
* Every tax combo must include a percent; you can set percents explicitly or use one of the supported rates of the [GOBL Colombia tax regime](https://docs.gobl.org/regimes/co).
* All line items must have a price greater than zero, and due dates cannot be earlier than the issue date.
* Totals rounding (`totals.rounding`) isn't supported.
* Amounts in other currencies are converted to COP automatically. Invoices in a currency other than COP must include `exchange_rates` with a rate to COP, or the conversion fails.

### When is the municipality code required?

The [`co-dian-municipality`](https://docs.gobl.org/addons/co-dian-v2#municipality-codes) extension in a party's `ext` identifies its municipality. Whether a party needs it depends on how it's identified:

| Party | Municipality code |
| - | - |
| Colombian supplier | Required |
| Customer identified by a Colombian NIT (`tax_id.country` is `CO` and `tax_id.code` is set) | Required |
| Foreign customer (`tax_id.country` other than `CO`) | Not required |
| `simplified` B2C invoice with no customer | Not required |
| `simplified` B2C customer identified only by an identity, such as a cédula (`co-dian-citizen-id`), with no `tax_id` | Not required |

* The value is the 5-digit DIAN municipality code (DIVIPOLA), such as `11001` for Bogotá or `05001` for Medellín, not the 6-digit postal code. See the [DIAN list of municipality codes](https://www.dian.gov.co/atencionciudadano/formulariosinstructivos/Formularios/2007/Codigos_municipios_2007.pdf).
* When a required code is missing, the GOBL build fails with `extension 'co-dian-municipality' is required` on `$.supplier.ext` or `$.customer.ext`, so the invoice never reaches the DIAN.
* Invopop can't derive the code from the NIT, so collect it with the rest of your customer data for each Colombian business customer, for example in your customer form. Foreign and consumer customers don't need the field.

### Transmitting invoices issued during a contingency

The DIAN defines what to do when invoices can't be issued electronically in [Resolución 000165 de 2023](https://normograma.dian.gov.co/dian/compilacion/docs/resolucion_dian_0165_2023.htm). The required action depends on where the outage is:

| Outage | DIAN type | What to do |
| - | - | - |
| The DIAN's validation service is unavailable | 04 | Nothing: Invopop manages it. Keep sending invoices as usual; jobs stay queued until the DIAN responds. |
| The supplier's systems or Invopop can't issue invoices | 03 | Issue invoices on paper and transmit them once back online, as described below. |

#### While offline: issue on paper

During the outage, invoices are issued by hand or printed from any other system (*facturas de talonario o de papel*). These paper invoices:

* Must be numbered from a [contingency range](https://docs.invopop.com/guides/co-dian-registration.md#contingency-range), which the supplier needs to request from the DIAN ahead of time.
* Can only be issued while the outage lasts, and are valid support for the sale for both the supplier and the customer.

#### Once back online: transmit the invoices

Within 48 hours of the outage ending, each paper invoice must be captured and sent to the DIAN through Invopop.

> [!WARNING]
>
> Before sending, the supplier's [contingency resolution](https://docs.invopop.com/guides/co-dian-registration.md#contingency-range) must be [uploaded to Invopop](https://docs.invopop.com/api-ref/apps/gov-co/resolutions-upload.md). Invopop rejects contingency invoices without one, and in production the DIAN rejects those whose number isn't within it.

1. **Create a GOBL invoice replicating the paper invoice**, with the same customer, lines, and taxes, and with these specifics:

   * The `series` and `code` are the paper invoice's contingency prefix and number.
   * The `issue_date` is the date the paper invoice was issued.
   * The [`co-dian-invoice-type`](https://docs.gobl.org/addons/co-dian-v2) extension in `tax.ext` is set to `03`.

   ```json theme={"system"}
   {
     "$schema": "https://gobl.org/draft-0/bill/invoice",
     "$regime": "CO",
     "$addons": ["co-dian-v2"],
     "series": "CONT",
     "code": "1001",
     "issue_date": "2026-10-22",
     "tax": {
       "ext": {
         "co-dian-invoice-type": "03"
       }
     }
   }
   ```

   This partial example shows only the contingency-specific fields. Complete the document with the supplier, customer, and lines copied from the paper invoice.

2. **Run your regular send workflow** on the document. It's sent to the DIAN as a type 03 invoice and gets the same stamps as a regular invoice, with a CUDE instead of a CUFE.

Keep in mind:

* Credit and debit notes have no contingency procedure: wait until the systems are back and issue them with your usual note series. They can correct a transmitted contingency invoice like any other invoice.
* Outages on the DIAN's side (type 04 contingency) are handled by Invopop and need no changes to your documents.
* In sandbox, upload a contingency resolution with any values first, such as prefix `CONT` and range `1`–`5000`. The DIAN test environment doesn't check contingency ranges, but Invopop still checks the invoice's code and date against the uploaded resolution.

## Example invoices

The following examples are of [GOBL](https://docs.gobl.org) documents you can copy and paste directly into the [Invopop Console](https://console.invopop.com) or store via the API as silo entries. Then, you must run the Colombia workflow created during setup.

[GOBL Invoices](https://docs.gobl.org/draft-0/bill/invoice) sent to the DIAN require the following properties to perform the correct normalization and validation steps:

* `$schema` to be set to `https://gobl.org/draft-0/bill/invoice`
* `$addons` to include [`co-dian-v2`](https://docs.gobl.org/addons/co-dian-v2), so the document is validated with the DIAN rules
* `supplier.tax_id.country` to be set to `CO`
* `supplier.ext` to include the DIAN municipality code under the [`co-dian-municipality`](https://docs.gobl.org/addons/co-dian-v2) extension. Customers identified by a Colombian NIT need it too; foreign and `simplified` B2C customers don't. See [When is the municipality code required?](#when-is-the-municipality-code-required).

> [!NOTE]
>
> The examples are ready for the sandbox: they use Alegra's NIT `9005590882` and the `SETP` test series. Before sending, set the issue date to today and change the code to another one between `990000000` and `995000000`, since the range is shared.

> [accordion] Example B2B invoice
>
> In this example, we're issuing a B2B invoice from a Colombian supplier to another Colombian business customer.
>
> Notice:
>
> * the `$schema` is set to [`https://gobl.org/draft-0/bill/invoice`](https://docs.gobl.org/draft-0/bill/invoice),
> * we've added the [`co-dian-v2`](https://docs.gobl.org/addons/co-dian-v2) addon, so the document is validated with the DIAN rules built into [GOBL](https://docs.gobl.org) and gets its defaults, such as the `R-99-PN` fiscal responsibility,
> * the supplier uses Alegra's sandbox NIT and the `series` is the `SETP` test series, so the example can be sent in the sandbox,
> * both parties carry the DIAN municipality code in the `co-dian-municipality` extension, required here because the customer is identified by a Colombian NIT,
> * the invoice includes VAT at the standard Colombian rate of 19%,
> * payment terms are specified with a due date and payment amount, and,
> * there are no calculations in some fields; these will be made automatically when uploading.
>
> ```json Colombia B2B invoice theme={"system"}
> {
>   "$schema": "https://gobl.org/draft-0/bill/invoice",
>   "$regime": "CO",
>   "$addons": [
>     "co-dian-v2"
>   ],
>   "series": "SETP",
>   "code": "990001001",
>   "issue_date": "2026-10-13",
>   "currency": "COP",
>   "supplier": {
>     "name": "EXAMPLE SUPPLIER S.A.S.",
>     "tax_id": {
>       "country": "CO",
>       "type": "tin",
>       "code": "9005590882"
>     },
>     "addresses": [
>       {
>         "street": "CRA 15 88 64 OF 502",
>         "locality": "Bogotá, D.C.",
>         "region": "Bogotá",
>         "country": "CO"
>       }
>     ],
>     "ext": {
>       "co-dian-municipality": "11001"
>     }
>   },
>   "customer": {
>     "name": "EXAMPLE CUSTOMER S.A.S.",
>     "tax_id": {
>       "country": "CO",
>       "type": "tin",
>       "code": "9014514805"
>     },
>     "addresses": [
>       {
>         "street": "CRA 8 113 31 OF 703",
>         "locality": "Bogotá, D.C.",
>         "region": "Bogotá",
>         "country": "CO"
>       }
>     ],
>     "emails": [
>       {
>         "addr": "benito.ortiz@example.com"
>       }
>     ],
>     "telephones": [
>       {
>         "num": "3114131811"
>       }
>     ],
>     "ext": {
>       "co-dian-municipality": "11001"
>     }
>   },
>   "lines": [
>     {
>       "quantity": "1",
>       "item": {
>         "name": "Servicios de consultoría",
>         "price": "200000.00"
>       },
>       "taxes": [
>         {
>           "cat": "VAT",
>           "percent": "19%"
>         }
>       ]
>     }
>   ],
>   "payment": {
>     "terms": {
>       "due_dates": [
>         {
>           "date": "2026-11-12",
>           "percent": "100%"
>         }
>       ]
>     }
>   }
> }
> ```
>
> ```json Built version theme={"system"}
> {
> 	"$schema": "https://gobl.org/draft-0/bill/invoice",
> 	"$regime": "CO",
> 	"$addons": [
> 		"co-dian-v2"
> 	],
> 	"type": "standard",
> 	"series": "SETP",
> 	"code": "990001001",
> 	"issue_date": "2026-10-13",
> 	"currency": "COP",
> 	"supplier": {
> 		"name": "EXAMPLE SUPPLIER S.A.S.",
> 		"tax_id": {
> 			"country": "CO",
> 			"code": "9005590882",
> 			"type": "tin"
> 		},
> 		"addresses": [
> 			{
> 				"street": "CRA 15 88 64 OF 502",
> 				"locality": "Bogotá, D.C.",
> 				"region": "Bogotá",
> 				"country": "CO"
> 			}
> 		],
> 		"ext": {
> 			"co-dian-fiscal-responsibility": "R-99-PN",
> 			"co-dian-municipality": "11001"
> 		}
> 	},
> 	"customer": {
> 		"name": "EXAMPLE CUSTOMER S.A.S.",
> 		"tax_id": {
> 			"country": "CO",
> 			"code": "9014514805",
> 			"type": "tin"
> 		},
> 		"addresses": [
> 			{
> 				"street": "CRA 8 113 31 OF 703",
> 				"locality": "Bogotá, D.C.",
> 				"region": "Bogotá",
> 				"country": "CO"
> 			}
> 		],
> 		"emails": [
> 			{
> 				"addr": "benito.ortiz@example.com"
> 			}
> 		],
> 		"telephones": [
> 			{
> 				"num": "3114131811"
> 			}
> 		],
> 		"ext": {
> 			"co-dian-fiscal-responsibility": "R-99-PN",
> 			"co-dian-municipality": "11001",
> 			"co-dian-tax-scheme": "ZZ"
> 		}
> 	},
> 	"lines": [
> 		{
> 			"i": 1,
> 			"quantity": "1",
> 			"item": {
> 				"name": "Servicios de consultoría",
> 				"price": "200000.00"
> 			},
> 			"sum": "200000.00",
> 			"taxes": [
> 				{
> 					"cat": "VAT",
> 					"key": "standard",
> 					"percent": "19%"
> 				}
> 			],
> 			"total": "200000.00"
> 		}
> 	],
> 	"payment": {
> 		"terms": {
> 			"due_dates": [
> 				{
> 					"date": "2026-11-12",
> 					"amount": "238000.00",
> 					"percent": "100%"
> 				}
> 			]
> 		}
> 	},
> 	"totals": {
> 		"sum": "200000.00",
> 		"total": "200000.00",
> 		"taxes": {
> 			"categories": [
> 				{
> 					"code": "VAT",
> 					"rates": [
> 						{
> 							"key": "standard",
> 							"base": "200000.00",
> 							"percent": "19%",
> 							"amount": "38000.00"
> 						}
> 					],
> 					"amount": "38000.00"
> 				}
> 			],
> 			"sum": "38000.00"
> 		},
> 		"tax": "38000.00",
> 		"total_with_tax": "238000.00",
> 		"payable": "238000.00"
> 	}
> }
> ```

> [accordion] Example B2C invoice
>
> In this example, we're issuing a B2C simplified invoice from a Colombian supplier to a consumer.
>
> Notice:
>
> * we've set the `simplified` tag in the `tax.tags` field; this indicates the invoice is for a final consumer,
> * the customer information is omitted, as it's not required for B2C transactions; the DIAN receives it as *Consumidor final*, and no customer municipality code is needed,
> * the invoice includes a prepayment advance of 100%, meaning the invoice has been fully paid,
> * the totals section shows the `advance` and `due` amounts, with the latter being zero since the invoice is fully paid, and,
> * there are no calculations in some fields; these will be made automatically when uploading.
>
> ```json Colombia B2C invoice theme={"system"}
> {
>   "$schema": "https://gobl.org/draft-0/bill/invoice",
>   "$regime": "CO",
>   "$addons": [
>     "co-dian-v2"
>   ],
>   "series": "SETP",
>   "code": "990001002",
>   "issue_date": "2026-10-13",
>   "currency": "COP",
>   "tax": {
>     "tags": [
>       "simplified"
>     ]
>   },
>   "supplier": {
>     "name": "EXAMPLE SUPPLIER S.A.S.",
>     "tax_id": {
>       "country": "CO",
>       "type": "tin",
>       "code": "9005590882"
>     },
>     "addresses": [
>       {
>         "street": "CRA 15 88 64 OF 502",
>         "locality": "Bogotá, D.C.",
>         "region": "Bogotá",
>         "country": "CO"
>       }
>     ],
>     "ext": {
>       "co-dian-municipality": "11001"
>     }
>   },
>   "lines": [
>     {
>       "quantity": "1",
>       "item": {
>         "name": "Servicios de consultoría",
>         "price": "200000.00"
>       },
>       "taxes": [
>         {
>           "cat": "VAT",
>           "percent": "19%"
>         }
>       ]
>     }
>   ],
>   "payment": {
>     "advances": [
>       {
>         "description": "Prepaid",
>         "percent": "100%"
>       }
>     ]
>   }
> }
> ```
>
> ```json Built version theme={"system"}
> {
> 	"$schema": "https://gobl.org/draft-0/bill/invoice",
> 	"$regime": "CO",
> 	"$addons": [
> 		"co-dian-v2"
> 	],
> 	"$tags": [
> 		"simplified"
> 	],
> 	"type": "standard",
> 	"series": "SETP",
> 	"code": "990001002",
> 	"issue_date": "2026-10-13",
> 	"currency": "COP",
> 	"tax": {},
> 	"supplier": {
> 		"name": "EXAMPLE SUPPLIER S.A.S.",
> 		"tax_id": {
> 			"country": "CO",
> 			"code": "9005590882",
> 			"type": "tin"
> 		},
> 		"addresses": [
> 			{
> 				"street": "CRA 15 88 64 OF 502",
> 				"locality": "Bogotá, D.C.",
> 				"region": "Bogotá",
> 				"country": "CO"
> 			}
> 		],
> 		"ext": {
> 			"co-dian-fiscal-responsibility": "R-99-PN",
> 			"co-dian-municipality": "11001"
> 		}
> 	},
> 	"lines": [
> 		{
> 			"i": 1,
> 			"quantity": "1",
> 			"item": {
> 				"name": "Servicios de consultoría",
> 				"price": "200000.00"
> 			},
> 			"sum": "200000.00",
> 			"taxes": [
> 				{
> 					"cat": "VAT",
> 					"key": "standard",
> 					"percent": "19%"
> 				}
> 			],
> 			"total": "200000.00"
> 		}
> 	],
> 	"payment": {
> 		"advances": [
> 			{
> 				"description": "Prepaid",
> 				"percent": "100%",
> 				"amount": "238000.00"
> 			}
> 		]
> 	},
> 	"totals": {
> 		"sum": "200000.00",
> 		"total": "200000.00",
> 		"taxes": {
> 			"categories": [
> 				{
> 					"code": "VAT",
> 					"rates": [
> 						{
> 							"key": "standard",
> 							"base": "200000.00",
> 							"percent": "19%",
> 							"amount": "38000.00"
> 						}
> 					],
> 					"amount": "38000.00"
> 				}
> 			],
> 			"sum": "38000.00"
> 		},
> 		"tax": "38000.00",
> 		"total_with_tax": "238000.00",
> 		"payable": "238000.00",
> 		"advance": "238000.00",
> 		"due": "0.00"
> 	}
> }
> ```

> [accordion] Example credit note
>
> In this example, we're issuing a credit note (nota de crédito) that corrects a previously issued invoice.
>
> Notice:
>
> * the `type` is set to `credit-note`,
> * the `series` is set to a dedicated credit note series, separate from the invoice series,
> * the `preceding` array references the original invoice being corrected by its `series`, `code`, and `issue_date`, along with a `reason` for the correction,
> * the correction concept is set with the [`co-dian-credit-code`](https://docs.gobl.org/addons/co-dian-v2) extension on the preceding entry,
> * the lines describe the amounts being credited — a credit note can cover the full original invoice or just part of it, and,
> * there are no calculations in some fields; these will be made automatically when uploading.
>
> ```json Colombia credit note theme={"system"}
> {
>   "$schema": "https://gobl.org/draft-0/bill/invoice",
>   "$regime": "CO",
>   "$addons": [
>     "co-dian-v2"
>   ],
>   "type": "credit-note",
>   "series": "NCTP",
>   "code": "1",
>   "issue_date": "2026-10-13",
>   "currency": "COP",
>   "preceding": [
>     {
>       "type": "standard",
>       "series": "SETP",
>       "code": "990001001",
>       "issue_date": "2026-10-13",
>       "reason": "Servicios no prestados",
>       "ext": {
>         "co-dian-credit-code": "1"
>       }
>     }
>   ],
>   "supplier": {
>     "name": "EXAMPLE SUPPLIER S.A.S.",
>     "tax_id": {
>       "country": "CO",
>       "type": "tin",
>       "code": "9005590882"
>     },
>     "addresses": [
>       {
>         "street": "CRA 15 88 64 OF 502",
>         "locality": "Bogotá, D.C.",
>         "region": "Bogotá",
>         "country": "CO"
>       }
>     ],
>     "ext": {
>       "co-dian-municipality": "11001"
>     }
>   },
>   "customer": {
>     "name": "EXAMPLE CUSTOMER S.A.S.",
>     "tax_id": {
>       "country": "CO",
>       "type": "tin",
>       "code": "9014514805"
>     },
>     "addresses": [
>       {
>         "street": "CRA 8 113 31 OF 703",
>         "locality": "Bogotá, D.C.",
>         "region": "Bogotá",
>         "country": "CO"
>       }
>     ],
>     "emails": [
>       {
>         "addr": "benito.ortiz@example.com"
>       }
>     ],
>     "telephones": [
>       {
>         "num": "3114131811"
>       }
>     ],
>     "ext": {
>       "co-dian-municipality": "11001"
>     }
>   },
>   "lines": [
>     {
>       "quantity": "1",
>       "item": {
>         "name": "Servicios de consultoría",
>         "price": "200000.00"
>       },
>       "taxes": [
>         {
>           "cat": "VAT",
>           "percent": "19%"
>         }
>       ]
>     }
>   ],
>   "payment": {
>     "terms": {
>       "due_dates": [
>         {
>           "date": "2026-11-12",
>           "percent": "100%"
>         }
>       ]
>     }
>   }
> }
> ```
>
> ```json Built version theme={"system"}
> {
> 	"$schema": "https://gobl.org/draft-0/bill/invoice",
> 	"$regime": "CO",
> 	"$addons": [
> 		"co-dian-v2"
> 	],
> 	"type": "credit-note",
> 	"series": "NCTP",
> 	"code": "1",
> 	"issue_date": "2026-10-13",
> 	"currency": "COP",
> 	"preceding": [
> 		{
> 			"type": "standard",
> 			"issue_date": "2026-10-13",
> 			"series": "SETP",
> 			"code": "990001001",
> 			"reason": "Servicios no prestados",
> 			"ext": {
> 				"co-dian-credit-code": "1"
> 			}
> 		}
> 	],
> 	"supplier": {
> 		"name": "EXAMPLE SUPPLIER S.A.S.",
> 		"tax_id": {
> 			"country": "CO",
> 			"code": "9005590882",
> 			"type": "tin"
> 		},
> 		"addresses": [
> 			{
> 				"street": "CRA 15 88 64 OF 502",
> 				"locality": "Bogotá, D.C.",
> 				"region": "Bogotá",
> 				"country": "CO"
> 			}
> 		],
> 		"ext": {
> 			"co-dian-fiscal-responsibility": "R-99-PN",
> 			"co-dian-municipality": "11001"
> 		}
> 	},
> 	"customer": {
> 		"name": "EXAMPLE CUSTOMER S.A.S.",
> 		"tax_id": {
> 			"country": "CO",
> 			"code": "9014514805",
> 			"type": "tin"
> 		},
> 		"addresses": [
> 			{
> 				"street": "CRA 8 113 31 OF 703",
> 				"locality": "Bogotá, D.C.",
> 				"region": "Bogotá",
> 				"country": "CO"
> 			}
> 		],
> 		"emails": [
> 			{
> 				"addr": "benito.ortiz@example.com"
> 			}
> 		],
> 		"telephones": [
> 			{
> 				"num": "3114131811"
> 			}
> 		],
> 		"ext": {
> 			"co-dian-fiscal-responsibility": "R-99-PN",
> 			"co-dian-municipality": "11001",
> 			"co-dian-tax-scheme": "ZZ"
> 		}
> 	},
> 	"lines": [
> 		{
> 			"i": 1,
> 			"quantity": "1",
> 			"item": {
> 				"name": "Servicios de consultoría",
> 				"price": "200000.00"
> 			},
> 			"sum": "200000.00",
> 			"taxes": [
> 				{
> 					"cat": "VAT",
> 					"key": "standard",
> 					"percent": "19%"
> 				}
> 			],
> 			"total": "200000.00"
> 		}
> 	],
> 	"payment": {
> 		"terms": {
> 			"due_dates": [
> 				{
> 					"date": "2026-11-12",
> 					"amount": "238000.00",
> 					"percent": "100%"
> 				}
> 			]
> 		}
> 	},
> 	"totals": {
> 		"sum": "200000.00",
> 		"total": "200000.00",
> 		"taxes": {
> 			"categories": [
> 				{
> 					"code": "VAT",
> 					"rates": [
> 						{
> 							"key": "standard",
> 							"base": "200000.00",
> 							"percent": "19%",
> 							"amount": "38000.00"
> 						}
> 					],
> 					"amount": "38000.00"
> 				}
> 			],
> 			"sum": "38000.00"
> 		},
> 		"tax": "38000.00",
> 		"total_with_tax": "238000.00",
> 		"payable": "238000.00"
> 	}
> }
> ```

> [accordion] Example debit note
>
> In this example, we're issuing a debit note (nota de débito) that increases the amount of a previously cleared invoice.
>
> Notice:
>
> * the `type` is set to `debit-note`,
> * the `series` is set to a dedicated debit note series, separate from the invoice series; notes don't need a numbering resolution,
> * the `preceding` array references the original invoice by its `series`, `code`, and `issue_date`, along with a `reason` for the adjustment,
> * the preceding entry carries the `dian-cude` stamp of the original invoice, taken from its cleared envelope; the DIAN requires it for every debit note,
> * the adjustment concept is set with the [`co-dian-debit-code`](https://docs.gobl.org/addons/co-dian-v2) extension on the preceding entry,
> * the lines describe only the additional amount being charged, and,
> * there are no calculations in some fields; these will be made automatically when uploading.
>
> ```json Colombia debit note theme={"system"}
> {
>   "$schema": "https://gobl.org/draft-0/bill/invoice",
>   "$regime": "CO",
>   "$addons": [
>     "co-dian-v2"
>   ],
>   "type": "debit-note",
>   "series": "NDTP",
>   "code": "1",
>   "issue_date": "2026-10-13",
>   "currency": "COP",
>   "preceding": [
>     {
>       "type": "standard",
>       "series": "SETP",
>       "code": "990001001",
>       "issue_date": "2026-10-13",
>       "reason": "Ajuste del valor de los servicios",
>       "stamps": [
>         {
>           "prv": "dian-cude",
>           "val": "3f8c1c9b6e0a4f2d8b7a5c3e1d9f0a2b4c6e8d0f1a3b5c7d9e1f2a4b6c8d0e2f4a6b8c0d2e4f6a8b0c2d4e6f8a0b2c4d6e8"
>         }
>       ],
>       "ext": {
>         "co-dian-debit-code": "3"
>       }
>     }
>   ],
>   "supplier": {
>     "name": "EXAMPLE SUPPLIER S.A.S.",
>     "tax_id": {
>       "country": "CO",
>       "type": "tin",
>       "code": "9005590882"
>     },
>     "addresses": [
>       {
>         "street": "CRA 15 88 64 OF 502",
>         "locality": "Bogotá, D.C.",
>         "region": "Bogotá",
>         "country": "CO"
>       }
>     ],
>     "ext": {
>       "co-dian-municipality": "11001"
>     }
>   },
>   "customer": {
>     "name": "EXAMPLE CUSTOMER S.A.S.",
>     "tax_id": {
>       "country": "CO",
>       "type": "tin",
>       "code": "9014514805"
>     },
>     "addresses": [
>       {
>         "street": "CRA 8 113 31 OF 703",
>         "locality": "Bogotá, D.C.",
>         "region": "Bogotá",
>         "country": "CO"
>       }
>     ],
>     "emails": [
>       {
>         "addr": "benito.ortiz@example.com"
>       }
>     ],
>     "telephones": [
>       {
>         "num": "3114131811"
>       }
>     ],
>     "ext": {
>       "co-dian-municipality": "11001"
>     }
>   },
>   "lines": [
>     {
>       "quantity": "1",
>       "item": {
>         "name": "Ajuste de precio de los servicios de consultoría",
>         "price": "50000.00"
>       },
>       "taxes": [
>         {
>           "cat": "VAT",
>           "percent": "19%"
>         }
>       ]
>     }
>   ],
>   "payment": {
>     "terms": {
>       "due_dates": [
>         {
>           "date": "2026-11-12",
>           "percent": "100%"
>         }
>       ]
>     }
>   }
> }
> ```
>
> ```json Built version theme={"system"}
> {
> 	"$schema": "https://gobl.org/draft-0/bill/invoice",
> 	"$regime": "CO",
> 	"$addons": [
> 		"co-dian-v2"
> 	],
> 	"type": "debit-note",
> 	"series": "NDTP",
> 	"code": "1",
> 	"issue_date": "2026-10-13",
> 	"currency": "COP",
> 	"preceding": [
> 		{
> 			"type": "standard",
> 			"issue_date": "2026-10-13",
> 			"series": "SETP",
> 			"code": "990001001",
> 			"reason": "Ajuste del valor de los servicios",
> 			"stamps": [
> 				{
> 					"prv": "dian-cude",
> 					"val": "3f8c1c9b6e0a4f2d8b7a5c3e1d9f0a2b4c6e8d0f1a3b5c7d9e1f2a4b6c8d0e2f4a6b8c0d2e4f6a8b0c2d4e6f8a0b2c4d6e8"
> 				}
> 			],
> 			"ext": {
> 				"co-dian-debit-code": "3"
> 			}
> 		}
> 	],
> 	"supplier": {
> 		"name": "EXAMPLE SUPPLIER S.A.S.",
> 		"tax_id": {
> 			"country": "CO",
> 			"code": "9005590882",
> 			"type": "tin"
> 		},
> 		"addresses": [
> 			{
> 				"street": "CRA 15 88 64 OF 502",
> 				"locality": "Bogotá, D.C.",
> 				"region": "Bogotá",
> 				"country": "CO"
> 			}
> 		],
> 		"ext": {
> 			"co-dian-fiscal-responsibility": "R-99-PN",
> 			"co-dian-municipality": "11001"
> 		}
> 	},
> 	"customer": {
> 		"name": "EXAMPLE CUSTOMER S.A.S.",
> 		"tax_id": {
> 			"country": "CO",
> 			"code": "9014514805",
> 			"type": "tin"
> 		},
> 		"addresses": [
> 			{
> 				"street": "CRA 8 113 31 OF 703",
> 				"locality": "Bogotá, D.C.",
> 				"region": "Bogotá",
> 				"country": "CO"
> 			}
> 		],
> 		"emails": [
> 			{
> 				"addr": "benito.ortiz@example.com"
> 			}
> 		],
> 		"telephones": [
> 			{
> 				"num": "3114131811"
> 			}
> 		],
> 		"ext": {
> 			"co-dian-fiscal-responsibility": "R-99-PN",
> 			"co-dian-municipality": "11001",
> 			"co-dian-tax-scheme": "ZZ"
> 		}
> 	},
> 	"lines": [
> 		{
> 			"i": 1,
> 			"quantity": "1",
> 			"item": {
> 				"name": "Ajuste de precio de los servicios de consultoría",
> 				"price": "50000.00"
> 			},
> 			"sum": "50000.00",
> 			"taxes": [
> 				{
> 					"cat": "VAT",
> 					"key": "standard",
> 					"percent": "19%"
> 				}
> 			],
> 			"total": "50000.00"
> 		}
> 	],
> 	"payment": {
> 		"terms": {
> 			"due_dates": [
> 				{
> 					"date": "2026-11-12",
> 					"amount": "59500.00",
> 					"percent": "100%"
> 				}
> 			]
> 		}
> 	},
> 	"totals": {
> 		"sum": "50000.00",
> 		"total": "50000.00",
> 		"taxes": {
> 			"categories": [
> 				{
> 					"code": "VAT",
> 					"rates": [
> 						{
> 							"key": "standard",
> 							"base": "50000.00",
> 							"percent": "19%",
> 							"amount": "9500.00"
> 						}
> 					],
> 					"amount": "9500.00"
> 				}
> 			],
> 			"sum": "9500.00"
> 		},
> 		"tax": "9500.00",
> 		"total_with_tax": "59500.00",
> 		"payable": "59500.00"
> 	}
> }
> ```

## FAQ

> [accordion] My GOBL document for a Colombian invoice fails to build because of the postal code
>
> The DIAN expects a 5-digit [municipal code](https://www.dian.gov.co/atencionciudadano/formulariosinstructivos/Formularios/2007/Codigos_municipios_2007.pdf), not a 6-digit postal code, in the [`co-dian-municipality`](https://docs.gobl.org/addons/co-dian-v2) extension of the supplier and of customers identified by a Colombian NIT. For example, use `11001` for Bogotá.

> [accordion] How does Invopop issue invoices in Colombia?
>
> Through [Alegra](https://www.alegra.com), an authorized DIAN technology provider. The [send workflow](https://docs.invopop.com/guides/co-dian-invoicing.md) signs the GOBL envelope, clears it with the DIAN, stamps the CUFE and QR code, and generates a compliant PDF.

> [accordion] What does a GOBL invoice need to be accepted by the DIAN?
>
> Set `$schema` to `https://gobl.org/draft-0/bill/invoice`, the supplier's `tax_id.country` to `CO`, and include the supplier's DIAN municipality code via the [`co-dian-municipality`](https://docs.gobl.org/addons/co-dian-v2) extension in its `ext`. Customers identified by a Colombian NIT need the extension too; foreign customers and `simplified` B2C invoices don't (see [When is the municipality code required?](https://docs.invopop.com/guides/co-dian-invoicing.md#when-is-the-municipality-code-required)). See the [GOBL Colombia tax regime](https://github.com/invopop/gobl/blob/main/regimes/co/README.md) for the full field reference and examples.

> [accordion] Do foreign or consumer customers need a municipality code?
>
> No. The [`co-dian-municipality`](https://docs.gobl.org/addons/co-dian-v2) extension is only required on customers identified by a Colombian NIT, that is, with `tax_id.country` set to `CO` and a `tax_id.code`. Foreign customers, `simplified` B2C invoices without a customer, and consumers identified only by a cédula build without it. Invopop can't derive the code from the NIT, so collect it for each Colombian business customer.

> [accordion] Which taxes can appear on a Colombian invoice?
>
> VAT (IVA, 19% standard or 5% reduced), consumption taxes (IC, INC), the industry and commerce tax (ICA), and the retained taxes ReteIVA, ReteICA, and Retefuente. A single invoice may need to combine up to three value added and retained taxes, all supported by the [GOBL Colombia tax regime](https://docs.gobl.org/regimes/co#tax-categories).

> [accordion] Which document types can I issue in Colombia?
>
> Invoices, credit notes, and debit notes. Credit and debit notes reference the corrected invoice in the `preceding` array; debit notes require every preceding entry to carry the `dian-cude` stamp of the original invoice.

> [accordion] What are the sandbox limitations for Colombia?
>
> Only Alegra's NIT (`9005590882`) can be the supplier. Invoices use series `SETP` with codes `990000000`–`995000000` (shared across users, so avoid common codes) and today's date in Colombia.

> [accordion] Why was my invoice rejected for its series or number?
>
> The series, code, and issue date must fall within an active DIAN numbering resolution. Resolutions are refreshed automatically, so a rejection usually means the range isn't linked to Alegra yet, or it expired or ran out and the supplier needs a new one. See [Numbering resolutions](https://docs.invopop.com/guides/co-dian-registration.md#numbering-resolutions).

More available in our [Colombia FAQ](https://docs.invopop.com/faq/colombia.md) section

***

> [accordion] 🇨🇴 Invopop resources for Colombia
>
> | | |
> | - | - |
> | Compliance | [Invoicing compliance in Colombia](https://docs.invopop.com/compliance/colombia.md)   [Compliance timeline](https://docs.invopop.com/timelines/colombia.md) |
> | Apps | [Colombia](https://docs.invopop.com/apps/colombia.md) |
> | Guides | [Supplier registration](https://docs.invopop.com/guides/co-dian-registration.md)   [Issuing invoices](https://docs.invopop.com/guides/co-dian-invoicing.md) |
> | FAQ | [Colombia FAQ](https://docs.invopop.com/faq/colombia.md) |
> | GOBL | [Colombia Tax Regime](https://docs.gobl.org/regimes/co)   [Colombia DIAN Addon](https://docs.gobl.org/addons/co-dian-v2) |

> [card] [Participate in our community](https://community.invopop.com)
>
> Ask and answer questions about invoicing in Colombia →


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.