Accounts and cards

Learn how to get details, available balances, and transaction data from user bank accounts and cards.

With our Data API, you can get relevant information such as balance details and transactions from your user's bank accounts and cards.

Accounts

You can find information about a user's finances through their accounts. We currently support four account types:

  • TRANSACTION: A transaction account is a checking account or current account. It is an account commonly used for everyday transactions. Can earn little or no interest. Also, could be linked to a short term lending product (such as an overdraft).
  • SAVINGS: An account that accrues interest at an agreed rate and interval. Can have restrictions around withdrawal of funds.
  • BUSINESS_TRANSACTION: A transaction account for a business
  • BUSINESS_SAVINGS: A savings account for a business

Get all accounts

You can get all user accounts and any associated data by making a GET /accounts call. You'll need the accounts permission to make this request.

curl -H "Authorization: Bearer ${access_token}" \
  https://api.truelayer.com/data/v1/accounts

You'll find the following in the response:

Parameter

Type

Description

account_id

string

Unique identifier of the account.

account_type

string

Type of the account.

account_number.swift_bic

string

ISO 9362:2009 Business Identifier Codes.

currency

string

ISO 4217 alpha-3 currency code of the account.

display_name

string

Human-readable name of the account.

update_timestamp

datetime

Time when the account information was last updated.

provider.provider_id

string

Unique identifier for the provider.

For the full list with optional and deprecated response parameters, see our API reference.

{
  "results": [
    {
      "update_timestamp": "2017-02-07T17:29:24.740802Z",
      "account_id": "f1234560abf9f57287637624def390871",
      "account_type": "TRANSACTION",
      "display_name": "Club Lloyds",
      "currency": "GBP",
      "account_number": {
        "iban": "GB35LOYD12345678901234",
        "number": "12345678",
        "sort_code": "12-34-56",
        "swift_bic": "LOYDGB2L"
      },
      "provider": {
        "provider_id": "lloyds"
      }
    },
    {
      "update_timestamp": "2017-02-07T17:29:24.740802Z",
      "account_id": "f1234560abf9f57287637624def390872",
      "account_type": "SAVINGS",
      "display_name": "Club Lloyds",
      "currency": "GBP",
      "account_number": {
        "iban": "GB35LOYD12345678901235",
        "number": "12345679",
        "sort_code": "12-34-57",
        "swift_bic": "LOYDGB2L"
      },
      "provider": {
        "provider_id": "lloyds"
      }
    }
  ]
}

Get account information of a specific account

You can get data associated with an account by making a GET /accounts/${account_id) call. You'll need the accounts permission to make this request.

curl -H "Authorization: Bearer ${access_token}" \
  https://api.truelayer.com/data/v1/accounts/${account_id}

The response includes the following:

Parameter

Type

Description

account_id

string

Unique identifier of the account.

account_type

string

Type of the account.

account_number.swift_bic

string

ISO 9362:2009 Business Identifier Codes.

currency

string

ISO 4217 alpha-3 currency code of the account.

display_name

string

Human-readable name of the account.

update_timestamp

datetime

Time when the account information was last updated.

provider.provider_id

string

Unique identifier for the provider.

For the full list with optional and deprecated response parameters, see our API reference .

{
  "results": [
    {
      "update_timestamp": "2017-02-07T17:29:24.740802Z",
      "account_id": "f1234560abf9f57287637624def390871",
      "account_type": "TRANSACTION",
      "display_name": "Club Lloyds",
      "currency": "GBP",
      "account_number": {
        "iban": "GB35LOYD12345678901234",
        "number": "12345678",
        "sort_code": "12-34-56"
      },
      "provider": {
        "provider_id": "lloyds"
      }
    }
  ]
}

Get the balance in an account

You can get the balance in an account by making a GET /accounts/${account_id}/balance call:

curl -H "Authorization: Bearer ${access_token}" \
  https://api.truelayer.com/data/v1/accounts/${account_id}/balance

The response will return the current balance of the account:

{
  "results": [
    {
      "currency": "GBP",
      "available": 2150.8,
      "current": 1161.2,
      "overdraft": 1000,
      "update_timestamp": "2017-02-07T17:33:30.001222Z"
    }
  ]
}

Get account transaction data

You can also get the transaction data for a specific account by making a GET /accounts/${account_id}/transactions call. You can optionally include from and to parameters to retrieve transaction data from a specified period of time.

curl -H "Authorization: Bearer ${access_token}" \
  "https://api.truelayer.com/data/v1/accounts/${account_id}/transactions?from=${from}&to=${to}"

