> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vindicia.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Refund Retain Transactions

You can refund one or more Transactions previously recovered by Vindicia Retain. To enable this functionality, you must use the Retain APIs.

* **Use Case Number:** 5-8-04
* **Completed By:** Software Developer
* **Estimated Completion Time:** \<5 days

## Basic Scenario

After reviewing the results returned by `fetchBillingResults`, you may determine that one or more failed Transactions previously recovered by Vindicia Retain (as `Captured`) need to be refunded.

Typical reasons to refund Retain Transactions include:

* The customer has already paid through the billing system.
* The customer cancelled the subscription and should not be charged.
* The Transaction represents a duplicate charge.

To refund a set of Transactions, you must collect and submit the Transactions to Vindicia Retain in a call to `refundTransactions`. You can retrieve the results indicating the updated status of Refunded in the next day's retrieval process (see [Retrieve Results of Retain Processing](5802_retrieveResultsRetainProcessing#)).

This method accepts an array of Transaction IDs representing failed Transactions in the merchant system, which resulted in captured Vindicia Retain Transactions.

## Design Approach

As shown in the following diagram, to refund a set of Transactions, you must collect and submit the set of Transactions to Vindicia Retain in a call to `refundTransactions`. Because Vindicia Retain previously recovered the failed Transactions, the status of the Transactions before the call to `refundTransactions` is `Captured`. The call to `refundTransactions` results in the Transaction being returned as `Refunded` in the next retrieval process execution.

<img src="https://mintcdn.com/vindicia-retain/pL1W6dYumVz09Ch6/portal/retainUseCases/images/Retain_Refund_Transactions.png?fit=max&auto=format&n=pL1W6dYumVz09Ch6&q=85&s=7752fa2b49b3385cd906aaf413af680e" alt="" width="706" height="858" data-path="portal/retainUseCases/images/Retain_Refund_Transactions.png" />

## References

* For more information about working with the Vindicia Retain API, see the [Vindicia Retain API Guide](/portal/Retain_V1.5_API_Reference_Guide/topics/Vindicia_Retain_API_Guide_Preface).

* For detailed information about the `refundTransactions` method, see [Select.refundTransactions](/portal/Retain_V1.5_API_Reference_Guide/topics/refundTransactions) in the [Vindicia Retain API Guide](/portal/Retain_V1.5_API_Reference_Guide/topics/Vindicia_Retain_API_Guide_Preface).

* **[Refund Submitted Transactions Using the Retain APIs](../topics/5804_refundTransaction#)**

**Parent topic:**[Retain Use Cases](../topics/r_useCases)

## Refund Submitted Transactions Using the Retain APIs

Ensure the failed Transaction has completed processing successfully (status is `Captured`).

To refund recovered Transactions:

1. Use the Vindicia Retain `refundTransactions` method to perform a refund of Transactions already recovered by Vindicia Retain (in `Captured` status).

   As a result of making this call, these Transactions are returned as status `Refunded` in the next execution of the `fetchBillingResults` process.

   If a submitted item fails to validate, it is returned in a `TransactionValidationResponse` array element.

   **Sample Code**

   Note that client libraries are not provided for Vindicia Retain. The WSDL endpoint is used by the development environment to generate a library that you can use, or you can use direct WSDL posts to submit requests to Vindicia Retain.

   This sample submits a `refundTransactions` request:

   [https://github.com/Vindicia/CashBoxAPISamples/blob/master/Select/Python/SEL005RefundSelect.py](https://github.com/Vindicia/CashBoxAPISamples/blob/master/Select/Python/SEL005RefundSelect.py)

   **Certification**

   Provide the Solution Architect with SOAP IDs from a call to `refundTransactions` and a corresponding call to `fetchBillingResults` where the updated status of the Failed Transactions sent to the refundTransactions call were returned for review:

   * SOAP ID #1: call to `refundTransactions` containing one or more Transaction IDs previously recovered, in `Captured` status.
   * SOAP ID #2: call to `fetchBillingResults` which returned the updated status for one or more Transaction IDs from the call in SOAP ID #1.

**Parent topic:**[Refund Retain Transactions](../topics/5804_refundTransaction#)


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