> ## 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.

# Cancel Submitted Retain Transactions

You can cancel or discontinue Vindicia Retain processing for previously submitted failed Transactions that have not yet been processed. To enable this functionality, you must use the Retain APIs.

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

## Basic Scenario

After you submit failed Transactions to Vindicia Retain in `billTransactions`, you may determine that processing for one or more of the Transactions must be canceled. Typical reasons to cancel Retain processing include:

* The customer paid through the billing system after the failed Transaction was submitted to Vindicia Retain earlier in the day.
* The customer canceled the subscription and should not be charged.
* You need to address an otherwise incorrect submission to Vindicia Retain.

You must use `refundTransactions` to submit the set of Transactions to cancel to Vindicia Retain. You can retrieve the results in the next day's retrieval process. See [Retrieve Results of Retain Processing](5802_retrieveResultsRetainProcessing#).

## Design Approach

As shown in the following diagram, to cancel a previous request to process one or more failed Transactions from `billTransactions`, you must collect and submit the Transactions in a call to `refundTransactions`. This method accepts an array of Transaction IDs representing the failed Transactions in the merchant system previously submitted to `billTransactions`.

When you next execute the `fetchBillingResults` process, the status for the transactions appears as one of the following:

| Status from `fetchBillingResults` | Definition |
| - | - |
| `Failed` | When `refundTransactions` was called, Vindicia Retain had not yet recovered the failed Transaction. Therefore, Vindicia Retain has performed no additional processing on it, and the status remains the same. |
| `Refunded` | When `refundTransactions` was called, Vindicia Retain had already recovered the failed Transaction (and set it to `Captured` status). Therefore, Vindicia Retain processed a refund of the Transaction and updated the status to `Refunded`. |

<img src="https://mintcdn.com/vindicia-retain/pL1W6dYumVz09Ch6/portal/retainUseCases/images/Retain_Cancel_Submitted_Transactions.png?fit=max&auto=format&n=pL1W6dYumVz09Ch6&q=85&s=060606dbb605591ed86b6ff9757c67cc" alt="" width="706" height="906" data-path="portal/retainUseCases/images/Retain_Cancel_Submitted_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).

* **[Cancel Submitted Transactions Using the Retain APIs](../topics/5803_cancelSubmittedTransactions#)**

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

## Cancel Submitted Transactions Using the Retain APIs

To cancel submitted Retain Transactions:

1. Use the Vindicia Retain `refundTransactions` method to cancel the processing of one or more failed Transactions previously submitted to `billTransactions`.

   If a submitted item fails to validate, it will be 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.

   The following sample first submits Failed Transactions in `billTransactions`, then immediately submits a `refundTransactions` request:

   [https://github.com/Vindicia/CashBoxAPISamples/blob/master/Select/Python/SEL003CancelSubmittedSelectTransactions.py](https://github.com/Vindicia/CashBoxAPISamples/blob/master/Select/Python/SEL003CancelSubmittedSelectTransactions.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 submitted in `billTransactions`.
   * 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:**[Cancel Submitted Retain Transactions](../topics/5803_cancelSubmittedTransactions#)


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