> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cucu.bo/llms.txt
> Use this file to discover all available pages before exploring further.

# Revertir Anulacion

> Revierte la anulacion de una factura, devolviendola de CANCELLED a VALIDATED.

Revierte la anulación de una factura ante el SIAT: la factura vuelve del estado `CANCELLED` a `VALIDATED`, quedando fiscalmente válida de nuevo.

<Note>
  Solo funciona con facturas en estado `CANCELLED`. **No** aplica a facturas emitidas en modo offline
  (contingencia). El número de factura y el CUF se conservan.
</Note>

## Path Parameters

| Parametro | Tipo   | Req | Descripcion                                          |
| --------- | ------ | --- | ---------------------------------------------------- |
| `id`      | string | Si  | UUID de la factura cuya anulación se quiere revertir |

## Headers

| Parametro   | Tipo   | Req | Descripcion |
| ----------- | ------ | --- | ----------- |
| `X-API-Key` | string | Si  | Tu API Key  |

<RequestExample>
  ```bash cURL theme={"system"}
  curl -X POST "https://sandbox.cucu.bo/api/v1/invoices/a1b2c3d4-e5f6-7890-abcd-ef1234567890/revert-cancel" \
    -H "X-API-Key: YOUR_API_KEY"
  ```

  ```javascript JavaScript theme={"system"}
  const response = await fetch(
    'https://sandbox.cucu.bo/api/v1/invoices/a1b2c3d4-e5f6-7890-abcd-ef1234567890/revert-cancel',
    {
      method: 'POST',
      headers: { 'X-API-Key': 'YOUR_API_KEY' }
    }
  );
  const data = await response.json();
  ```

  ```python Python theme={"system"}
  import requests

  response = requests.post(
      'https://sandbox.cucu.bo/api/v1/invoices/a1b2c3d4-e5f6-7890-abcd-ef1234567890/revert-cancel',
      headers={'X-API-Key': 'YOUR_API_KEY'}
  )
  print(response.json())
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={"system"}
  {
    "success": true,
    "message": "Anulación revertida exitosamente",
    "data": {
      "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "invoiceNumber": 5,
      "cuf": "2872F7294502332E637FABFBC3654EA82202AD48E0969F14EBEB8AF74",
      "state": "VALIDATED",
      "siatState": "VALIDATED"
    },
    "timestamp": "2026-02-11T15:00:00"
  }
  ```

  ```json 409 theme={"system"}
  {
    "success": false,
    "error": {
      "code": "CONFLICT",
      "details": "La factura no está anulada (estado actual: VALIDATED)"
    },
    "timestamp": "2026-02-11T15:00:00"
  }
  ```
</ResponseExample>

<Info>
  Para anular una factura, ver [Anular Factura](/api/cancel-invoice). La reversión de anulación de
  **notas** de crédito/débito sigue el mismo patrón sobre el estado de la nota.
</Info>
