# Refunds

Call `startRefund()` to process a referenced refund against a previous transaction.


```kotlin
fun startRefund(
    idempotencyId: String? = null,
    transactionId: String,
    refundAmount: Long,
    refundCallback: MPOSRefundCallback,
)
```

| Parameter | Type | Required | Description |
|  --- | --- | --- | --- |
| `idempotencyId` | `String?` | No | Optional identifier used to idempotently identify refund requests. |
| `transactionId` | `String` | Yes | The ID of the original transaction to refund. |
| `refundAmount` | `Long` | Yes | Amount to refund in cents. Cannot exceed the original transaction amount. |
| `refundCallback` | `MPOSRefundCallback` | Yes | Callback receiving the refund result or error. |


## Callback


```kotlin
interface MPOSRefundCallback {
    fun onSuccess(result: RefundResult?)
    fun onError(errorMessage: String)
}
```