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

# DIAN issuing invoices guide

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

export const coDianInvoiceWorkflow = {
  "name": "DIAN issue invoice",
  "description": "Issue an invoice through DIAN and generate PDF",
  "schema": "bill/invoice",
  "steps": [{
    "id": "ece780f0-322c-11f0-bbb5-9da15d555d80",
    "name": "Set state",
    "provider": "silo.state",
    "summary": "Set state to `processing`{.state .processing}",
    "config": {
      "state": "processing"
    }
  }, {
    "id": "7d803770-322c-11f0-bbb5-9da15d555d80",
    "name": "Add sequential code",
    "provider": "sequence.enumerate",
    "summary": "Dynamic · DIAN · 1",
    "config": {
      "name": "Colombia",
      "padding": 1,
      "prefix": "",
      "start": 1
    }
  }, {
    "id": "fc75e4f0-8721-11ef-a962-73e3f2037a52",
    "name": "Sign envelope",
    "provider": "silo.close"
  }, {
    "id": "bde49770-322c-11f0-bbb5-9da15d555d80",
    "name": "Send invoice to DIAN",
    "provider": "plemsi"
  }, {
    "id": "cdf59920-322c-11f0-bbb5-9da15d555d80",
    "name": "Generate PDF",
    "provider": "pdf",
    "summary": "Spanish · Letter",
    "config": {
      "date_format": "%Y-%m-%d",
      "layout": "Letter",
      "locale": "es",
      "logo_height": 40
    }
  }, {
    "id": "9cebc6a0-322d-11f0-bbb5-9da15d555d80",
    "name": "Set state",
    "provider": "silo.state",
    "summary": "Set state to `sent`{.state .sent}",
    "config": {
      "state": "sent"
    }
  }],
  "rescue": [{
    "id": "e57671a0-322c-11f0-bbb5-9da15d555d80",
    "name": "Set state",
    "provider": "silo.state",
    "summary": "Set state to `error`{.state .error}",
    "config": {
      "state": "error"
    }
  }]
};

