# Refunds

{% hint style="info" %}
Note: In most gateways, Refunds refer to previously batched transactions. Any amount up to the total charge can be refunded. Voids refer to canceling a charge not yet batched and can only be for the exact amount that was charged. Stripe only allows refunds, not Voids.
{% endhint %}

{% hint style="warning" %}
**The screenshots and names of Components and Fields were taken on an installation that was using the ‘Accept Blue’ gateway. Other gateways screens and components will be similar but a bit different, and the names of the fields will be specific to the gateway you are configuring for (eg. ‘Authorize.net Credit Card Fields Component’ instead of ‘Accept Blue Credit Card Fields Component’)**
{% endhint %}

### Required Data

| Data you will need to make Void a payment | Where to get this data from                                                | Notes                                                                                                  |
| ----------------------------------------- | -------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ |
| <p>The Transaction ID<br></p>             | A payment, or the payment gateway log record attached to a payment.        | <p><br></p>                                                                                            |
| The Amount to refund                      | A record, or entered into the screenflow field                             |                                                                                                        |
| Named Credential                          | API Name of the Credential you created with the Configuration steps above. | This will generally be constant, but can vary if you are using Paytram with multiple gateway accounts. |

### Logical next steps to do in your Screenflow

| If the transaction was successful                                                                                        | If the transaction failed       |
| ------------------------------------------------------------------------------------------------------------------------ | ------------------------------- |
| Create a new payment record with a negative value to offset the original payment, or adjust the original payment amount. | Show the error message response |

## Making a Refund

To Refund a payment, create a Refund Screen Flow using the Void/Refund Transaction Subflow. You must have the Transaction ID stored in a record, which is usually the Payment Record that was created at the time of the transaction.

1. In your Flow, use the Get Records component to retrieve the record ID that contains the Transaction ID that you wish to refund (eg the Payment Record).

{% hint style="info" %}
Tip: Although not required, you may want to add a step for the user to confirm the amount or the payment to be refunded.&#x20;
{% endhint %}

2. Add the  Void/Refund Transaction Subflow to the canvas.
3. Map the following fields:
4. 1. Info\_DoRefund: Set as True&#x20;
   2. Info\_NamedCredential: Type ‘AcceptBlue’ or the name of the External Credential
   3. Info\_TransactionID: Select Transaction ID for the payment from the Get Records component.<br>

      <figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXePwZvVPpNUozpc0vS8iKRTfEEuklfTfBXWiPUneT3HLrr2Pft2Wy2IVi61fy6AlUD5G8qNfWV1SmpYcbK0T5efYJiEU9vzaPkQIHImpQoxZimmCz5TsIYmP-e1RJALqNlcA8nXcP7tuPn5Hww3Xg?key=esorVVMR3D62PAiYn8TVv7VL" alt=""><figcaption></figcaption></figure>
   4. Refund\_Amount: The amount to refund (it must be equal to or less than the original transaction amount.
   5. Refund\_Description: Optional
5. Add a ‘WasError’ decision to continue to the next step in your Flow. If there was no error, for example, you might opt to mark the Payment Record as Refunded in Salesforce or you might choose to create a new, negative value record. If there is an error, you can use the error message you created to display to the user.\ <br>
