> For the complete documentation index, see [llms.txt](https://docs.payvalida.com/api-tarjeta/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.payvalida.com/api-tarjeta/master/pre-autorizacion/cancelar-pre-autorizaciones.md).

# Cancelar pre-autorizaciones

Con este campo opcional `transaction_type` para [anulaciones](/api-tarjeta/master/anulaciones/anulaciones.md) se puede gestionar la cancelación de una de pre-autorizaciones no completada

**Parámetros en formato JSON en el cuerpo de la petición POST**

{% tabs %}
{% tab title="Parámetros" %}

| Campo             | Requerido | Tipo         | Descripción                                                                                                                                                                      |
| ----------------- | --------- | ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| order\_number     | si        | Numérico     | Número de la orden,el mismo que es devuelto al comercio al momento de [registrar](https://docs.payvalida.com/api-recaudo/ordenes-de-compra/registrar) la transacción (PVordenID) |
| merchant\_name    | si        | Alfanumérico | Nombre identificador del comercio.                                                                                                                                               |
| checksum          | si        | Alfanumérico | Checksum formado de la siguiente manera: SHA512(merchant\_name + order\_number + fixed\_hash)                                                                                    |
| transaction\_type | No        | Alfanumérico | Para cancelar transacciones de preautorización que no han sido completadas se debe enviar el valor "PRE\_AUTH"                                                                   |
| {% endtab %}      |           |              |                                                                                                                                                                                  |

{% tab title="Request" %}

```postman_json
{
  "order_number": 2402558,
  "merchant_name": "some_merchant",
  "checksum": "fd8656323d70da776fed8fcfb04f59f582fccba022fa2cd48f4056ed221fd01fea1831dfc0296093f26a27a227ea630b93c6532d93e3f38d27b89ae26e07b6fe"
  "transaction_type": "PRE_AUTH"
}
```

{% endtab %}

{% tab title="Response" %}

```json
{
    "CODE": "0000",
    "DESC": "transaction canceled successfully"
}
```

{% hint style="danger" %}
Se debe tener que cuenta que para confirmar que la transacción fue cancelada correctamente, el api debe responder con los códigos 0000 o 0001, en caso contrario, hubo algún problema en el proceso.
{% endhint %}
{% endtab %}

{% tab title="Códigos respuesta" %}
Los siguientes códigos hacen referencia a que la anulación se realizó correctamente:

0000: transacción cancelada correctamente&#x20;

0001: esta transacción ya se canceló anteriormente

0017: "transaction was not reversed, try again"

{% hint style="warning" %}
El codigo "0017" sucede cuando hay un error parcial (se completo pero no se reverso) y la preautorizacion no se cancelo completamente el comercio puede reintentar la cancelación
{% endhint %}
{% endtab %}
{% endtabs %}

{% hint style="warning" %}
El tiempo de respuesta para la liberación del dinero es gestionado por el banco emisor, con un periodo de procesamiento estándar de 1 a 15 días hábiles tras la ejecución de la cancelación.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.payvalida.com/api-tarjeta/master/pre-autorizacion/cancelar-pre-autorizaciones.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
