Skip to content
  1. Fetch the document (GET /dte/{codigo}) and confirm it is procesado: only those can be invalidated; otherwise, 409 estado_invalido.
  2. If it has an active return event, the API responds 409 retorno_vigente with details.codigoGeneracion: invalidate that return first.
  3. Check the deadline:
    • Invoice (01), Export Invoice (11), and Excluded Subject Invoice (14): 3 months from the stamp.
    • All others (Tax Credit Invoice 03, notes 05/06, etc.): until the 10th business day of the month following issuance. This includes Settlement Receipt (08), Settlement Accounting Document (09), and Donation Receipt (15).
    • Past the deadline, the MH rejects it (422 invalidacion_rechazada). For an expired CCF, the usual route is a Credit Note (05).
tipoAnulacion When Requires
1 Error in the information codigoGeneracionReemplazo (issue the correct one first)
2 Rescinding the operation (the sale didn’t happen) —
3 Other motivoAnulacion and codigoGeneracionReemplazo

Credit Notes (05), Settlement Receipts (08), and events take no replacement document: they are invalidated and the correct one is issued afterwards, so codigoGeneracionReemplazo is ignored.

Optional: solicitante (defaults to the document’s recipient) and responsable (defaults to the one configured on the issuer), each { nombre, tipoDocumento, numDocumento }.

Ventana de terminal
curl https://app.openfactura.co/api/v1/dte/0862382B-0BB8-42A0-BB6B-B42DCCDF1EA4/invalidar \
-H "Authorization: Bearer $OPENFACTURA_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "tipoAnulacion": 2, "motivoAnulacion": "Operación rescindida" }'

The response is the document, now in status invalidado.

The same route invalidates a return or special operations event when given its generation code. It then responds { "invalidado": true, "tipo": "retorno", "codigoGeneracion": "…" }. A return can be invalidated within 4 days of its stamp.

For AI assistants: llms.txt ·llms-full.txt ·every page as Markdown by adding .md to its path.