Retrieve bank data

Learn how to connect with our Data API and retrieve bank data in a few quick steps.

You can connect with our Data API and retrieve bank data quickly:

  1. Sign up to our Console.
  2. Generate an authentication link. This link provides a simple user interface for your users to connect their bank accounts.
  3. Log into our Mock Bank account and obtain an access_token. You can use this access_token to get sample user data (accounts, transactions, balances, and so on).

See Data API Overview for more information including available data and supported countries.

📘

See it in action

Try our demo application Piggy Bank to see a working example of a TrueLayer integration.

Build with Postman

Step 1 - Sign up

  1. Sign up to our Console > App settings and get your client_id and client_secret.
  2. Download our sandbox Postman collection and environment so you can quickly familiarise yourself with the Data API. The collection contains sample requests to retrieve data and generate code snippets in various languages. Alternatively, you can download the live Postman collection and environment.

Step 2 - Authorise a user

Create an authentication link to authenticate users. This auth link provides an easy user interface to demo connecting to our Mock Bank. To do so:

  1. Go to Console > Data API > Auth Link Builder.
  2. In the Providers tab, select the Mock provider to test your integration with our Mock Bank.
  3. Switch to the Permissions tab to select the set of permissions that you want to include in the Authentication link. These permissions limit the endpoints of the Data API that your application can access.
  4. Switch to the Redirect tab to choose a Redirect URI to redirect the user to after authentication.
  5. Select the Preview icon to open the generated test Authentication Link and select Allow.
  6. Select Mock Bank and use a set of our Mock Bank credentials, for example, john/doe, to obtain a code.
  7. Store this code. You need it get an access token.

Step 3 - Obtain an access token

Use the Postman Exchange code for access token request within the Access tokens folder to get an access_token. To do so:

  1. Select the Truelayer Data Products Sandbox environment.
  2. Add values to the following variables within the environment:
    • client_id : Your sandbox application's client_id
    • client_secret : Your sandbox application's client_secret
    • redirect_uri : This variable already contains the default redirect URI from the Console, but you can change it if needed.
  3. Open the Exchange code for access token request and add the code you stored in Step 2 to the code parameter in the request body.
  4. Send the request. If successful, you retrieve a response containing an access_token and refresh_token.

Step 4 - Access data

With the access_token, run any of the requests in the Data API folder in the Sandbox Postman collection to retrieve sample account numbers, transaction data or personal information.

For example: the List all accounts request within the Data > Accounts folder retrieves all account information for the given set of credentials.


Did this page help you?