> 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/anulaciones/anulaciones.md).

# Anulaciones

<div align="left"><figure><img src="/files/Brpfk94OH6kO3jtnjXWa" alt="" width="412"><figcaption></figcaption></figure></div>

{% hint style="warning" %}
Para utilizar este servicio tanto en producción como en el entorno de pruebas (sandbox), debes ponerte en contacto con <support@payvalida.com> para solicitar su activación.
{% endhint %}

{% hint style="success" %}
**Producción:** [**https://api.payvalida.com/v4/merchant/transaction/cancel**](https://api.payvalida.com/v4/merchant/transaction/cancel)
{% endhint %}

{% hint style="success" %}
**Sandbox:** [**https://api-test**](https://api-test.payvalida.com/api/v3/checkout/tc/cancel)**.**[**payvalida.com/v4/merchant/transaction/cancel**](https://api.payvalida.com/v4/merchant/transaction/cancel)
{% endhint %}

**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)                                                                                    |
| {% endtab %}   |           |              |                                                                                                                                                                                  |

{% tab title="Request" %}

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

{% 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 anulada 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 0001: esta transacción ya se canceló anteriormente
{% endtab %}
{% endtabs %}

{% hint style="warning" %}
Los tiempos en los que se aceptan las anulaciones depende de la red procesadora y las franquicias, en caso de tener dudas con respecto a las anulaciones pueden escribir a <support@payvalida.com>.
{% 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/anulaciones/anulaciones.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.
