Pay By Bank with Components#
Pay By Bank lets you collect a one-off payment directly from your customer's bank account with confirmation within minutes. Unlike Direct Debit, there's no mandate: the customer authorises each payment individually via their banking app. Learn more about Pay By Bank.
With Components, Pay By Bank is available in GBP via Faster Payments. For other schemes, use Hosted Pages or Custom Payment Pages instead.
Unlike setting up mandates, the payment definition is created on your server, so the flow has three steps:
- Create a Billing Request with a
payment_request - Mint a session token linked to that Billing Request
- Mount the component with the Billing Request ID

1. Before you start#
Complete the general setup (access token and session token endpoint) and add and configure the library.
2. Create a Billing Request#
Create the billing request on your server before the checkout loads, because it carries the payment the customer is going to authorise. Use your access token to create a billing request with a payment_request:
The payment_request accepts the following properties:
| Property | Description | Required |
|---|---|---|
description | A human-readable description of the payment, displayed to the payer when they authorise it | No |
amount | The amount in pence | Yes |
currency | ISO 4217 currency code. GBP is the only supported currency | Yes |
scheme | The scheme used for the payment. faster_payments is the only supported scheme | Yes |
The response contains the billing request id (e.g. BRQ0000302) in pending status. You need it in the next two steps.
For the response and examples in other languages, see Pay By Bank.
Direct Debit fallback#
To let customers who can't use Pay By Bank set up a Direct Debit instead, also set "fallback_enabled": true on the billing request:
The Direct Debit option is only shown if the customer can't find their bank, or if authorising through their bank fails. A billing request can fall back only once. See Retain customers with Fallbacks for details, including when not to use it.

3. Mint a session token linked to the Billing Request#
Mint the session token as described in Setting up an endpoint to mint session tokens, and set links.billing_request to the id of the billing request you created in step 2:
The session token can then only act on that billing request. The billing request must belong to the same organisation as the access token and be in pending status. Otherwise the request fails, with a 404 if the billing request isn't found and an error if it isn't pending.
When a session token expires, the library calls your sessionToken callback again to mint a new one. Your endpoint must link the same billing request every time it mints a token.
4. Mount the component#
Pass the id of the billing request you created in step 2 as billingRequestId:
| Property | Description | Required |
|---|---|---|
| billingRequestId | The id of the billing request you created in step 2 | Yes |
| onError | (error: GoCardlessError) => void — called on error, in addition to the event bus | No |
See all Billing Request options.

5. Testing#
We recommend testing your checkout end to end before going live. Check that you reach the confirmation screen without errors, then confirm the payment was created in the GoCardless dashboard or through the API.

6. Common errors#
Payment authorisation failures#
When authorising with the bank fails in a way the payer can act on, the component shows them one of these screens:
| What the payer sees | Cause | What the payer can do |
|---|---|---|
| Bank connection unsuccessful | A problem connecting to their bank | Try again, or pay with Direct Debit if fallback_enabled is set |
| Your account has insufficient funds | The account doesn't have enough money for the payment | Add funds and try again, or select a different bank |
| Your payment could not be authorised | The payer rejected the authorisation at their bank | Try again, or use a different bank account |
| Your bank authorisation has expired | The payer didn't authorise in time | Try again |
Each failure is also reported to your onError callback as a recoverable error: timeout_error for an expired authorisation, api_error for the others. See Handling errors and events for the error shape.
Billing request errors#
These are reported to onError with the type config_validation:
| Message | Cause |
|---|---|
| Billing requests with auto_fulfil disabled are not supported | The billing request was created with auto_fulfil set to false |
| Scheme not supported | The billing request's scheme isn't available to the component for your organisation |