Skip to main content

Introduction

The DIAN 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, 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 documents through the DIAN. For onboarding suppliers, see the companion guide: Supplier registration in Colombia. Please refer to the docs of the GOBL Colombia tax regime and the DIAN add-on 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 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, address, and municipality code for Colombian customers.
  • 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: 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

The supplier must already be registered and enabled with the DIAN. This is covered in the supplier registration guide.
1

Create the send workflow

Colombia send invoice workflow

Add to my workspace →
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 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 or via the API.
The recommended approach for running jobs is to perform two steps: first upload the document to the silo, then create a job.
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 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.
  • 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.
  • 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.

Example invoices

The following examples are of GOBL documents you can copy and paste directly into the Invopop Console or store via the API as silo entries. Then, you must run the Colombia workflow created during setup. GOBL Invoices 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
  • supplier.tax_id.country to be set to CO
  • supplier.ext to include the DIAN municipality code under the co-dian-municipality extension. Colombian customers need it too.
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.
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,
  • 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,
  • 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.
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,
  • 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.
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 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.
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 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.

FAQ

The DIAN expects a 5-digit municipal code, not a 6-digit postal code, in the supplier’s co-dian-municipality extension.
Through Alegra, an authorized DIAN technology provider. The send workflow signs the GOBL envelope, clears it with the DIAN, stamps the CUFE and QR code, and generates a compliant PDF.
Set $schema to https://gobl.org/draft-0/bill/invoice, the supplier’s tax_id.country to CO, and include the supplier’s and customer’s DIAN municipality codes via the co-dian-municipality extension in each party’s ext. See the GOBL Colombia tax regime for the full field reference and examples.
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.
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.
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.
The series, code, and issue date must fall within an active DIAN numbering resolution. Resolutions are refreshed automatically, so a rejection usually means it expired or ran out and the supplier needs a new one from the DIAN.
More available in our Colombia FAQ section

Participate in our community

Ask and answer questions about invoicing in Colombia →