You'll get a response including:

Parameter

Type

Description

transaction_id

string

Unique identifier of the transaction in a request. It may change between requests.

timestamp

datetime

Date the transaction was posted on the account.

description

string

Original description of the transaction as reported by the provider.

transaction_type

string

Type of the transaction.

transaction_category

string

Category of the transaction

transaction_classification

array

Classification of the transaction. Array can be empty if classification has not been successfully assigned.

amount

number

Amount of the transaction.

currency

string

ISO 4217 alpha-3 currency code.

meta

object

A collection of additional provider specific transaction metadata.

For the list of optional response parameters, see our API reference.

{
  "results": [
    {
      "transaction_id": "03c333979b729315545816aaa365c33f",
      "timestamp": "2018-03-06T00:00:00",
      "description": "GOOGLE PLAY STORE",
      "amount": -2.99,
      "currency": "GBP",
      "transaction_type": "DEBIT",
      "transaction_category": "PURCHASE",
      "transaction_classification": [
        "Entertainment",
        "Games"
      ],
      "merchant_name": "Google play",
      "running_balance": {
        "amount": 1238.60,
        "currency": "GBP"
      },
      "meta": {
        "bank_transaction_id": "9882ks-00js",
        "provider_transaction_category": "DEB"
      }
    },
    {
      "transaction_id": "3484333edb2078e77cf2ed58f1dec11e",
      "timestamp": "2018-02-18T00:00:00",
      "description": "PAYPAL EBAY",
      "amount": -25.25,
      "currency": "GBP",
      "transaction_type": "DEBIT",
      "transaction_category": "PURCHASE",
      "transaction_classification": [
        "Shopping",
        "General"
      ],
      "merchant_name": "Ebay",
      "meta": {
        "bank_transaction_id": "33b5555724",
        "provider_transaction_category": "DEB"
      }
    }
  ]
}

Cards

You can also use our Data API to get the balance and transaction data associated with a user's card.

Get all cards

You can get all stored user cards and associated data by making a GET /cards call. You'll need to have the cards permission to make this request.

curl -H "Authorization: Bearer ${access_token}" \
  https://api.truelayer.com/data/v1/cards

You'll receive a response with the following:

Parameter

Type

Description

account_id

string

Unique identifier of the account.

card_network

string

Card processor. For example, VISA.

card_type

string

Type of card. For example, Credit.

currency

string

ISO 4217 alpha-3 currency code of the account.

display_name

string

Human-readable name of the account.

partial_card_number

string

Last four digits of the card

update_timestamp

datetime

Time when the card information was last updated.

provider.provider_id

string

Unique identifier for the provider.

For the full list of response parameters including the optional and deprecated ones, see our API Reference.

{
  "results": [
    {
      "account_id": "f7b093437032c216d4350b7d442b9c5ccc0e9f19",
      "card_network": "VISA",
      "card_type": "CREDIT",
      "currency": "GBP",
      "display_name": "Club Credit Card",
      "partial_card_number": "0044",
      "name_on_card": "A. N. Other",
      "valid_from": "2017-01",
      "valid_to": "2018-01",
      "update_timestamp": "2017-02-07T17:29:24.740802Z",
      "provider": {
        "provider_id": "lloyds"
      }
    },
    {
      "account_id": "ad86fb1c213245b6b6594895068973efca5f9367",
      "card_network": "MASTERCARD",
      "card_type": "CHARGE",
      "currency": "GBP",
      "display_name": "Club Charge Card",
      "partial_card_number": "0055",
      "name_on_card": "A. N. Other",
      "valid_from": "2017-01",
      "valid_to": "2018-01",
      "update_timestamp": "2017-02-07T17:29:24.740802Z",
      "provider": {
        "provider_id": "lloyds"
      }
    }
  ]
}

Get card information of a specific card

To get data for a specific card, make a GET /cards/${account_id} call:

curl -H "Authorization: Bearer ${access_token}" \
  https://api.truelayer.com/data/v1/cards/${account_id}

You'll get a response with the following:

Parameter

Type

Description

account_id

string

Unique identifier of the account.

card_network

string

Processing network (for example, VISA).

card_type

string

Type of card (for example, Credit).

currency

string

ISO 4217 alpha-3 currency code of the account.

display_name

string

Human-readable name of the account.

partial_card_number

string

Last 4 digits of the card number or the primary account number (PAN).

update_timestamp

datetime

Last update time of the card information.

