Build a provider selection screen [Payments V2]
Build the screen your users select a bank on.
To offer open banking payments to your users, you need a provider selection screen. From this screen, your users can select the bank they want to make a payment from. You can build your own provider selection screen with the /v2/single-immediate-payments-providers
endpoint.
We do not recommend that you store the information from the
/providers
endpoint locally as you should expect TrueLayer to update the response returned by the endpoint from time to time. We anticipate updates to happen a few times every quarter.
The providers endpoint serves three purposes:
- Displays which banks are currently active (when a bank is temporarily unavailable, we hide them from this list until its service is restored).
- Provides the assets to build out a selection screen, for example, logos and display names.
- Displays the available schemes, auth flows, and input requirements for each provider.
To get providers whose requirements you support, you have to filter your request using the following query parameters:
Field | Available Values | Mandatory | Description |
---|---|---|---|
client_id | Your client ID | Mandatory | Required for verifying access to providers. |
auth_flow_type | redirect embedded | Mandatory | Will only return providers with schemes that support the listed auth flows. |
account_type | sort_code_account_number iban bban nrb | Mandatory | Will only return providers with schemes that support the listed account identifiers. |
currency | ISO 4217 currency codes for example, GBP,EUR | Mandatory | Will only return providers with schemes that support the listed currencies. |
country | ISO 3166-1 alpha-2 country codes for example, GB,FR | Optional | Will only return providers from the listed countries. |
additional_input_type | text select text_with_image | Optional | Will filter out any provider schemes that require additional_inputs field types not specified (including any on subsequent inputs as part of the embedded flow). If omitted, will only return provider schemes that have no required additional inputs. |
release_channel | live public_beta private_beta | Optional | Determines which providers to return. If omitted, returns all live providers. Returns providers for the value you provide, and also any that are more mature. live is the most mature and private_beta is the least mature. For example, a value of public_beta returns all providers in public_beta and live . |
Each bank available will have the following fields:
Field | Type | Description |
---|---|---|
provider_id | string | This is the provider ID that you will send us in the create payment request. |
logo_url | string | This is the address of the logo asset in SVG form. |
icon_url | string | This is the address of the icon asset in SVG form. |
display_name | string | This is a readable name for the provider. |
country | string | The ISO 3166-1 alpha-2 country code for the provider. |
divisions | string[] | This array includes all divisions that are available on this provider, for example, retail and business would indicate you can use this single provider to access both retail and business accounts. |
single_immediate_payment_schemes | SingleImmediatePaymentScheme[] | The array lists the available schemes the provider can use, within each is described the requirements for the fields on the Single Immediate Payment initiation request. The possible values are in the table below. |
release_stage | string | This indicates the product maturity of the provider. live and public_beta providers are visible to everyone, while private_beta providers must be enabled for the client_id provided in the query parameters to be visible. Values: live , public_beta , private_beta . |
SingleImmediatePaymentScheme
SingleImmediatePaymentScheme
Field | Type | Description |
---|---|---|
scheme_id | string | A unique identifier for the scheme, shared across providers. This should be provided on the single_immediate_payment.scheme_id field on the initiation request. |
fee_options (optional) | FeeOption[] | If present, then fees are payable to make a payment on the scheme, and you must choose an option in this list when initiating a payment. The possible values are in the table below. |
requirements | SingleImmediatePaymentRequirements[] | Contains at least one set of requirements, one of which should be adhered to in order to create a valid initiation request for the scheme. The possible values are in the second table below. |
FeeOption
FeeOption
Field | Type | Description |
---|---|---|
fee_option_id | string | A unique identifier for the fee option, shared across providers. This should be provided on the single_immediate_payment.fee_option_id field on the initiation request. |
beneficiary_fee | string | A value to indicate if the beneficiary would pay any fees on the transaction, when using this fee option. Values: free , payable , unknown |
remitter_fee | string | A value to indicate if the remitter would pay any fees on the transaction, when using this fee option. Values: free , payable , unknown |
SingleImmediatePaymentRequirements
SingleImmediatePaymentRequirements
Each property in the requirements object corresponds to an identically named property on the initiation request for a Single Immediate Payment.
The following sections detail the requirement types and how they should be interpreted in order to build a valid initiation request.
Field | Child Field | Type | Description |
---|---|---|---|
auth_flow | - | AuthFlowRequirements | Which auth flows are supported and what fields are required/available to initiate a payment for those flows. The possible values are in the table below. |
single_immediate_payment | currency | CurrencyRequirements | Which currencies are supported. The possible values are in the fourth table below. |
single_immediate_payment | beneficiary | ParticipantRequirements | Which beneficiary details are required/supported. The possible values are in the fifth table below. |
single_immediate_payment | remitter (optional) | ParticipantRequirements | Which remitter details are required/supported. If omitted, the scheme does not support receiving remitter details. |
single_immediate_payment | references | ReferenceRequirements | Which reference types are required/supported. The possible values are in the sixth table below. |
AuthFlowRequirements
AuthFlowRequirements
Field | Type | Description |
---|---|---|
types | string[] | A list of supported auth flow types. Values: redirect ,embedded . |
redirect (optional) | RedirectAuthFlowRequirements | Will be set if redirect is supported. The possible values are in the table below. |
embedded (optional) | EmbeddedAuthFlowRequirements | Will be set if embedded is supported. The possible values are in the second table below. |
RedirectAuthFlowRequirements
RedirectAuthFlowRequirements
Field | Type | Description |
---|---|---|
psu_ip_address_required (optional) | boolean | Indicates if auth_flow.psu_ip_address is required on the initiation request. |
data_access_token_supported (optional) | boolean | Indicates if auth_flow.data_access_token can be provided on the initiation request, to maintain long lived consents across products (Data API and Payment API), where the provider only allows a single active consent across both AIS and PIS services. |
additional_inputs (optional) | AdditionalInputs | An optional dictionary of ID to additional inputs that must be collected from the end user to initiate a payment. These inputs should be provided using the same IDs in the auth_flow.additional_inputs string dictionary on the initiation request. |
EmbeddedAuthFlowRequirements
EmbeddedAuthFlowRequirements
Field | Type | Description |
---|---|---|
additional_input_types | string[] | A list of additional input field types that may be returned during the embedded authorisation flow (not inclusive of those required on initiation below). Values: text , text_with_image , select . |
additional_inputs (optional) | AdditionalInputs | An optional dictionary of ID to additional inputs that must be collected from the end user to initiate a payment. These inputs should be provided using the same IDs in the auth_flow.additional_inputs string dictionary on the initiation request. |
CurrencyRequirements
CurrencyRequirements
Field | Type | Description |
---|---|---|
supported_currencies | string[] | A list of ISO 4217 currency codes supported by the provider scheme. |
ParticipantRequirements
ParticipantRequirements
Field | Child Field | Type | Description |
---|---|---|---|
account | types | string[] | A list of account types supported by the scheme. Values: sort_code_account_number , iban , bban , nrb . |
name (optional) | - | StringFieldRequirements | An object detailing the requirements for the name, if omitted then setting the name on the initiation request is not supported for this scheme. |
mandatory | - | bool | If a remitter is required. Not present on beneficiary as that is always mandatory. |
ReferenceRequirements
ReferenceRequirements
Field | Child Field | Type | Description |
---|---|---|---|
types | - | string[] | A list of supported reference types. Values: single ,separate |
single (optional) | - | StringFieldRequirements | Will be set if single is supported. Specifies the requirements for a single reference string for the payment. The possible values are in the table below. |
separate (optional) | beneficiary | StringFieldRequirements | Will be set if separate is supported. Specifies the requirements for the beneficiary reference string for the payment. |
separate (optional) | remitter | StringFieldRequirements | Will be set if separate is supported. Specifies the requirements for the remitter reference string for the payment. |
StringFieldRequirements
StringFieldRequirements
Field | Type | Requirement Description |
---|---|---|
mandatory | boolean | The corresponding field on the request is mandatory. |
min_length | integer | The corresponding field on the request must be at least this many characters. |
max_length | integer | The corresponding field on the request must be at most this many characters. |
regex | string | The corresponding field on the request must match the regular expression. |
format | string | A well known format to help you communicate to your client how the field will be validated. Values: any , numerical , alphabetical , alphanumerical , email |
AdditionalInputs
AdditionalInputs
The additional_inputs
object on responses is a dictionary of input IDs to an object describing the input required. The structure of the input object differs based on the type
property, and can be one of the following:
Input Type | Description | Corresponding Request Value |
---|---|---|
text | Requires the end user to enter a string value | The string value the end user entered |
text_with_image | Displays an image to the end user and requires them to enter a string value | The string value the end user entered |
select | Provides a list of options for the end user to select from | The id of the selected option |
Text input
Field | Type | Description |
---|---|---|
type | string | Value indicating the field type: text |
display_text | string | Text to describe what the field is asking for (English) |
provider_description (optional) | string | Text directly from the bank relating to the field |
mandatory | boolean | If the input must be provided |
sensitive | boolean | If the input is sensitive (should be masked in UI) |
min_length | integer | The minimum length of the input text |
max_length | integer | The maximum length of the input text |
regex | string | A regular expression the input text must match |
format | string | A well known format, to facilitate being able to show useful prompts to the user. Values: any , numerical , alphabetical , alphanumerical , email |
{
"some_input_id": {
"type": "text",
"display_text": "Some display text in English",
"provider_description": "A message from the bank",
"mandatory": true,
"sensitive": false,
"min_length": 5,
"max_length": 15,
"regex": "^[a-z ]{5,15}$",
"format": "alphabetical"
}
}
{
"some_input_id": "entered value"
}
Text with image input
Field | Type | Description |
---|---|---|
type | string | Value indicating the field type: text_with_image |
display_text | string | Text to describe what the field is asking for (English) |
provider_description (optional) | string | Text directly from the bank relating to the field |
mandatory | boolean | If the input must be provided |
sensitive | boolean | If the input is sensitive (should be masked in UI) |
min_length | integer | The minimum length of the input text |
max_length | integer | The maximum length of the input text |
regex | string | A regular expression the input text must match |
format | string | A well known format, to facilitate being able to show useful prompts to the user. Values: any , numerical , alphabetical , alphanumerical , email |
image | object | An image to display to the end user (for example, a QR code). The image object can be of two types, base64 or uri .If type is base64 , there will be a base64 property containing the base64 data and media_type .If type is uri , there will be a uri property with a URI to a hosted copy of the image. |
{
"some_input_id": {
"type": "text_with_image",
"display_text": "Some display text in English",
"provider_description": "A message from the bank",
"mandatory": true,
"sensitive": false,
"min_length": 5,
"max_length": 15,
"regex": "^[a-z ]{5,15}$",
"format": "alphabetical",
"image": {
"type": "base64",
"base64": {
"data":
"iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8vlr6PwAHHAK+MKsa+gAAAABJRU5ErkJggg==",
"media_type": "image/png"
}
}
}
}
{
"some_input_id": "entered value"
}
Select input
Field | Type | Description |
---|---|---|
type | string | Value indicating the field type: select |
display_text | string | Text to describe what the field is asking for (English) |
provider_description (optional) | string | Text directly from the bank relating to the field |
mandatory | boolean | If the input must be provided |
options | SelectOption[] | A list of id -display_text pairs to present to the end user as options (for example, a drop down). |
{
"some_input_id": {
"type": "select",
"display_text": "Some display text in English",
"provider_description": "A message from the bank",
"mandatory": true,
"options": [
{
"id": "option-a",
"display_text": "First Option"
},
{
"id": "option-b",
"display_text": "Second Option"
}
]
}
}
{
"some_input_id": "option-b"
}
SelectOption
SelectOption
Field | Type | Description |
---|---|---|
id | string | Value to be provided on the initiation request, if the option is selected |
display_text | string | Text to describe the option |
Make a GET /providers
call:
https://pay-api.truelayer.com/v2/single-immediate-payments-providers?client_id=myclient-123456&auth_flow_type=redirect,embedded&account_type=sort_code_account_number,iban&additional_input_type=text,select¤cy=GBP,EUR
You get a response as below:
{
"results": [
{
"provider_id": "ob-example",
"logo_url": "https://truelayer-client-logos.s3-eu-west-1.amazonaws.com/banks/ob-example.svg",
"display_name": "Example OB Bank",
"country": "GB",
"divisions": [ "retail", "business" ],
"single_immediate_payment_schemes": [
{
"scheme_id": "faster_payments_service",
"requirements": {
"auth_flow": {
"types": [ "redirect" ],
"redirect": {
"data_access_token_supported": true
}
},
"single_immediate_payment": {
"currency": {
"supported_currencies": [ "GBP" ]
},
"beneficiary": {
"account": {
"types": [ "sort_code_account_number" ],
},
"name": {
"mandatory": true,
"min_length": 1,
"max_length": 20,
"regex": "[\\w\\d ]{1,20}",
"format": "any"
}
},
"remitter": {
"mandatory": false,
"account": {
"types": [ "sort_code_account_number" ],
},
"name": {
"mandatory": false,
"min_length": 1,
"max_length": 20,
"regex": "[\\w\\d ]{1,20}",
"format": "any"
}
},
"references": {
"types": [ "single", "separate" ],
"single": {
"min_length": 1,
"max_length": 20,
"regex": "[\\w\\d \\.-]{1,20}",
"format": "any"
},
"separate": {
"beneficiary": {
"min_length": 1,
"max_length": 20,
"regex": "[\\w\\d \\.-]{1,20}",
"format": "any"
},
"remitter": {
"min_length": 1,
"max_length": 20,
"regex": "[\\w\\d \\.-]{1,20}",
"format": "any"
}
}
}
}
}
}
]
}
]
}
Use this response to create your provider selection screen.
Updated 7 months ago