export const WorkflowDiagram = ({workflow}) => {
  const stateColors = {
    processing: "yellow",
    sent: "blue",
    received: "blue",
    registered: "green",
    completed: "green",
    error: "red"
  };
  const StateChip = ({state, label}) => <Badge size="sm" color={stateColors[state] || "gray"} icon="square-small" iconType="solid">
      {label.charAt(0).toUpperCase() + label.slice(1)}
    </Badge>;
  const providerIcons = {
    "silo.state": "https://silo.invopop.com/images/status.svg",
    "silo.close": "https://silo.invopop.com/images/check-badge.svg",
    "silo.if": "https://assets.invopop.com/apps/silo/if.svg",
    "silo.folder": "https://silo.invopop.com/images/folder.svg",
    "silo.modify": "https://silo.invopop.com/images/modify.svg",
    "silo.correct": "https://silo.invopop.com/images/replace.svg",
    "silo.sleep": "https://assets.invopop.com/icons/sleep.svg",
    silo: "https://assets.invopop.com/apps/silo/icon.svg",
    "sequence.enumerate": "https://sequence.invopop.com/images/enumerate.svg",
    "transform.job.create": "https://transform.invopop.com/images/jobs.svg",
    webhook: "https://webhook.invopop.com/icon.svg",
    lookup: "https://lookup.invopop.com/icon.png",
    dropbox: "https://dropbox.invopop.com/icon.png",
    pdf: "https://pdf.invopop.com/file-pdf.svg",
    peppol: "https://assets.invopop.com/apps/peppol/icon.svg",
    ubl: "https://assets.invopop.com/apps/ubl/logo.svg",
    cii: "https://assets.invopop.com/apps/cii/logo.svg",
    "gov-fr": "https://assets.invopop.com/flags/fr.svg",
    "chorus-pro": "https://assets.invopop.com/apps/chroruspro/icon.svg",
    "gov-es": "https://assets.invopop.com/apps/gov-es/icon.svg",
    "gov-es.sii": "https://assets.invopop.com/apps/sii/icon.svg",
    "gov-es.ticketbai": "https://assets.invopop.com/apps/ticketbai/icon.svg",
    "gov-es.facturae": "https://assets.invopop.com/apps/facturae/icon.svg",
    verifactu: "https://assets.invopop.com/apps/verifactu/icon.svg",
    "gov-pl": "https://assets.invopop.com/apps/ksef/icon.svg",
    "gov-sa": "https://assets.invopop.com/apps/zatca/icon.svg",
    "gov-ar": "https://assets.invopop.com/apps/arca/icon.svg",
    "at-pt": "https://assets.invopop.com/apps/at-pt/icon.svg",
    "sat-mx": "https://assets.invopop.com/apps/sat-mexico/icon.svg",
    "sw-sapien": "https://assets.invopop.com/apps/sw-sapien/icon.svg",
    "sdi-it": "https://assets.invopop.com/apps/sdi-italy/icon.svg",
    "ticket-it": "https://assets.invopop.com/apps/agenzia-entrate/icon.svg",
    "nfe-br": "https://assets.invopop.com/apps/notas-fiscais-eletronicas-brazil/icon.svg",
    chargebee: "https://assets.invopop.com/apps/chargebee/icon.svg",
    stripe: "https://assets.invopop.com/apps/stripe/icon.svg",
    email: "https://assets.invopop.com/apps/email/icon.svg",
    cron: "https://assets.invopop.com/apps/cron/icon.svg",
    ilyda: "https://assets.invopop.com/apps/ilyda/icon.svg",
    invoicexpress: "https://assets.invopop.com/apps/invoicexpress/icon.svg",
    plemsi: "https://assets.invopop.com/flags/co.svg"
  };
  const iconFor = provider => {
    const parts = (provider || "").split(".");
    for (let i = parts.length; i > 0; i--) {
      const url = providerIcons[parts.slice(0, i).join(".")];
      if (url) return url;
    }
    return null;
  };
  const StepIcon = ({provider}) => {
    const url = iconFor(provider);
    return <span title={provider} className="flex h-7 w-7 shrink-0 items-center justify-center rounded-md border border-gray-950/10 bg-white dark:border-white/10 dark:bg-white/5">
        {url ? <img src={url} alt="" className="h-4 w-4" /> : null}
      </span>;
  };
  const renderSummary = summary => {
    const nodes = [];
    const re = /`([^`]+)`(\{[^}]*\})?/g;
    let last = 0;
    let m;
    let k = 0;
    while ((m = re.exec(summary)) !== null) {
      if (m.index > last) nodes.push(summary.slice(last, m.index));
      const attrs = m[2] || "";
      if (attrs.indexOf(".state") >= 0) {
        const state = (attrs.match(/\.state\s+\.([\w-]+)/) || [])[1] || m[1];
        nodes.push(<StateChip key={k++} state={state} label={m[1]} />);
      } else if (attrs) {
        nodes.push(<span key={k++} className="text-sm font-medium text-gray-700 dark:text-gray-300">
            {m[1]}
          </span>);
      } else {
        nodes.push(<code key={k++} className="text-sm rounded bg-gray-100 px-1 font-mono text-sm dark:bg-white/10">
            {m[1]}
          </code>);
      }
      last = m.index + m[0].length;
    }
    if (last < summary.length) nodes.push(summary.slice(last));
    return nodes;
  };
  const NoteRow = ({text}) => <div className="mt-4 mb-1 font-mono text-sm leading-5 text-gray-400 dark:text-gray-500">{"// " + text}</div>;
  const renderSteps = (steps, counter) => (steps || []).map(step => {
    counter.n += 1;
    const n = counter.n;
    const branches = (step.next || []).filter(b => b.steps && b.steps.length > 0);
    return <div key={step.id || "step-" + n}>
          {step.notes ? <NoteRow text={step.notes} /> : null}
          <div className="mt-2.5 flex items-center">
            <span className="absolute left-0 w-10 text-center font-mono text-sm text-gray-400 select-none dark:text-gray-500">
              {n}
            </span>
            <div className="flex min-w-0 flex-1 items-center gap-2 rounded-xl border border-gray-950/5 bg-white px-2 py-2 dark:border-white/10 dark:bg-gray-900">
              <StepIcon provider={step.provider} />
              <span className="text-sm shrink-0 font-medium text-gray-900 dark:text-gray-100">{step.name}</span>
              {step.summary ? <span className="text-sm min-w-0 truncate text-gray-500 dark:text-gray-400">{renderSummary(step.summary)}</span> : null}
            </div>
          </div>
          {branches.length > 0 ? <div className="ml-5 border-l border-gray-200 -my-1 py-1 pl-6 dark:border-white/10">
              {branches.map((branch, bi) => <div key={branch.code || branch.status || bi}>
                  <div className="mt-4">
                    <span className="rounded-md bg-gray-200/70 px-2 py-1 font-mono text-sm text-gray-600 dark:bg-white/10 dark:text-gray-300">
                      {branch.code || branch.status}
                    </span>
                  </div>
                  {renderSteps(branch.steps, counter)}
                </div>)}
            </div> : null}
        </div>;
  });
  const counter = {
    n: 0
  };
  const wf = workflow || ({});
  return <div className="not-prose relative my-5 rounded-2xl border border-gray-950/5 bg-gray-50 py-3 pr-4 pb-5 pl-12 dark:border-white/10 dark:bg-white/[0.03]">
      {renderSteps(wf.steps, counter)}
      {wf.rescue && wf.rescue.length > 0 ? <div className="mt-6 border-t border-dashed border-gray-300 dark:border-white/10">
          <NoteRow text="If any step fails" />
          {renderSteps(wf.rescue, counter)}
        </div> : null}
    </div>;
};

## 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.

Invopop has partnered with [Plemsi](https://plemsi.com) to issue invoices in Colombia (DIAN). You have the option of either using Invopop's Plemsi billing account or create your own and provide your own credentials.

This guide will walk you through the steps necessary to set up the workflows that will allow you to issue [GOBL](https://docs.gobl.org) documents in Colombia using Plemsi as a provider. For onboarding suppliers with the DIAN and Plemsi, see the companion guide: [Colombia: Supplier registration](/guides/co-dian-supplier).

| -          | Sandbox                                                           | Live               |
| ---------- | ----------------------------------------------------------------- | ------------------ |
| **Series** | Only `SETT` (invoice) and `NCTT` (credit note) with shared ranges | Full configuration |

Please refer to the docs of the [GOBL's Colombia Tax Regime](https://github.com/invopop/gobl/blob/main/regimes/co/README.md) to learn about the specifics of Colombian GOBL documents and to obtain examples.

## Prerequisites

In order to complete this guide in a live Invopop environment, you will need:

* A registered supplier: follow the [DIAN supplier registration guide](/guides/co-dian-supplier) to authorize Plemsi in the DIAN and set up the supplier's Plemsi account before issuing.
* Customer details for B2B transactions, including name, RUT or international ID, address, and municipality code for national transactions.
* 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.

## Sandbox limitations

When using Plemsi's sandbox environment (see the [supplier registration guide](/guides/co-dian-supplier#sandbox) for how to enable it), bear in mind:

* There's only one supplier enabled. Its tax code is `9015852843`.
* There's only one series enabled for invoices (`SETT`) and another one for credit notes (`NCTT`). Moreover, those series are shared and, to avoid collisions, we'll provide you with a specific range for you to use (e.g. `SETT-123xxxx`)

Your test invoices will need to use the supplier's tax ID code and series above.

## Setup

<Info>
  The supplier must already be registered with the DIAN and Plemsi — this is covered in the [supplier registration guide](/guides/co-dian-supplier).
</Info>

<Steps>
  <Step title="Create a workflow">
    <Card iconType="duotone" title="DIAN-Colombia Invoice Workflow" icon="code-branch" href="https://console.invopop.com/redirect/workflows/new?template=co-dian-invoice" horizontal>
      Add to my workspace →
    </Card>

    <Tabs>
      <Tab title="Workflow">
        <WorkflowDiagram workflow={coDianInvoiceWorkflow} />
      </Tab>

      <Tab title="Code">
        Copy and paste into a new [Empty Invoice workflow](https://console.invopop.com/redirect/workflows/new?template=empty-invoice) code view.

        ```json Example DIAN issue invoice workflow theme={null}
        {
          "name": "DIAN issue invoice",
          "description": "Issue an invoice through DIAN and generate PDF",
          "schema": "bill/invoice",
          "steps": [
            {
              "id": "ece780f0-322c-11f0-bbb5-9da15d555d80",
              "name": "Set state",
              "provider": "silo.state",
              "summary": "Set state to `processing`{.state .processing}",
              "config": {
                "state": "processing"
              }
            },
            {
              "id": "7d803770-322c-11f0-bbb5-9da15d555d80",
              "name": "Add sequential code",
              "provider": "sequence.enumerate",
              "summary": "Dynamic · DIAN · 1",
              "config": {
                "name": "Colombia",
                "padding": 1,
                "prefix": "",
                "start": 1
              }
            },
            {
              "id": "fc75e4f0-8721-11ef-a962-73e3f2037a52",
              "name": "Sign envelope",
              "provider": "silo.close"
            },
            {
              "id": "bde49770-322c-11f0-bbb5-9da15d555d80",
              "name": "Send invoice to DIAN",
              "provider": "plemsi"
            },
            {
              "id": "cdf59920-322c-11f0-bbb5-9da15d555d80",
              "name": "Generate PDF",
              "provider": "pdf",
              "summary": "Spanish · Letter",
              "config": {
                "date_format": "%Y-%m-%d",
                "layout": "Letter",
                "locale": "es",
                "logo_height": 40
              }
            },
            {
              "id": "9cebc6a0-322d-11f0-bbb5-9da15d555d80",
              "name": "Set state",
              "provider": "silo.state",
              "summary": "Set state to `sent`{.state .sent}",
              "config": {
                "state": "sent"
              }
            }
          ],
          "rescue": [
            {
              "id": "e57671a0-322c-11f0-bbb5-9da15d555d80",
              "name": "Set state",
              "provider": "silo.state",
              "summary": "Set state to `error`{.state .error}",
              "config": {
                "state": "error"
              }
            }
          ]
        }
        ```
      </Tab>
    </Tabs>
  </Step>
</Steps>

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

## Examples

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 DIAN Colombia workflow created during setup.

[GOBL Invoices](https://docs.gobl.org/draft-0/bill/invoice) sent to 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`](https://docs.gobl.org/addons/co-dian-v2) extension. Colombian customers need it too.

<AccordionGroup>
  <Accordion title="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),
    * the supplier's `tax_id` country is set to `CO`, and the DIAN municipality code is set with the `co-dian-municipality` extension on the party,
    * the customer details include full address, email, and telephone information,
    * 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.

    <CodeGroup>
      ```json DIAN Colombia B2B Invoice theme={null}
      {
        "$schema": "https://gobl.org/draft-0/bill/invoice",
        "type": "standard",
        "series": "SETT",
        "code": "1234",
        "issue_date": "2021-01-01",
        "currency": "COP",
        "supplier": {
          "name": "EXAMPLE SUPPLIER S.A.S.",
          "tax_id": {
            "country": "CO",
            "type": "tin",
            "code": "9014514812"
          },
          "ext": {
            "co-dian-municipality": "11001"
          }
        },
        "customer": {
          "name": "EXAMPLE CUSTOMER S.A.S.",
          "tax_id": {
            "country": "CO",
            "type": "tin",
            "code": "9014514805"
          },
          "ext": {
            "co-dian-municipality": "11001"
          },
          "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"
            }
          ]
        },
        "lines": [
          {
            "quantity": "1",
            "item": {
              "name": "Servicios Mes de Julio 2022",
              "price": "200000.00"
            },
            "taxes": [
              {
                "cat": "VAT",
                "percent": "19%"
              }
            ]
          }
        ],
        "payment": {
          "terms": {
            "due_dates": [
              {
                "date": "2021-01-01",
                "percent": "100%"
              }
            ]
          }
        }
      }
      ```

      ```json Built version theme={null}
      {
      	"$schema": "https://gobl.org/draft-0/bill/invoice",
      	"$regime": "CO",
      	"type": "standard",
      	"series": "SETT",
      	"code": "1234",
      	"issue_date": "2021-01-01",
      	"currency": "COP",
      	"supplier": {
      		"name": "EXAMPLE SUPPLIER S.A.S.",
      		"tax_id": {
      			"country": "CO",
      			"code": "9014514812",
      			"type": "tin"
      		},
      		"ext": {
      			"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-municipality": "11001"
      		}
      	},
      	"lines": [
      		{
      			"i": 1,
      			"quantity": "1",
      			"item": {
      				"name": "Servicios Mes de Julio 2022",
      				"price": "200000.00"
      			},
      			"sum": "200000.00",
      			"taxes": [
      				{
      					"cat": "VAT",
      					"key": "standard",
      					"percent": "19%"
      				}
      			],
      			"total": "200000.00"
      		}
      	],
      	"payment": {
      		"terms": {
      			"due_dates": [
      				{
      					"date": "2021-01-01",
      					"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"
      	}
      }
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="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 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.

    <CodeGroup>
      ```json DIAN Colombia B2C Invoice theme={null}
      {
        "$schema": "https://gobl.org/draft-0/bill/invoice",
        "type": "standard",
        "series": "SETT",
        "code": "1234",
        "issue_date": "2021-01-01",
        "currency": "COP",
        "tax": {
          "tags": [
            "simplified"
          ]
        },
        "supplier": {
          "name": "EXAMPLE SUPPLIER S.A.S.",
          "tax_id": {
            "country": "CO",
            "type": "tin",
            "code": "9014514812"
          },
          "ext": {
            "co-dian-municipality": "11001"
          }
        },
        "lines": [
          {
            "quantity": "1",
            "item": {
              "name": "Useful service",
              "price": "200000.00"
            },
            "taxes": [
              {
                "cat": "VAT",
                "percent": "19%"
              }
            ]
          }
        ],
        "payment": {
          "advances": [
            {
              "description": "Prepaid",
              "percent": "100%"
            }
          ]
        }
      }
      ```

      ```json Built version theme={null}
      {
      	"$schema": "https://gobl.org/draft-0/bill/invoice",
      	"$regime": "CO",
      	"$tags": [
      		"simplified"
      	],
      	"type": "standard",
      	"series": "SETT",
      	"code": "1234",
      	"issue_date": "2021-01-01",
      	"currency": "COP",
      	"tax": {},
      	"supplier": {
      		"name": "EXAMPLE SUPPLIER S.A.S.",
      		"tax_id": {
      			"country": "CO",
      			"code": "9014514812",
      			"type": "tin"
      		},
      		"ext": {
      			"co-dian-municipality": "11001"
      		}
      	},
      	"lines": [
      		{
      			"i": 1,
      			"quantity": "1",
      			"item": {
      				"name": "Useful service",
      				"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"
      	}
      }
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="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 the credit note series (`NCTT` in the sandbox environment, which is separate from the `SETT` 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 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.

    <CodeGroup>
      ```json DIAN Colombia Credit Note theme={null}
      {
        "$schema": "https://gobl.org/draft-0/bill/invoice",
        "type": "credit-note",
        "series": "NCTT",
        "code": "5678",
        "issue_date": "2021-01-15",
        "currency": "COP",
        "preceding": [
          {
            "type": "standard",
            "series": "SETT",
            "code": "1234",
            "issue_date": "2021-01-01",
            "reason": "Servicios no prestados"
          }
        ],
        "supplier": {
          "name": "EXAMPLE SUPPLIER S.A.S.",
          "tax_id": {
            "country": "CO",
            "type": "tin",
            "code": "9014514812"
          },
          "ext": {
            "co-dian-municipality": "11001"
          }
        },
        "customer": {
          "name": "EXAMPLE CUSTOMER S.A.S.",
          "tax_id": {
            "country": "CO",
            "type": "tin",
            "code": "9014514805"
          },
          "ext": {
            "co-dian-municipality": "11001"
          },
          "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"
            }
          ]
        },
        "lines": [
          {
            "quantity": "1",
            "item": {
              "name": "Servicios Mes de Julio 2022",
              "price": "200000.00"
            },
            "taxes": [
              {
                "cat": "VAT",
                "percent": "19%"
              }
            ]
          }
        ]
      }
      ```

      ```json Built version theme={null}
      {
      	"$schema": "https://gobl.org/draft-0/bill/invoice",
      	"$regime": "CO",
      	"type": "credit-note",
      	"series": "NCTT",
      	"code": "5678",
      	"issue_date": "2021-01-15",
      	"currency": "COP",
      	"preceding": [
      		{
      			"type": "standard",
      			"issue_date": "2021-01-01",
      			"series": "SETT",
      			"code": "1234",
      			"reason": "Servicios no prestados"
      		}
      	],
      	"supplier": {
      		"name": "EXAMPLE SUPPLIER S.A.S.",
      		"tax_id": {
      			"country": "CO",
      			"code": "9014514812",
      			"type": "tin"
      		},
      		"ext": {
      			"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-municipality": "11001"
      		}
      	},
      	"lines": [
      		{
      			"i": 1,
      			"quantity": "1",
      			"item": {
      				"name": "Servicios Mes de Julio 2022",
      				"price": "200000.00"
      			},
      			"sum": "200000.00",
      			"taxes": [
      				{
      					"cat": "VAT",
      					"key": "standard",
      					"percent": "19%"
      				}
      			],
      			"total": "200000.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"
      	}
      }
      ```
    </CodeGroup>
  </Accordion>
</AccordionGroup>

## FAQ

<AccordionGroup>
  <Accordion title="My GOBL document for a Colombian invoice fails to build because of the postal code">
    The DIAN requires a [Municipal Code](https://www.dian.gov.co/atencionciudadano/formulariosinstructivos/Formularios/2007/Codigos_municipios_2007.pdf) rather than a postal code to specify the municipality of the supplier. Make sure you are setting a municipal code (5 digits) and not a postal code (6 digits) in the supplier's [`co-dian-municipality`](https://docs.gobl.org/addons/co-dian-v2) extension.
  </Accordion>

  <Accordion title="How does Invopop issue invoices in Colombia?">
    Through [Plemsi](https://plemsi.com), an authorized technology provider for DIAN electronic invoicing. The [DIAN Colombia workflow](/guides/co-dian) signs the GOBL envelope, sends the invoice to the DIAN via Plemsi, receives the CUFE, and generates a compliant PDF with the DIAN QR code.
  </Accordion>

  <Accordion title="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`](https://docs.gobl.org/addons/co-dian-v2) extension in each party's `ext`. 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>

  <Accordion title="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 are supported by the [GOBL Colombia tax regime](https://docs.gobl.org/regimes/co#tax-categories).
  </Accordion>

  <Accordion title="Can I issue credit notes through Invopop in Colombia?">
    Yes. The same DIAN Colombia workflow handles invoices and credit notes when configured with a dynamic sequential code, so each document type draws from its own authorized numbering range.
  </Accordion>

  <Accordion title="What are the sandbox limitations for Colombia?">
    Plemsi's sandbox has a single enabled supplier (tax code `9015852843`) and one series per document type: `SETT` for invoices and `NCTT` for credit notes. The series are shared across users, so we assign you a specific number range to avoid collisions. Contact us via Slack or [support@invopop.com](mailto:support@invopop.com) to enable the sandbox in your workspace.
  </Accordion>
</AccordionGroup>

More available in our [Colombia FAQ](/faq/colombia) section

***

<AccordionGroup>
  <Accordion title="🇨🇴 Invopop resources for Colombia">
    |            |                                                                                                                                                                                                                                                   |
    | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
    | Compliance | <Icon icon="https://assets.invopop.com/flags/co.svg" /> [Invoicing compliance in Colombia](/compliance/colombia)<br /> <Icon icon="timeline" /> [Compliance timeline](/timelines/colombia)                                                        |
    | Apps       | <Icon icon="https://assets.invopop.com/apps/dian-colombia/icon.svg" /> [DIAN Colombia](/apps/dian-colombia)                                                                                                                                       |
    | Guides     | <Icon icon="book" /> [Supplier registration](/guides/co-dian-supplier)<br /> <Icon icon="book" /> [Issuing invoices](/guides/co-dian)                                                                                                             |
    | FAQ        | <Icon icon="square-question" /> [Colombia FAQ](/faq/colombia)                                                                                                                                                                                     |
    | GOBL       | <Icon icon="https://assets.invopop.com/icons/gobl.svg" />  [Colombia Tax Regime](https://docs.gobl.org/regimes/co)<br /> <Icon icon="https://assets.invopop.com/icons/gobl.svg" /> [Colombia DIAN Addon](https://docs.gobl.org/addons/co-dian-v2) |
  </Accordion>
</AccordionGroup>

<Card title="Participate in our community" icon="forumbee" href="https://community.invopop.com" arrow="true" horizontal>
  Ask and answer questions about invoicing in Colombia →
</Card>
