> ## Documentation Index
> Fetch the complete documentation index at: https://adyen-preview.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Cancel an Unreferenced Refund

> Learn how to cancel an unreferenced refund request before it is completed.

If you are making [unreferenced refunds](https://adyen-preview.mintlify.site/point-of-sale/basic-tapi-integration/refund-payment/unreferenced.md), you may want to check that the cardholder is eligible for the refund. In this case, you can [set a delay](https://adyen-preview.mintlify.site/point-of-sale/basic-tapi-integration/refund-payment/unreferenced.md#enable-unreferenced-refunds) for the refund. This gives you time to check before you make a `/voidPendingRefund` request to cancel a refund before it is completed. Note that this is not a Terminal API request.

In your request to the `/voidPendingRefund` endpoint, you can refer to the original refund request using the `tenderReference`, or the `pspReference`. We recommend implementing based on the `tenderReference`, because this is generated for both offline and online in-person transactions.

## Requirements

| Requirement | Description |
| - | - |
| **Integration type** | Adyen in-person payments using integrated or [standalone](https://adyen-preview.mintlify.site/point-of-sale/standalone) payment terminals, or with a [Mobile solution](https://adyen-preview.mintlify.site/point-of-sale/ipp-mobile.md). |
| [API credentials](https://adyen-preview.mintlify.site/development-resources/api-credentials.md) | An [API key](https://adyen-preview.mintlify.site/development-resources/api-credentials.md#generate-api-key) to cancel unreferenced refunds from a POS app. If you are using [cloud-based communications](https://adyen-preview.mintlify.site/point-of-sale/design-your-integration/choose-your-architecture#cloud-communications), you can use the existing API key that you use for Terminal API requests. |
| **[Webhooks](https://adyen-preview.mintlify.site/development-resources/webhooks.md)** | Set up [standard webhooks](#webhooks) to be informed about the outcome of the cancellation of a refund. |
| **Limitations** | Take into account the following limitations: The refund delay only applies to [unreferenced refunds](https://adyen-preview.mintlify.site/point-of-sale/basic-tapi-integration/refund-payment/unreferenced.md). It is not possible to cancel a [referenced refund](https://adyen-preview.mintlify.site/point-of-sale/basic-tapi-integration/refund-payment/referenced.md). If you have not set up delayed POS refunds, or if the configured refund delay has expired, it is not possible to cancel the refund anymore. |
| **Setup steps** | Before you begin, contact our [Support Team](https://ca-test.adyen.com/ca/ca/contactUs/support.shtml?form=other) to set up delayed POS refund requests. |

## Cancel with tender reference

1. Make a POST [/voidPendingRefund](https://docs.adyen.com/api-explorer/Payment/voidPendingRefund) request, specifying:

   | Parameter | Description |
   | - | - |
   | `merchantAccount` | Your merchant account that was used to process the original refund request. |
   | `tenderReference` | The transaction reference provided by the terminal that processed the refund request. |
   | `uniqueTerminalId` | Unique ID of the terminal that processed the refund request. |

   ```curl theme={null}
   curl -X POST \
       https://pal-test.adyen.com/pal/servlet/Payment/v68/voidPendingRefund \
       -H 'content-type: application/json' \
       -H 'x-api-key: YOUR_API_KEY' \
       -d '{"merchantAccount":"YOUR_MERCHANT_ACCOUNT","tenderReference":"5Iw8001176969533005","uniqueTerminalId":"VX820-123456789"}'
   ```

2. In the `/voidPendingRefund` response, note the following:

   * `pspReference`: The PSP reference for this `/voidPendingRefund` request.

   ```json theme={null}
   {
       "pspReference":"NC6HT9CRT65ZGN82",
       "response":"[voidPendingRefund-received]"
   }
   ```

## Cancel with PSP reference

Alternatively, if you have the `pspReference` of the original refund request, you can specify this in your `/voidPendingRefund` request:

1. Make a POST [/voidPendingRefund](https://docs.adyen.com/api-explorer/Payment/voidPendingRefund) request, specifying:

   | Parameter | Description |
   | - | - |
   | `merchantAccount` | Your merchant account that was used to process the original refund request. |
   | `originalReference` | The `pspReference` of the original refund request. |

   ```curl theme={null}
   curl -X POST \
        https://pal-test.adyen.com/pal/servlet/Payment/v68/voidPendingRefund \
        -H 'content-type: application/json' \
        -H 'x-api-key: YOUR_API_KEY' \
        -d '{"merchantAccount":"YOUR_MERCHANT_ACCOUNT","originalReference":"9914748988390044"}'
   ```

2. In the `/voidPendingRefund` response, note the following:

   * `pspReference`: The PSP reference for this `/voidPendingRefund` request.

   ```json theme={null}
   {
       "pspReference":"KHQC5N7G84BLNK43",
       "response":"[voidPendingRefund-received]"
   }
   ```

## Webhooks

After we process your request to cancel the refund, we send you a [webhook](https://adyen-preview.mintlify.site/development-resources/webhooks.md) with:

* `eventCode`: **VOID\_PENDING\_REFUND**.
* `success`: Indicates if the request to cancel the refund was successful.

```json theme={null}
{
   "live":"false",
   "notificationItems":[
      {
         "NotificationRequestItem":{
            "amount":{
               "currency":"EUR",
               "value":1100
            },
            "eventCode":"VOID_PENDING_REFUND",
            "eventDate":"2022-11-28T18:03:50+01:00",
            "merchantAccountCode":"ADYEN_MERCHANT_ACCOUNT",
            "merchantReference":"YOUR_REFERENCE",
            "originalReference":"ZC4R4RBFJGXXGN82",
            "pspReference":"KHQC5N7G84BLNK43",
            "reason":"",
            "success":"true"
         }
      }
   ]
}
```

## See also

* [Unreferenced refunds](https://adyen-preview.mintlify.site/point-of-sale/basic-tapi-integration/refund-payment/unreferenced.md)
* [/voidPendingRefund](https://docs.adyen.com/api-explorer/Payment/latest/voidPendingRefund)
* [Webhooks](https://adyen-preview.mintlify.site/development-resources/webhooks.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.