# Cancellations and Refunds

This guide covers the procedures for stopping an ongoing technical process on the Pinpad and explains the distinction between a technical cancellation and a financial refund.

## Technical cancellation (Y06)

A technical cancellation using the **Y06** command immediately aborts the current operation being executed by the Pinpad. It is used to interrupt a process **before** a transaction has been authorized.

### Common use cases

* The operator cancels the transaction on the Host System software.
* A timeout occurs on the Host System, requiring a terminal state reset.
* The user is taking too long to act, and the Host System decides to abort.

### Implementation and behavior

To stop the terminal, the Host System sends the `Y06` requirement.

* **Command Payload**: Includes the Command ID (`Y06`) and the **TOM** field.
* **Timeout (`TOM`)**: Establishes a new wait time (in seconds). Once this time expires without a message from the Host, a cancellation is triggered. This value must be sent as ASCII (e.g., `30 36 30` for 60 seconds).
* **Terminal Response**:
  * The Pinpad returns an **ACK**.
  * If received while the Pinpad is in **IDLE** (reposo) or during a Contactless account request, it also responds with an **EOT**.
  * If received during a **QR (Y0Q)** display, the Pinpad returns a `Y0Q` response with status `STS = 01`.
* **Visual Feedback**: The terminal displays **"Operación Cancelada"** for 3 seconds before returning to the idle screen.

> **Y06 Ignored Scenarios**: This command is ignored if the secure keyboard is visible for PIN entry. Furthermore, if received during the execution of `Y19`, `Y02`, `Y03`, or `YDL`, the Pinpad will provide no additional response beyond the initial **ACK**.

### User-initiated cancellation

If the user presses the physical red **Cancel** button on the Pinpad keypad (during PIN entry or general flows), the device aborts the process and returns an Error response (**Y0E**) to the Host System with code **"01"** (Cancelled).

## Financial refunds (transaction type 20)

A financial refund (**Devolución**) is a financial reversal used **after** a transaction has been authorized. The Pinpad acts as a peripheral to read the card again and generate the necessary cryptograms.

> **Argentina Refund Rules:**
> * **Card/Wallet:** Supports Total Cancellation (\$D+0\$), Total Refund (\$D+N\$), and Partial Refund (\$D+N\$).
> * **QR Card:** Supports Total Cancellation (\$D+0\$), Total Refund (\$D+N\$), and Partial Refund (\$D+N\$).
> * Getnet manages the remaining balance for all partial refunds.

> **QR PCT Restrictions:** The following operations are **not supported** for QR PCT transactions: Total Cancellation (\$D+0\$), Total/Partial Refund (\$D+N\$), and Reversals.

### Implementation

To initiate a refund, use the standard payment flow (Y19 → Y15 → Y02) with these parameters:

1. **Y19 Initialization**: Set the **Transaction Type (TTY)** to **"20"**.
2. **Amount Specification**: Provide the exact amount to be refunded in the **\[IMP]** field.
3. **Execution**: The terminal UI explicitly indicates that a **Refund/Anulación** is in progress.
   * **Contactless**: Completes with the `Y19` response.
   * **Chip/Banda**: Requires the `Y02` command to retrieve encrypted tracks.

The Host System then processes the payload against the Authorizer to reverse the funds.

## Automated error reports (Y0E)

When an operation fails or is stopped, the Pinpad sends a **Y0E** report. Key codes in the **\[COE]** field include:

* **"01"**: Cancelled (User pressed the red button or Host sent `Y06`).
* **"07"**: Timeout (Wait time exceeded for user action or command).

## Next steps

With cancellation and refund procedures implemented, you can finalize your integration by reviewing:

* [**QR Code Payments**](https://docs.globalgetnet.com/en/products/in-store-payments/host-to-host?doc=h2h-process-qr-code-payments\&section=kei2fli2gqggbwgaddtl3xb7): Learn how to implement the `Y0Q` flow for digital wallets.
* [**API Commands**](https://docs.globalgetnet.com/en/products/in-store-payments/host-to-host?doc=h2h-api-commands\&section=g7b851vgbt737kwul1fmgve2): Refer to the full technical structure of the `Y06` and `Y0E` commands.