Test your TrueLayer integration
Test our TrueLayer integration by reading test data from the Demo Bank account or an alternative banking source
You can test your TrueLayer banking integration by retrieving test data from the Demo Bank account, or another banking source. We recommend you do this before sending LinkLink The authorization flow that allows end users to connect their accounting, banking, or commerce platforms to your application via Codat. URLs to your SMBSMB The primary customer segment that Codat helps businesses serve, typically companies with annual revenues under $500 million. customers.
You'll need to:
- Set up a test companyCompany In Codat, a company represents your customer's business entity. Companies can have multiple connections to different data sources. and generate a LinkLink The authorization flow that allows end users to connect their accounting, banking, or commerce platforms to your application via Codat. URL
- Connect to a bank account
- Check your banking data
Then, you can retrieve and check data from the connected bank account.
Prerequisites
Set up a test companyCompany In Codat, a company represents your customer's business entity. Companies can have multiple connections to different data sources. and generate a LinkLink The authorization flow that allows end users to connect their accounting, banking, or commerce platforms to your application via Codat. URL
Before you start, decide which type of banking source you want to test. This procedure uses the Demo Bank source, which is enabled in the TrueLayer settings in the Codat Portal by default. You'll need to adapt these steps if you choose to use an alternative banking source.
Retrieve the platform key of the Demo Bank data sourceData source An external platform (such as QuickBooks, Xero, or a bank) that Codat integrates with to pull or push financial data., or an alternative banking source, and then generate a LinkLink The authorization flow that allows end users to connect their accounting, banking, or commerce platforms to your application via Codat. URL.
- Log in to the Codat Portal.
- Open the GET integrations endpoint.
- Send a GET request to return a list of all integrations.
- Search for
Demo Bank, or the alternative banking source you want to use. All banking integrations have a sourceType ofBanking. For example:
{
"key": "demobank_truelayer",
"logoUrl": "https://static.codat.io/public/platforms/demobank_truelayer.png",
"name": "Demo Bank",
"enabled": true,
"sourceId": "22222222-7778-46cc-8544-952fe34a5e3a",
"integrationId": "22222222-b2bf-4213-b594-1fb9474cbaf0",
"sourceType": "Banking"
}
Use these details to create a companyCompany In Codat, a company represents your customer's business entity. Companies can have multiple connections to different data sources.; this returns the LinkLink The authorization flow that allows end users to connect their accounting, banking, or commerce platforms to your application via Codat. URL you need for testing.
- Open the
POST /companiesendpoint. - Enter a name for your test companyCompany In Codat, a company represents your customer's business entity. Companies can have multiple connections to different data sources. and add the platform
keyfor your chosen banking source:
{
"name": "companyname",
"platformType": "demobank_truelayer"
}
- Send your request to create the test companyCompany In Codat, a company represents your customer's business entity. Companies can have multiple connections to different data sources. and its corresponding LinkLink The authorization flow that allows end users to connect their accounting, banking, or commerce platforms to your application via Codat. URL. The response looks something like this:
{
"id": "22222222-9b99-475f-b7e8-4f9a09b9289d",
"name": "companyname",
"platform": "TrueLayer Open Banking",
"redirect": "https://link.codat.io/link/start/22222222-9b99-475f-b7e8-4f9a09b9289d/00dbe10e-8f4a-43c2-935f-45d474576fb7",
"status": "PendingAuth",
"dataConnections": [
{
"id": "22222222-8f4a-43c2-935f-45d474576fb7",
"integrationId": "22222222-b2bf-4213-b594-1fb9474cbaf0",
"sourceId": "22222222-7778-46cc-8544-952fe34a5e3a",
"platformName": "TrueLayer Open Banking",
"linkUrl": "https://link.codat.io/link/start/22222222-9b99-475f-b7e8-4f9a09b9289d/00dbe10e-8f4a-43c2-935f-45d474576fb7",
"status": "PendingAuth",
"created": "2020-06-24T11:13:27.6232806Z"
}
],
"created": "2020-06-24T11:13:25.8263019Z"
}
Copy the JSON response to use in the next procedure.
Connect to a bank account
If you've chosen to connect to a bank data sourceData source An external platform (such as QuickBooks, Xero, or a bank) that Codat integrates with to pull or push financial data. other than the Demo Bank, you'll need login details for an account at that institution.
For testing purposes only, follow the process that your customers normally use to authorize a connectionConnection A link between a Codat company and a data source (like an accounting platform). Each connection represents authorized access to pull or push data from that platform. to their bank accounts.
- In your browser, enter the
linkUrlvalue from the JSON you saved in steps 6 and 7 of the preceding task. The linkLink The authorization flow that allows end users to connect their accounting, banking, or commerce platforms to your application via Codat. takes you to a TrueLayer landing page. - Select ALLOW to linkLink The authorization flow that allows end users to connect their accounting, banking, or commerce platforms to your application via Codat. the Demo Bank account. A login page is displayed.
- For the Demo Bank, enter the test credentials shown on the login page. The account is linked automatically and you return to LinkLink The authorization flow that allows end users to connect their accounting, banking, or commerce platforms to your application via Codat..
You're now ready to start testing.
Check your banking data
You can check data from Demo Bank account in two ways: in the Codat Portal and through the Codat APIAPI A set of rules and protocols that allows different software applications to communicate with each other. Codat provides APIs for accessing financial data from accounting, banking, and commerce platforms..
To perform a quick check in the Codat Portal:
- On the navigation bar, select Companies, and search for the test companyCompany In Codat, a company represents your customer's business entity. Companies can have multiple connections to different data sources. that you created.
- Click on the companyCompany In Codat, a company represents your customer's business entity. Companies can have multiple connections to different data sources. name.
- Select Data > Banking in the side navigation menu.
- In the Data type dropdown, select New to show the new banking data types.
- Click Banking - Accounts to view accounts and related transaction data.
To retrieve the same data from the Codat APIAPI A set of rules and protocols that allows different software applications to communicate with each other. Codat provides APIs for accessing financial data from accounting, banking, and commerce platforms., you'll need the JSON from step 6 of "Set up a test companyCompany In Codat, a company represents your customer's business entity. Companies can have multiple connections to different data sources. and generate a LinkLink The authorization flow that allows end users to connect their accounting, banking, or commerce platforms to your application via Codat. URL".
To retrieve account details using the Codat APIAPI A set of rules and protocols that allows different software applications to communicate with each other. Codat provides APIs for accessing financial data from accounting, banking, and commerce platforms.:
- Open the
GET /companies/{companyId}/connections/{connectionId}/data/banking-accountsendpoint.- Replace
{companyId}with theidof your test companyCompany In Codat, a company represents your customer's business entity. Companies can have multiple connections to different data sources.. - Replace
{connectionId}with theidfromdataConnections.
- Replace
- Send your request to return a list of account details:
{
"results": [
{
"id": "2cbf9b6063102763ccbe3ea62f1b3e72",
"name": "Business Current Account",
"informalName": "Codat",
"holder": "Codat Ltd",
"type": "Debit",
"balance": {
"available": 459987.97,
"current": 459987.97,
"limit": -10000
},
"identifiers": {
"type": "Debit",
"subtype": "Business",
"number": "46762629",
"bankCode": "009911",
"iban": "GB29 LOYD 4773 2346 7626 29",
"bic": "LOYDGB21006",
"maskedAccountNumber": "1111111"
},
"currency": "GBP",
"institution": {
"id": "lloyds-bank",
"name": "Lloyds Bank"
},
"modifiedDate": "2022-06-21T16:14:11.194Z",
"sourceModifiedDate": "2022-06-21T16:14:11.194Z"
}
- Optional: Use the
GET /companies/{companyId}/connections/{connectionId}/data/banking-transactionsendpoint in the same way to retrieve the transactions for each account.
You're now ready to set up and connect your SMBSMB The primary customer segment that Codat helps businesses serve, typically companies with annual revenues under $500 million. customers. Follow the methods described in Set up a test company and generate a Link URL.