`provider.provider_id

string

Unique identifier for the provider.

For a full list of optional and deprecated response parameters, see our API reference.

{
  "results": [
    {
      "account_id": "f7b093437032c216d4350b7d442b9c5ccc0e9f19",
      "card_network": "VISA",
      "card_type": "CREDIT",
      "currency": "GBP",
      "display_name": "Club Credit Card",
      "partial_card_number": "0044",
      "name_on_card": "A. N. Other",
      "valid_from": "2017-01",
      "valid_to": "2018-01",
      "update_timestamp": "2017-02-07T17:29:24.740802Z",
      "provider": {
        "provider_id": "lloyds"
      }
    }
  ]
}

Get balance on a card

To get the balance on a user's card, make a GET /cards/${account_id}/balance call. You'll need the card and balance permissions.

curl -H "Authorization: Bearer ${access_token}" \
  https://api.truelayer.com/data/v1/cards/${account_id}/balance

You'll get a response with the following:

Parameter

Type

Description

currency

string

ISO 4217 alpha-3 currency code.

current

number

The amount of expenditure on the card. This does not include any pending transactions.

A positive current amount represents money owed to the provider from the card holder. A negative current amount represents money owed to the card holder from the provider.

update_timestamp

datetime

Last update time of the card's balance.

You can optionally get an available amount in the response which takes any pending transactions into account. A negative available amount means the card’s credit limit has been exceeded. A positive available amount represents the credit available to the cardholder. For the complete list of optional and mandatory response parameters, see our API reference.

{
  "results": [
    {
      "available": 3279.0,
      "currency": "GBP",
      "current": 20.0,
      "credit_limit": 3300,
      "last_statement_balance": 420.0,
      "last_statement_date": "2017-01-28",
      "payment_due": 5.0,
      "payment_due_date": "2017-02-24",
      "update_timestamp": "2017-02-247T17:29:24.740802Z"
    }
  ]
}

Get card transaction data

To get transaction data from a user's card, make a GET /cards/${account_id}/transactions. You can optionally include from and to parameters to retrieve transaction data from a specified period of time.

📘

Make sure to use the from and to parameters together. Using one of them changes the time period to a default value of 88 days.

curl -H "Authorization: Bearer ${access_token}" \
  "https://api.truelayer.com/data/v1/cards/${account_id}/transactions?from=${from}&to=${to}"

You'll get a response including:

Parameter

Type

Description

transaction_id

string

Unique identifier of the transaction in a request. It may change between requests.

timestamp

datetime

Date the transaction was posted on the account.

description

string

Original description of the transaction as reported by the provider.

transaction_type

string

Type of the transaction.

Possible values:
CREDIT: Indicates an incoming fund.
DEBIT: Indicates an outgoing fund.

transaction_category

string

Category of the transaction.

transaction_classification

array

Classification of the transaction. Array can be empty if classification has not been successfully assigned.

amount

number

Amount of the transaction.

A positive transaction amount reflects the flow of funds out of a card, such as a purchase. A negative amount indicates the flow of funds into the card, for example a refund.

currency

string

ISO 4217 alpha-3 currency code.

meta

object

A collection of additional provider-specific transaction metadata.

You can optionally get an running_balance.amount in the response which displays any available running balance. A positive running balance amount represents money owed to the provider by the cardholder. A negative running balance amount represents money owed to the cardholder by the provider. For the complete list of optional and mandatory response parameters, see our API reference.

{
  "results": [
    {
      "transaction_id": "a15d8156569ba848d84c07c34d291bca",
      "timestamp": "2018-01-16T00:00:00+00:00",
      "amount": 24.25,
      "currency": "GBP",
      "description": "SAINSBURYS SMRKT STORE 128",
      "transaction_type": "DEBIT",
      "transaction_category": "PURCHASE",
      "running_balance": {
        "amount": 1238.60,
        "currency": "GBP"
      },
      "meta": {
        "cardNumber": "1234********5678",
        "location": "INTERNET"
      }
    },
    {
      "transaction_id": "af4d5470cc7ad6a83a02335ab8053481",
      "timestamp": "2018-03-19T00:00:00",
      "amount": 46.82,
      "currency": "GBP",
      "description": "TALKTALK TELECOM",
      "transaction_type": "DEBIT",
      "transaction_category": "PURCHASE",
      "meta":{
        "provider_transaction_category": "DEB",
        "cardNumber": "1234********5678",
        "location": "INTERNET"
      }
    }
  ]
}

Did this page help you?