> For the complete documentation index, see [llms.txt](https://aplazo.gitbook.io/aplazo-integrations/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://aplazo.gitbook.io/aplazo-integrations/online-api/other-flows/cancellation-flow.md).

# Cancellation Flow

A payment (or loan) can be canceled at any point before the user completes payment. In Aplazo’s system, this corresponds to the payment having a `NO CONFIRMADO` status. Once the payment status becomes `ACTIVE`, it can no longer be canceled, instead it can be [refunded](/aplazo-integrations/online-api/other-flows/refunds-flow.md) if necessary.

#### Common Reasons for Cancellation

* **Abandoned Checkout**: The user navigates away or fails to complete the purchase.
* **Timeout**: The system automatically cancels the payment after a predefined period of inactivity.

{% hint style="warning" %}
**Important**: Aplazo does not trigger cancellations automatically. It is the merchant’s responsibility to detect when a transaction should be canceled (e.g., if the user abandons checkout) and send the necessary [cancellation request](/aplazo-integrations/api-reference/online-api/cancel-payment.md) to Aplazo.
{% endhint %}

## Cancellation Steps

{% stepper %}
{% step %}

### Authenticate

Call the **Authentication** endpoint to obtain a Bearer token, which you’ll include in all subsequent requests.
{% endstep %}

{% step %}

### Request Payment

Initiate a payment request to generate the Aplazo checkout URL.
{% endstep %}

{% step %}

### Redirect Customer

Redirect the customer to the Aplazo checkout URL.
{% endstep %}

{% step %}

### Customer Does Not Complete Payment

If the customer leaves the checkout flow or fails to make the first payment, the payment remains `NO CONFIRMADO`.
{% endstep %}

{% step %}

### Merchant Initiates Cancellation

If you determine the transaction should not be completed (e.g., abandoned cart or a timeout), call the [Request Payment Cancellation](/aplazo-integrations/api-reference/online-api/cancel-payment.md) endpoint.
{% endstep %}

{% step %}

### **Cancellation Finalized**

Aplazo sets the payment status to `CANCELADO / DEVUELTO`, and no further action is needed.&#x20;
{% endstep %}
{% endstepper %}

Once the payment is canceled, it cannot be recovered. If the user wishes to continue the purchase afterward, they must initiate a new payment request.
