Documentation Index
Fetch the complete documentation index at: https://mintlify.com/farojas85/fast-rest-api/llms.txt
Use this file to discover all available pages before exploring further.
PedidoLocalResponse is the Pydantic model returned by POST /api/v1/pedidos/consumo-local/ on a successful DIAN submission. It wraps DIAN’s native response identifiers — the ZipKey tracking ID and the CUFE cryptographic hash — in a clean, typed structure that abstracts away the raw SOAP response format and provides a consistent JSON envelope for your POS integration to consume.
Response Schema
The class is defined alongside the request models insrc/infrastructure/controllers/schemas/pedido_local_schema.py:
Field Reference
DIAN’s
ZipKey returned by SendTestSetAsync (habilitación) or the equivalent production operation. This is the identifier of the submitted ZIP package containing the signed XML invoice. Use it to query DIAN’s service for the final asynchronous processing status of the document.Example: "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"Código Único de Factura Electrónica. The official DIAN-assigned identifier for a validated electronic invoice. It is a cryptographic hash derived from the invoice data and the issuer’s digital certificate. The CUFE must be printed on all physical and digital receipt copies to comply with Colombian electronic invoicing regulation.This field may be
null during habilitación (testing) mode — DIAN’s test environment returns mock data and does not always issue a real CUFE.Example: "VALID_CUFE_MOCK"Processing status string returned by DIAN, passed through directly from the SOAP adapter response. Common values observed in the habilitación environment include
"Procesado Correctamente" and "SUCCESS". In production this reflects the actual DIAN processing outcome.Example: "Procesado Correctamente"Human-readable summary message set by the controller. On a successful submission the controller sets this to
"Factura enviada correctamente a la DIAN". The use case itself uses "Factura procesada con éxito." when constructing the response object internally.Example: "Factura enviada correctamente a la DIAN"Example Responses
- Success (201)
- DIAN Error (500)
- Validation Error (422)
Returned when DIAN accepted the submitted document. HTTP status is
201 Created.What is the CUFE?
The CUFE (Código Único de Factura Electrónica) is the cryptographic hash that DIAN assigns to each validated electronic invoice document. It is derived from a concatenation of key invoice fields — including the invoice number, issue date, total amounts, tax values, and the issuer’s NIT — and is signed using the issuer’s digital certificate. The CUFE serves as the official legal identifier for the invoice and has the following significance:- It must be printed on all physical and digital receipt copies given to the customer.
- It is used to look up the invoice on the DIAN portal for verification.
- Its presence confirms that DIAN has validated and accepted the document — a document without a confirmed CUFE is not legally binding as an electronic invoice.
- During habilitación (testing) mode, DIAN returns a mock CUFE (or
null). Only invoices submitted through the production endpoint receive a real, legally valid CUFE.
The
cufe field is typed as Optional[str] because DIAN’s habilitación environment does not always return a real CUFE hash. Your POS integration should handle null gracefully during testing and only enforce CUFE presence in production workflows.Using the track_id
After a successful submission, thetrack_id (DIAN ZipKey) is your handle for querying the asynchronous processing status of the submitted ZIP file from DIAN’s validation pipeline.
How the flow works:
- Your POS sends
POST /api/v1/pedidos/consumo-local/with the invoice payload. - DIAN REST API builds a signed XML invoice, packages it as a ZIP, and calls
SendTestSetAsync(habilitación) or the equivalent production SOAP method. - DIAN returns a
ZipKeyimmediately — this becomes thetrack_idin the response. - DIAN then validates the document asynchronously. The final processing result (including the confirmed CUFE) is available by querying DIAN’s
GetStatusZipendpoint using thetrack_id.
- In habilitación testing, the response is mock data and
track_idvalues are not queryable against real DIAN systems. - In production, the CUFE is only issued after DIAN’s asynchronous validation completes. There may be a delay of seconds to minutes between submission and CUFE issuance.
- DIAN REST API currently returns the
track_idbut does not expose a dedicated status-query endpoint. Implement polling against DIAN’s SOAPGetStatusZipdirectly if your workflow requires confirmed CUFE retrieval.