Connect to a bank

Introduction

Connecting to a bank account enables payments and data requests with Lean's APIs. Bank connections are stored as Entities and Payment Sources for Data and Payment applications respectively.

In order to connect a user's bank account you need to implement the following items:

  • Create a Customer
  • Implement the LinkSDK and use the .connect() method
  • Implement a webhook handler for the entity.created and/or payment_source.beneficiary.updated webhooks.

More details Fetching Bank Data: Open Finance Enablement

Entity model

An Entity maps to a user's entire relationship with a specific bank. You will need to decide on the permissions you want to gain consent for from your customer during the linking process.

An example entities for a customer will look something like the following:

Get Entities for a Customer API reference is here.

[{
    "id": "79a59cd9-d95c-43ec-9a8f-9a203b9085f2",
    "customer_id": "46e347b6-ad9b-4a35-9f68-23de08c182b0",
    "bank_identifier": "MOCK_UAE",
    "permissions": {
      "identity": true,
      "accounts": true,
      "balance": true,
      "transactions": true,
      "identities": false,
      "scheduled_payments": false,
      "standing_orders": false,
      "direct_debits": false,
      "beneficiaries": false
    },
    "bank_type": "RETAIL",
    "created_at": "2026-01-12T15:07:06.089596Z",
    "consents": [
      {
        "id": "886c65d1-ce6c-469d-a57f-195cba4bbafc",
        "bank_consent_id": "b5f06361-6bd1-4bff-af79-c594312881dc",
        "bank_identifier": null,
        "consent_type": null,
        "consent_status": "ACTIVE",
        "standard_consent_status": null,
        "permissions": {
          "identity": true,
          "accounts": true,
          "balance": true,
          "transactions": true,
          "identities": false,
          "scheduled_payments": false,
          "standing_orders": false,
          "direct_debits": false,
          "beneficiaries": false
        },
        "creation_date_time": "2026-01-12T15:05:46Z",
        "status_update_date_time": "2026-01-12T15:05:46Z",
        "expiration_date_time": "2027-01-12T15:05:45.169Z",
        "transaction_from_date_time": null,
        "transaction_to_date_time": null,
        "accounts": [
          {
            "scheme_name": "ACCOUNT_NUMBER",
            "identification": "0331234567890123456",
            "name": "Lean Bank Account",
            "secondary_identification": null
          },
          {
            "scheme_name": "IBAN",
            "identification": "AE070331234567890123456",
            "name": "Lean Bank Account",
            "secondary_identification": null
          }
        ]
      }
    ]
}]

Full details of fetching bank data in open finance is here.