> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://ixopay.ferndocs.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://ixopay.ferndocs.com/_mcp/server.

# Intermediate redirects

When dealing with transactions processed through a *Payment Selection Page* , the IXOPAY platform provides a feature to redirect the customer back to your checkout flow before the final processing of the chosen payment method.

> **Note**
>
> Please be aware that this feature needs to be manually enabled on your merchant account.

## Process flow

1. **Merchant** : Initiate a [Debit](https://documentation.ixopay.com/api/transaction/debit) transaction to the IXOPAY platform, with `intermediateUrl` included in `extraData` (refer to the Technical details section below).
2. **Merchant** : Guide the customer's browser to the `redirectUrl` present in the response.
3. **IXOPAY platform** : Show the payment selection page to the customer.
4. **Customer** : Choose the desired payment method on the payment selection page.
5. **IXOPAY platform** : Dispatch a [callback](https://documentation.ixopay.com/docs/reference/integration/callbacks) with the `PENDING` status and `extraData` containing `continueUrl` to the specified `callbackUrl`. Alternatively, the merchant can query the `continueUrl` by using the [Status API](https://documentation.ixopay.com/api/transaction/status).
6. **IXOPAY platform** : Redirect the customer's browser back to the `intermediateUrl`. The IXOPAY platform adds the `continueUrl` as GET parameter to the page's URL.
7. **Merchant** : Display the checkout finalization page to the customer.
8. **Customer** : Clicks, for example, "Finalize purchase now".
9. **Merchant** : Guide the customer's browser to the `continueUrl` – sourced from the GET parameter, from the callback, or the [Status API](https://documentation.ixopay.com/api/transaction/status).
10. **IXOPAY platform** : Show the actual payment page to the customer.
11. **Customer** : Concludes payment at the Payment Service Provider (PSP).
12. **IXOPAY platform** : Dispatches the final callback to the merchant's `callbackUrl`.
13. **IXOPAY platform** : Redirects the customer back to the merchant's `successUrl` — or `errorUrl` in case of payment failure.
14. **Merchant** : Displays the "Thank you for your purchase" page.

Here's a visual representation of the process flow using a sequence diagram:

```mermaid
%%{ init: { "sequence": {"mirrorActors": false} } }%%
sequenceDiagram
    autonumber

    participant M as Merchant
    participant P as IXOPAY platform
    participant C as Customer

    M->>P: Sends transaction with intermediateUrl
    M->>C: Redirects customer to redirectUrl
    P->>C: Presents payment selection page
    C->>P: Chooses payment method
    P->>M: Sends callback with state PENDING & continueUrl
    P->>C: Redirects customer to intermediateUrl with continueUrl GET parameter
    M->>C: Presents checkout finalization
    C->>M: Clicks "Finalize purchase now"
    M->>C: Redirects customer to continueUrl
    P->>C: Presents actual payment page
    C->>P: Finalizes payment at the PSP
    P->>M: Sends final callback to merchant's callbackUrl
    P->>C: Redirects customer to successUrl (or errorUrl if payment failed)
    M->>C: Presents "Thank you for your purchase" page
```

## Technical details

Apart from the standard transaction details, you should also pay attention to the following:

* Send the `extraData` value for the `intermediateUrl` key: This URL is where we'll redirect the customer after they have chosen a payment method.

For example:

```json
{
  // ...
  "extraData": {
    "intermediateUrl": "https://shop.example.org/checkout/finalize"
  }
  // ...
}
```

* Extract the `extraData` value with the `continueUrl` key from the callback: This is the URL where you should redirect the customer to complete the payment.

In the callback:

```json
{
  // ...
  "extraData": {
    "continueUrl": "https://gateway.ixopay.com/redirect/d94c0d72f3a36e21f16e/ABCDEF01234567890ABCDEF01234567890"
  }
  // ...
}
```

Alternatively, you can:

* Retrieve the `continueUrl` through the [Status API](https://documentation.ixopay.com/api/transaction/status).
* Extract the `continueUrl` parameter, which we append to your `intermediateUrl`.

Example: If you provided `https://shop.example.org/checkout/finalize`, we would redirected to `https://shop.example.org/checkout/finalize?continueUrl=https://gateway.ixopay.com/redirect/d94c0d72f3a36e21f16e/ABCDEF01234567890ABCDEF01234567890`.