# Refund a Payment

This guide shows you how to reverse a previously completed transaction using the Refund deeplink. Partial refunds are supported when the amount is less than the original transaction.

## Before you begin

Before initiating a refund, ensure you have:

* The authorization code (AUT) and transaction date from the original successful payment response.
* The exact or partial amount to be reversed.
* Verified the terminal is ready via `getnet://payment/v1/polling`.

## Step 1: Configure the refund Intent

To initiate the reversal, use the `getnet://payment/v1/refund` URI.

| Parameter | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| `authorizationCode` | String | Yes | Original transaction code found as "AUT" on the receipt. |
| `transactionDate` | String | Yes | Date of the original transaction in `dd/MM/yyyy` format. |
| `amount` | String | Yes | Value to be reversed; if less than the original, a partial refund is performed. |
| `refundType` | String | No | Type of refund: `"1"` sale withdrawal, `"2"` sale, `"3"` withdrawal. |
| `skipConfirmation` | String | No | Set to `"true"` to skip the amount confirmation screen. |
| `skipReceipt` | String | No | Defines whether the client receipt is printed. |
| `allowPrintCurrentTransaction` | String | No | Set to `"false"` to receive receipt data as `automationSlip` instead of printing. |

> The authorization code and transaction date are returned in the `onActivityResult` response when you process a payment. Store these values after each successful transaction so you can use them for refunds later.

> **Partial refunds:** If the amount is less than the original transaction amount, a partial refund is processed. You can perform multiple refunds on the same original transaction until the total amount is reached.

Here's how to configure and send the refund intent:

```kotlin
private val REFUND_REQUEST_CODE = 2001

fun processRefund(authCode: String, transactionDate: String, amount: String) {
    val intent = Intent(Intent.ACTION_VIEW, Uri.parse("getnet://payment/v1/refund")).apply {
        putExtra("authorizationCode", authCode)
        putExtra("transactionDate", transactionDate)
        putExtra("amount", amount)
        putExtra("refundType", "2")
    }
    startActivityForResult(intent, REFUND_REQUEST_CODE)
}
```

## Step 2: Handle the response

The terminal processes the reversal and returns the result to your activity. The response includes `result`, `resultDetails`, `authorizationCode`, `commerceCode`, `amount`, `gmtDateTime`, `callerId`, `nsuLastSuccesfullMessage`, `refundTransactionDate`, `refundOriginTerminal`, and `automationSlip`.

```kotlin
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
    if (requestCode == REFUND_REQUEST_CODE && resultCode == RESULT_OK) {
        val extras = data?.extras
        val result = extras?.getString("result")

        if (result == "0") {
            // Refund approved
        } else {
            val details = extras?.getString("resultDetails")
            // Handle error
        }
    }
}
```

## Next steps

* [Refund and Cancellation](/en/app2app/core-concept-a2a/refund-and-cancellation) — How the terminal handles same-day voids versus settled refunds.
* [Deeplink Parameters](/en/app2app/reference-a2a/deeplink-parameters) — Complete refund request and response fields.