# Refund a Payment

This guide walks you through processing a refund operation to reverse a previous payment transaction. You'll learn how to reference the original transaction and initiate the refund using the Get Mini App2App integration.

## Requirements

Before following the steps, ensure you have:

* **Get Mini application** installed on the Android device
* **Compatible PIN pad device** paired and connected
* **Original transaction details** including authorization number, order ID, and date
* **ActivityResultLauncher** properly registered in your Activity or Fragment

<Callout type="warning">

You must have the exact details from the original transaction to process a refund. These are returned in the payment response.

</Callout>

## Refund Process

This section guides you through creating a refund Intent with the original transaction details. The Get Mini app will validate the information and process the reversal.

### Step 1: Create the Refund Intent

Create an Intent with the action `es.redsys.paysys.mPOSRedsys_REFUND_REQUEST` and include all required parameters from the original transaction. The refund amount can be equal to or less than the original payment amount, allowing for partial refunds.

The table below lists the mandatory fields:

| Parameter | Type | Required | Description |
| :---- | :---- | :---- | :---- |
| `amount` | double | Yes | The amount to be refunded. |
| `date` | String | Yes | Date of the original payment (YYYYMMDD format). |
| `authorization` | String | Yes | Authorization number from the original payment. |
| `order` | String | Yes | Order number from the original payment. |

<Callout type="note">

The `date`, `authorization`, and `order` values must match the original transaction exactly. Discrepancies will cause the refund to be declined.

</Callout>

The following code shows how to create and launch the refund Intent:

```java
// Create the Intent
Intent intent = new Intent("es.redsys.paysys.mPOSRedsys_REFUND_REQUEST");

// Add required parameters from the original transaction
intent.putExtra("amount", 10.50);
intent.putExtra("date", "20240116");
intent.putExtra("authorization", "123456");
intent.putExtra("order", "ORD-12345");

// Launch the Get Mini app
refundLauncher.launch(intent);
```

### Step 2: Handle the Refund Result

After processing the refund, the Get Mini app returns control to your application with the result. Check the result code and extract the refund details from the Intent extras, including the new transaction status and receipt information.

For complete details on handling responses, see [Handle Transaction Results](/en/get-mini/get-mini-app2app/transaction-guides/response-handling/handle-transaction-results).

### Next Steps

Now that you've processed a refund, you can explore other operations:

* [Process a Payment](https://docs.globalgetnet.com/en/products/local-processor-spain/get-mini?doc=getmini-app2app-processing-a-payment) - Learn how to process payment transactions
* [Query Operations](/en/get-mini/get-mini-app2app/transaction-guides/transactions/query-operations) - Retrieve transaction history including refunds
* [Result Codes and Errors](/en/get-mini/get-mini-app2app/reference/result-codes-and-errors) - Reference for all response fields