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 →
- Workflow
- Code
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.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.
- adds the
dian-cudestamp to the envelope, holding the CUFE (invoices) or CUDE (credit and debit notes), - adds the
dian-qrstamp with the DIAN QR code content, used by the PDF step to render a compliant invoice, - adds the
dian-resolutionstamp with the numbering resolution (invoices only) and theemail-subjectstamp with the subject the DIAN expects on the email notification, and, - attaches the signed DIAN XML (AttachedDocument) to the entry as a file.
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
codemust contain digits only; letters belong in theseries. - 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_rateswith 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:$schemato be set tohttps://gobl.org/draft-0/bill/invoicesupplier.tax_id.countryto be set toCOsupplier.extto include the DIAN municipality code under theco-dian-municipalityextension. 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.Example B2B invoice
Example B2B invoice
In this example, we’re issuing a B2B invoice from a Colombian supplier to another Colombian business customer.Notice:
- the
$schemais set tohttps://gobl.org/draft-0/bill/invoice, - the supplier uses Alegra’s sandbox NIT and the
seriesis theSETPtest series, so the example can be sent in the sandbox, - both parties carry the DIAN municipality code in the
co-dian-municipalityextension, - 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.
Example B2C invoice
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
simplifiedtag in thetax.tagsfield; 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
advanceanddueamounts, 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.
Example credit note
Example credit note
In this example, we’re issuing a credit note (nota de crédito) that corrects a previously issued invoice.Notice:
- the
typeis set tocredit-note, - the
seriesis set to a dedicated credit note series, separate from the invoice series, - the
precedingarray references the original invoice being corrected by itsseries,code, andissue_date, along with areasonfor the correction, - the correction concept is set with the
co-dian-credit-codeextension 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.
Example debit note
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
typeis set todebit-note, - the
seriesis set to a dedicated debit note series, separate from the invoice series; notes don’t need a numbering resolution, - the
precedingarray references the original invoice by itsseries,code, andissue_date, along with areasonfor the adjustment, - the preceding entry carries the
dian-cudestamp 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-codeextension 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
My GOBL document for a Colombian invoice fails to build because of the postal code
My GOBL document for a Colombian invoice fails to build because of the postal code
The DIAN expects a 5-digit municipal code, not a 6-digit postal code, in the supplier’s
co-dian-municipality extension.How does Invopop issue invoices in Colombia?
How does Invopop issue invoices in Colombia?
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.
What does a GOBL invoice need to be accepted by the DIAN?
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 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.Which taxes can appear on a Colombian invoice?
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.
Which document types can I issue in Colombia?
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.What are the sandbox limitations for Colombia?
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.Why was my invoice rejected for its series or number?
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 it expired or ran out and the supplier needs a new one from the DIAN.
🇨🇴 Invopop resources for Colombia
🇨🇴 Invopop resources for Colombia
Participate in our community
Ask and answer questions about invoicing in Colombia →