# Refund and Fix payments
source: https://developer.mastercard.com/mastercard-gateway/documentation/use-cases/refund-and-fix-payment/index.md

## Refund a Payment {#refund-a-payment}

Refunds allow merchants to return funds to a customer after a successful payment. A refund can be issued for the full transaction amount or for a partial amount. Refunds are submitted through the Mastercard Gateway and are subsequently processed through the payment network and issuer.

This flow shows how a merchant initiates and processes a refund after receiving a customer request.

### Prerequisites {#prerequisites}

* The original payment exists and has been successfully processed.
* The refund amount is within the allowable limits.
* The merchant has permission to perform refund operations.
* The original transaction reference is available.

### Sequence diagram {#sequence-diagram}

Diagram refund-a-payment

### Workflow {#workflow}

1. The payer requests a refund from customer support.
2. Customer support approves the refund amount and submits the request to the merchant server.
3. The merchant server submits a REFUND request to the Mastercard Gateway for the full or partial refund amount.
4. The Mastercard Gateway submits the refund request to the acquirer.
5. The acquirer returns the refund processing result to the Mastercard Gateway.
6. The Mastercard Gateway returns the refund result to the merchant server.
7. The merchant server notifies customer support of the refund outcome.
8. Customer support provides the refund confirmation to the payer.

### Endpoint {#endpoint}

|     API     | Format | HTTP Method |                                                                          Operation                                                                           |
|-------------|--------|-------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Transaction | NVP    | POST        | [Refund](https://mtf.gateway.mastercard.com/api/documentation/apiDocumentation/nvp/version/100/operation/Transaction:%20%20Refund.html?locale=en_US)         |
|             | REST   | PUT         | [Refund](https://mtf.gateway.mastercard.com/api/documentation/apiDocumentation/rest-json/version/100/operation/Transaction%3a%20%20Refund.html?locale=en_US) |

### Error resolution {#error-resolution}

For details on error resolution, explore our [Code and Formats](https://developer.mastercard.com/mastercard-gateway/documentation/code-and-formats/index.md) section.

## Reverse an Authorization {#reverse-an-authorization}

Use reversals to cancel payments that have been authorized but not yet captured. If a payment has only been authorized, cancel the authorization instead of refunding it. This avoids unnecessary clearing and settlement processing and can reduce delays for the payer.

This use case shows how a merchant verifies that an authorization remains open and then submits a reversal request to cancel the authorization.

### Prerequisites {#prerequisites-1}

* An existing transaction exists in the Mastercard Gateway.
* The merchant has the transaction reference or order reference.
* The authorization remains open and has not been captured.
* The transaction is eligible for reversal.

### Sequence diagram {#sequence-diagram-1}

Diagram reverse-authorization

### Workflow {#workflow-1}

1. The merchant server retrieves the order or transaction status from the Mastercard Gateway.
2. The Mastercard Gateway returns the transaction status indicating that the authorization exists and has not been captured.
3. The merchant server submits a VOID request to reverse the authorization.
4. The Mastercard Gateway submits the authorization reversal request to the acquirer.
5. The acquirer returns the reversal result to the Mastercard Gateway.
6. The Mastercard Gateway returns the reversal confirmation to the merchant server.

### Endpoint {#endpoint-1}

|     API     | Format | HTTP Method |                                                                                         Operation                                                                                          |
|-------------|--------|-------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Transaction | NVP    | POST        | [Retrieve Order](https://mtf.gateway.mastercard.com/api/documentation/apiDocumentation/nvp/version/100/operation/Transaction%3a%20%20Retrieve%20Order.html?locale=en_US)                   |
|             | REST   | GET         | [Retrieve Order](https://mtf.gateway.mastercard.com/api/documentation/apiDocumentation/rest-json/version/100/operation/Transaction:%20%20Retrieve%20Order.html?locale=en_US)               |
|             | NVP    | POST        | [Retrieve Transaction](https://mtf.gateway.mastercard.com/api/documentation/apiDocumentation/nvp/version/100/operation/Transaction:%20%20Retrieve%20Transaction.html?locale=en_US)         |
|             | REST   | GET         | [Retrieve Transaction](https://mtf.gateway.mastercard.com/api/documentation/apiDocumentation/rest-json/version/100/operation/Transaction%3a%20%20Retrieve%20Transaction.html?locale=en_US) |
|             | NVP    | POST        | [Void](https://mtf.gateway.mastercard.com/api/documentation/apiDocumentation/nvp/version/100/operation/Transaction%3a%20%20Void.html?locale=en_US)                                         |
|             | REST   | PUT         | [Void](https://mtf.gateway.mastercard.com/api/documentation/apiDocumentation/rest-json/version/100/operation/Transaction:%20%20Void.html?locale=en_US)                                     |

### Error resolution {#error-resolution-1}

For details on error resolution, explore our [Code and Formats](https://developer.mastercard.com/mastercard-gateway/documentation/code-and-formats/index.md) section.
