# Limit the Amount to Refund

## Flow Customisation: Limit the amount to refund for a Cancel or Switch action

When performing an action like Switch or Cancel, the transaction might result in an order with a total negative amount, i.e. an amount to refund back to the customer.

For example, this could be the result of an immediate cancel:

<figure><img src="https://3950144701-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKxTpA9AeeNYx1ml6UpHj%2Fuploads%2FB9CZhEKh1Yb35OzhISmD%2Fimage.png?alt=media&#x26;token=62c868e5-5a42-4bed-9e8e-62378406352e" alt=""><figcaption></figcaption></figure>

or a Switch from an offer to a cheaper one

<figure><img src="https://3950144701-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKxTpA9AeeNYx1ml6UpHj%2Fuploads%2FkJHlkzv2CrrpUJwxqTZp%2Fimage.png?alt=media&#x26;token=e9c688c2-6a2d-48c7-b888-3bfd6d709d32" alt=""><figcaption></figcaption></figure>

By default, the Limio for Salesforce flow does not enforce any limit on the total amount to refund, however both components expose a property to the flow builder to pass the max amount to refund.

## How to configure flow components

For a Cancel Order, the custom component "Limio Order - Cancel" exposes the property "Maximum allowed refund amount". If left blank, no limit will be enforced. This property is of type Integer.

<figure><img src="https://3950144701-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKxTpA9AeeNYx1ml6UpHj%2Fuploads%2FsuPGeEIzjmKgLHZZ7oQk%2Fimage.png?alt=media&#x26;token=00a39a71-a859-4f45-b162-c6e7359baf34" alt=""><figcaption></figcaption></figure>

For a Switch Order, the custom component "Limio Order - Switch" exposes the property "Maximum allowed refund amount". If left blank, no limit will be enforced. This property is of type Integer.

<figure><img src="https://3950144701-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKxTpA9AeeNYx1ml6UpHj%2Fuploads%2F3IjVfEHIj3bXBBtqFzcI%2Fimage.png?alt=media&#x26;token=32618228-cd3a-4932-b9b8-3790202398da" alt=""><figcaption></figcaption></figure>

## Example

When this upper limit is populated, the logic in the UI will check the total amount and compare it against this limit; if the total amount exceeds such limit the user will be presented with an error message, and they won't be able to proceed to the next step until the total is below the set limit.

<figure><img src="https://3950144701-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKxTpA9AeeNYx1ml6UpHj%2Fuploads%2FULQ6g8DP2ovJMkEgocca%2Fimage.png?alt=media&#x26;token=365f59f1-1666-4044-a339-d2d44eed1352" alt=""><figcaption></figcaption></figure>
