> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mangopay.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Pay by Bank

<table>
  <tbody>
    <tr>
      <th class="header">Region</th>

      <td class="table-content">
        EEA
      </td>
    </tr>

    <tr>
      <th class="header">Currencies</th>

      <td class="table-content">
        EUR
      </td>
    </tr>

    <tr>
      <th class="header">Refunds</th>

      <td class="table-content">
        Support via payouts ([read more](#refunds))
      </td>
    </tr>

    <tr>
      <th class="header">Disputes</th>

      <td class="table-content">
        Users authenticate directly with their bank, so there is no dispute process and a low risk of unrecognized or fraudulent payments
      </td>
    </tr>

    <tr>
      <th class="header">Preauthorization</th>

      <td class="table-content">
        No
      </td>
    </tr>

    <tr>
      <th class="header">Recurring payments</th>

      <td class="table-content">
        No
      </td>
    </tr>
  </tbody>
</table>

## About

Pay by Bank relies on open banking, which allows third-party providers to access banking data and initiate transactions on behalf of customers (in line with applicable regulations). Your platform can allow users to pay directly from their bank account, via a range of bank wire transfer schemes.

## How it works

The Pay by Bank payment method allows you to redirect the user to their bank to initiate and authenticate the bank wire.

<Steps titleSize="h4">
  <Step title="User chooses payment method">
    On your app or website, the user selects Pay by Bank as the payment method.
  </Step>

  <Step title="You present available banks">
    Optionally, you can present the user with a list of banks for them to select theirs. If you provide the `BankName` in your API request, the user doesn't have to choose it on the hosted page on redirection.

    You can also invite the user to select the `Scheme` they wish to use, otherwise the instant one is used by default (if supported by the bank).

    To retrieve the supported banks, call the [GET View supported banks for Pay by Bank](/api-reference/pay-by-bank/view-supported-banks-pay-by-bank) endpoint, filtering on the user's country. In the response, you can display the `Name` to the user in the list, while the `BankName` is the value to send in your payment request. For each bank, the list of `Scheme` values supported is also returned.

    As well as the `BankName`, you can also invite the user to provide their `IBAN` and `BIC` which preselects the account to be debited. Otherwise, the user selects the account to debit on the hosted page.

    In Germany (`DE`), banks impose an additional authentication step that can be avoided if you also obtain and provide the user's `IBAN` and `BIC` up front.
  </Step>

  <Step title="Payment initiation">
    You initiate the payment request by calling [POST Create a Pay by Bank PayIn](/api-reference/pay-by-bank/create-pay-by-bank-payin), specifying the `ReturnURL` to which the user will be returned after payment (whatever the outcome).

    If the `ReturnURL` redirects to your app, rather than a website, you need to also set the `PaymentFlow` to `APP`.

    You should also provide the `BankName`, `Scheme` and `IBAN` and `BIC` if you obtained them from the user.

    <Warning>
      **Caution – Pay-in currency must match account currency**

      The currency of the pay-in request must correspond to the currency of the account the user selects, otherwise the user is returned an error and the pay-in fails.
    </Warning>
  </Step>

  <Step title="Redirection">
    You redirect the user to the hosted page via the `RedirectURL` in the API response.

    On the hosted page, the user initiates the payment by:

    * Selecting their bank (based on `Country`), unless specified in `BankName`
    * Selecting the account to be debited, which requires authentication to connect to their bank (unless specified by `IBAN` and `BIC`) – this is known as the **account information service (AIS)** that is authenticated in some countries, notably Germany
    * Authenticating their payment – this is known as the **payment initiation service (PIS)** which is always authenticated in all countries

    <Note>
      **Note – Session timeout 9 minutes**

      The Pay by Bank session lasts for 9 minutes, at which point the pay-in fails automatically if no action has been taken by the user.
    </Note>
  </Step>

  <Step title="Return">
    After payment, the user is returned on your specified `ReturnURL`:

    * To a website if `PaymentFlow` is `WEB` (default value)
    * To a mobile app if the `PaymentFlow` is `APP`
  </Step>

  <Step title="Outcome">
    If the payment was initiated successfully by the user, then the response parameter `ProcessingStatus` is returned with its only value `PENDING_SUCCEEDED` and the `Status` is `CREATED`.

    `ProcessingStatus` is **only** returned if the payment initiation was successful, and it triggers a [webhook](/webhooks) for the dedicated [event type](/webhooks/event-types):

    * `PAYIN_NORMAL_PROCESSING_STATUS_PENDING_SUCCEEDED`

    `ProcessingStatus` only has one value, `PENDING_SUCCEEDED`, which is temporarily returned until the final outcome is known. If it is not returned, then the payment was not initiated successfully by the user.

    When the bank wire from the user's account is received on Mangopay's account, the pay-in's  `Status` changes from `CREATED` to `SUCCEEDED` and the `ResultCode` changes to `000000`. This outcome triggers a webhook for the event type:

    * `PAYIN_NORMAL_SUCCEEDED`

    Depending on the `Scheme` that is used, it can take up to 72 hours for the pay-in to succeed.

    If the pay-in fails, it's `Status` changes to `FAILED` and a `ResultCode` and `ResultMessage` are returned giving the reason (see [Functional errors](#functional-errors) below). This outcome triggers a webhook for the event type:

    * `PAYIN_NORMAL_FAILED`
  </Step>
</Steps>

## Banks and schemes

Once redirected on the `RedirectUrl` to the Pay by Bank hosted experience, the user selects their bank (unless sent in `BankName`) and chooses the account to be debited.

On the hosted Pay by Bank page, however, they are not able to select the scheme used for the payment.

You can send the `Scheme` in your API request, and we recommend that you present this choice to the user beforehand.

To retrieve the banks supported by Pay by Bank, you can use the [GET View supported banks for Pay by Bank](/api-reference/pay-by-bank/view-supported-banks-pay-by-bank) endpoint.

<Note>
  **Note – Ensure clear communication with the user**

  Whether you leave the `Scheme` choice to the user (recommended) or not, you should communicate clearly which scheme is being used.

  Furthermore, it is possible for a bank to charge the user additional fees (separately) for an instant scheme, but this will become less common as markets adapt.
</Note>

By default (with the exception of Denmark) the local instant payment scheme is used for the payment if it is supported by the bank, otherwise the non-local scheme is used. If `Country` is `DK` then the `Scheme` must be specified – there is no default because there are two instant schemes available.

If your API call specifies the instant scheme but the bank doesn't support it, then the non-instant scheme is used. However, the API returns the value that you sent, even after the funds arrive on Mangopay's account and the `Status` becomes `SUCCEEDED`.

### Supported schemes

The following `Scheme` values are available depending on the `Country`:

<table>
  <thead>
    <tr><th class="header-compact">Country</th><th class="header-compact">Supported `Scheme` values</th><th class="header-compact">Default value (if supported by the bank)</th></tr>
  </thead>

  <tbody>
    <tr><td>`AT`</td><td>`SEPA_CREDIT_TRANSFER`, `SEPA_INSTANT_CREDIT_TRANSFER`</td><td>`SEPA_INSTANT_CREDIT_TRANSFER`</td></tr>
    <tr><td>`DE`</td><td>`SEPA_CREDIT_TRANSFER`, `SEPA_INSTANT_CREDIT_TRANSFER`</td><td>`SEPA_INSTANT_CREDIT_TRANSFER`</td></tr>
    <tr><td>`DK`</td><td>`DANISH_DOMESTIC_CREDIT_TRANSFER`, `INSTANT_DANISH_DOMESTIC_CREDIT_TRANSFER_STRAKS`, `INSTANT_DANISH_DOMESTIC_CREDIT_TRANSFER_INTRADAG`</td><td>No default because there are two instant schemes</td></tr>
    <tr><td>`EE`</td><td>`SEPA_CREDIT_TRANSFER`, `SEPA_INSTANT_CREDIT_TRANSFER`</td><td>`SEPA_INSTANT_CREDIT_TRANSFER`</td></tr>
    <tr><td>`ES`</td><td>`SEPA_CREDIT_TRANSFER`, `SEPA_INSTANT_CREDIT_TRANSFER`</td><td>`SEPA_INSTANT_CREDIT_TRANSFER`</td></tr>
    <tr><td>`FI`</td><td>`SEPA_CREDIT_TRANSFER`, `SEPA_INSTANT_CREDIT_TRANSFER`</td><td>`SEPA_INSTANT_CREDIT_TRANSFER`</td></tr>
    <tr><td>`FR`</td><td>`SEPA_CREDIT_TRANSFER`, `SEPA_INSTANT_CREDIT_TRANSFER`</td><td>`SEPA_INSTANT_CREDIT_TRANSFER`</td></tr>
    <tr><td>`GB`</td><td>`FASTER_PAYMENTS`</td><td>`FASTER_PAYMENTS`</td></tr>
    <tr><td>`IE`</td><td>`SEPA_CREDIT_TRANSFER`</td><td>`SEPA_CREDIT_TRANSFER`</td></tr>
    <tr><td>`IT`</td><td>`SEPA_CREDIT_TRANSFER`, `SEPA_INSTANT_CREDIT_TRANSFER`</td><td>`SEPA_INSTANT_CREDIT_TRANSFER`</td></tr>
    <tr><td>`LT`</td><td>`SEPA_CREDIT_TRANSFER`, `SEPA_INSTANT_CREDIT_TRANSFER`</td><td>`SEPA_INSTANT_CREDIT_TRANSFER`</td></tr>
    <tr><td>`NL`</td><td>`SEPA_CREDIT_TRANSFER`, `SEPA_INSTANT_CREDIT_TRANSFER`</td><td>`SEPA_INSTANT_CREDIT_TRANSFER`</td></tr>
    <tr><td>`NO`</td><td>`NORWEGIAN_DOMESTIC_CREDIT_TRANSFER`, `INSTANT_NORWEGIAN_DOMESTIC_CREDIT_TRANSFER_STRAKS`</td><td>`INSTANT_NORWEGIAN_DOMESTIC_CREDIT_TRANSFER_STRAKS`</td></tr>
    <tr><td>`PL`</td><td>`SEPA_CREDIT_TRANSFER`, `INSTANT_POLISH_DOMESTIC_CREDIT_TRANSFER`, `POLISH_DOMESTIC_CREDIT_TRANSFER`</td><td>`INSTANT_POLISH_DOMESTIC_CREDIT_TRANSFER`</td></tr>
    <tr><td>`PT`</td><td>`SEPA_CREDIT_TRANSFER`, `SEPA_INSTANT_CREDIT_TRANSFER`</td><td>`SEPA_INSTANT_CREDIT_TRANSFER`</td></tr>
  </tbody>
</table>

### Supported banks

The banks supported by Pay by Bank are available via the [GET View supported banks for Pay by Bank](/api-reference/pay-by-bank/view-supported-banks-pay-by-bank) endpoint.

For testing data, see [Payment methods - Testing](/testing/payment-methods#pay-by-bank).

## Refunds

Pay by Bank relies on bank wire schemes which have no native refund functionality. However, you can refund pay-ins by using payouts and specifying the initial transaction ID. See [Refunds using payouts](/guides/payouts/integration#refunds-using-payouts) for details.

## Functional errors

If the Pay by Bank PayIn `Status` changes to `FAILED`, the following `ResultCode` errors may be returned.

<Accordion title="Functional errors">
  <Card title="009199" href="/errors/codes/009199">
    **PSP technical error**\
    The pay-in failed due to a technical error linked to the PSP.
  </Card>

  <Card title="009499" href="/errors/codes/009499">
    **Bank technical error**\
    The Bank has denied the payment for unknown reasons.
  </Card>

  <Card title="009103" href="/errors/codes/009103">
    **PSP configuration error**\
    PSP configuration error
  </Card>

  <Card title="001031" href="/errors/codes/001031">
    **User canceled the payment**\
    The pay-in failed because the user canceled the payment.
  </Card>

  <Card title="001034" href="/errors/codes/001034">
    **User has let the payment session expire without paying**\
    The user has let the payment session expire.
  </Card>

  <Card title="206101" href="/errors/codes/206101">
    **RedirectURL page embedded**

    The payment failed because the redirect URL is embedded in a page.
  </Card>

  <Card title="206102" href="/errors/codes/206102">
    **RedirectURL already processed**

    The payment failed because the redirect URL has already been processed.
  </Card>

  <Card title="206103" href="/errors/codes/206103">
    **Bank not supported**

    The payment failed because the selected bank is not supported.
  </Card>

  <Card title="206104" href="/errors/codes/206104">
    **User not recognized**

    The payment failed because the user is not recognized by the bank.
  </Card>

  <Card title="206105" href="/errors/codes/206105">
    **Authentication method not supported**

    The payment failed because the authentication method selected is not supported.
  </Card>

  <Card title="206106" href="/errors/codes/206106">
    **Invalid user credentials**

    The payment failed due to invalid user credentials.
  </Card>

  <Card title="206107" href="/errors/codes/206107">
    **Parallel session detected**

    The payment failed due to another session being open for the user.
  </Card>

  <Card title="206108" href="/errors/codes/206108">
    **User blocked by bank**

    The payment failed because the user has been blocked by their bank.
  </Card>

  <Card title="206109" href="/errors/codes/206109">
    **User denied by bank**

    The payment failed because the user is not authorized to perform this action.
  </Card>
</Accordion>

## Related resources

<CardGroup col={2}>
  <Card title="Testing" href="/testing/payment-methods#pay-by-bank">
    See testing data
  </Card>

  <Card title="Endpoints" href="/api-reference/pay-by-bank/pay-by-bank-payin-object">
    The Pay by Bank PayIn object
  </Card>
</CardGroup>
