# Customize Redirect and Retry Behavior
source: https://developer.mastercard.com/mastercard-gateway/documentation/build/hosted-checkout/customizing-the-checkout/customizing-redirect-and-retry-behavior/index.md

If you are using Hosted Checkout, you can customize the redirect and retry behavior as it allows you to limit the retry attempts and redirect the users from the checkout page to the merchant application. The customizations are defined in the [Initiate Checkout](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/rest/api-ops/index.md#hosted-checkout) operation.

If you have a checkout integration that uses an embedded form or payment page, you can customize the Mastercard Checkout user experience by redirecting your customers after they encounter a successful or failed payment.

Existing merchants remain unaffected, and they can extend the functionality by simply passing the `redirectMerchantUrl` and `retryAttemptCount` in the [Initiate Checkout](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/rest/api-ops/index.md#hosted-checkout) call while creating the session. The payer redirects to the merchant portal only if both the new variables are passed in [Initiate Checkout](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/rest/api-ops/index.md#hosted-checkout).

You can customize the redirect and retry behavior for the following options:

* **Successful transaction**: The merchant can always redirect the customers or reside on the checkout disabling redirects.

  Warning: To redirect, the merchant needs to share the `interaction.returnUrl` in [Initiate Checkout](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/rest/api-ops/index.md#hosted-checkout).

  <br />

* **Failed transaction**: The merchant has three options:

<!-- -->

* Always redirect customers.
* Allow up to three retry attempts before redirecting.
* Disable redirects entirely during checkout. Warning: To redirect, the merchant needs to share the `interaction.redirectMerchantUrl` and `interaction.retryAttemptCount` in [Initiate Checkout](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/rest/api-ops/index.md#hosted-checkout).

If the `interaction.redirectMerchantUrl` and `interaction.retryAttemptCount` are not passed in [Initiate Checkout](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/rest/api-ops/index.md#hosted-checkout) then, the merchant can choose to limit the retry attempts up to three times without making the payer to redirect to the merchant application by toggling on Limit session payment attempts.

## Frequently asked questions {#frequently-asked-questions}

The changes are only applicable to "Modern" Hosted Checkout. The changes are applicable to the Payment page, embedded mode, payment link, and the Initiate Checkout API call. The changes are available from version 63 and later.
