The Spanish version is the authoritative reference. View in Spanish
π¨π΄ Colombia
This sheet assumes you know the xPOS-Core communication protocol. Here we only document what is specific to Colombia.
Summaryβ
| Aspect | Value |
|---|---|
country code | co |
| Tax authority | DIAN |
| Pattern | C β dual XML (DTE / equivalent DTE) |
Supported inputType | json, xml, xdoc, txt |
| Extra endpoint | β |
| Output | Signed tax XML |
XSLT mappingβ
| XSLT | Use |
|---|---|
input_to_dte_co.xslt | json and xml inputs β XML <root> β Gosocket XML. |
other_to_dte_co.xslt | txt input β Gosocket XML. Does not go through input_to_dte. |
xdoc_to_dte_co.xslt | xdoc input β Gosocket XML. Does not go through input_to_dte. |
dte_to_fiscal_co.xslt | Gosocket XML β DIAN tax DTE. |
dteEQ_to_fiscal_co.xslt | Gosocket XML β DIAN equivalent DTE (depending on document type). |
custom_response_co.xslt | Generates custom_response when applicable. |
Document types (typeDoc)β
WebSocket example uses
typeDoc=01(electronic invoice). The parameter is numeric:typeDoc=1andtypeDoc=01are equivalent.
typeDoc | Document |
|---|---|
| 01 | Electronic sales invoice |
| 02 | Electronic sales invoice β export |
| 03 | Electronic transmission document β issuer contingency |
| 04 | Electronic sales invoice β type 04, DIAN contingency |
| 07 | Electronic equivalent document β issuer contingency |
| 08 | Electronic equivalent document β DIAN contingency |
| 20 | Electronic POS equivalent document |
| 25 | Cinema admission ticket |
| 27 | Public shows admission ticket |
| 30 | Document in localized and non-localized games |
| 35 | Land passenger transport ticket |
| 40 | Document issued for toll collection |
| 45 | Statement issued by financial companies and funds |
| 50 | Air passenger transport ticket |
| 55 | Stock, agricultural and commodities exchange operation document |
| 60 | Document issued for public and residential services |
| 91 | Credit note |
| 92 | Debit note |
In contingency, the invoice (01) is converted to type 03 (issuer contingency) or 04 (DIAN contingency), and the equivalent document to 07 or 08, with the same criterion. See Contingency codes. Notes (91 and 92) validate against their own schema.
Colombia-specific response fieldsβ
Colombia returns the entire core + full tax echo + two exclusive fields:
| Field | Description |
|---|---|
docNumber | Series and number of the document (e.g. SETP990044419). |
contingencyCode | Contingency code: 03, 04, 07 or 08. See Contingency codes. |
countryIdentificationCode in Colombia is CUFE (electronic invoice) or CUDE (equivalent document) depending on the type.
Contingency codes (contingencyCode)β
Colombia distinguishes issuer contingency βno internet connection or another failure on the issuer's sideβ from DIAN contingency, when the DIAN has problems or is down. The contingencyCode value matches the document type xPOS generates:
contingencyCode | Type | Contingency | Source document | Generated document |
|---|---|---|---|---|
03 | Automatic | Issuer | Invoice | Type 03 invoice |
07 | Automatic | Issuer | Equivalent document | Type 07 equivalent document |
04 | Automatic | DIAN | Invoice | Type 04 invoice |
08 | Automatic | DIAN | Equivalent document | Type 08 equivalent document |
DIAN contingency is declared when the DIAN answers with a service error (403, 500, 503, 507 or 508) after 3 retries. The dashboard's manual contingency emulates an internet outage: it uses the issuer contingency codes (03 and 07).
WebSocket exampleβ
{
"env": "sbx",
"operation": "consolidate",
"typeDoc": 1,
"country": "co",
"inputType": "json",
"origin": "<issuer taxId>",
"document": { /* factura electronica o documento equivalente */ }
}Status re-retrievalβ
The /api/v1/status response in Colombia includes, in addition to the core, these fields:
| Field | Description |
|---|---|
signedXml | Signed tax XML with folio. |
param | test or consolidate. |
typedoc | DTE type. |
date | Transaction date (yyyy-mm-ddTHH:mm:ss). |
Local contingency (type 03)β
When the issuer cannot communicate with the DIAN βfor example, without an internet connectionβ, xPOS converts and issues the document in its issuer contingency modality (type 03) locally on the device, without depending on external services, and regularizes it later once the authority recovers.
To have this functionality it is required to have the Folio Manager enabled and to request its activation from the Gosocket consulting team.
On devices with several issuers, contingency is independent per company: it is activated only for the affected company and the others keep issuing online.
Particular notesβ
- Pattern C: the flow branches the XSLT depending on the document type (electronic invoice vs equivalent document).
- Publishes in Inbox-Gosocket.
Changes in version 2.7.0β
- Local contingency (type 03) resolved on the device β see its own section.
- More precise Rule 90: the message retrieves the previously accepted document by querying the correct environment of each company.
- DIAN response readable on screen, with the View TA response option of the dashboard.
- Fix of the date format in the self-reference that the DIAN observed in certain contingency documents.
- The configuration download leaves the installation exactly as the portal defines it.