Flows Reference
Every Link SDK method maps to a distinct user-facing flow. This page describes each flow in the order you're likely to adopt them, with the backend prerequisites you must have in place and the config fields each flow accepts.
Field descriptions live in Config reference; this page only lists which fields each flow uses.
Before any flowEvery flow requires:
- An
app_tokenfor your application, obtained from the developer dashboard.- For every flow except
pay/checkout: acustomer_idfor the end user. Create it server-side viaPOST /customers/v1— see Creating a customer.- For production flows: a customer-scoped
access_token. See Authentication.
Method index
connect
Purpose. Links a customer's bank account with Lean. Walks the user through bank selection, authentication, and consent for the permissions you request.
When to use.
- Granting data access (
identity,accounts,balance,transactions). - Establishing an initial connection that you later extend with payment permissions.
Backend prerequisites.
- Customer created via
POST /customers/v1→ you have acustomer_id. - Customer-scoped
access_token(recommended for production).
Config fields.
| Field | Required | Notes |
|---|---|---|
app_token | ✅ | |
customer_id | ✅ | |
permissions | ✅ | Array of permissions to request. See Config reference → permissions. |
access_token | — | Customer-scoped JWT. |
bank_identifier | — | Pre-select a bank, skip the selection screen. |
account_type | — | "PERSONAL" | "BUSINESS" — filter the bank list. |
access_from / access_to | — | ISO 8601 date range for data access. |
end_user_id, customer_metadata | — | Your own correlation identifiers. |
show_consent_explanation | — | Show extended consent explanation. |
destination_alias, destination_avatar | — | Branding for the destination shown in UI. |
sandbox, language, customization, callback | — | Shared. |
Outcomes.
SUCCESS→ a Payment Source / Entity has been created. Lean will send a webhook.CANCELLED→ user closed the SDK before granting consent.ERROR→ inspectsecondary_status— see LinkSDK statuses.
reconnect
Purpose. Re-authenticates a customer's existing connection when it breaks (e.g. bank-side password change).
When to use.
- You receive a webhook indicating a connection needs re-authentication. The webhook payload contains the
reconnect_id.
Backend prerequisites.
- A
reconnect_idfrom Lean's webhook.
Config fields.
| Field | Required | Notes |
|---|---|---|
app_token | ✅ | |
reconnect_id | ✅ | |
access_token | — | |
destination_alias, destination_avatar | — | |
sandbox, language, customization, callback | — | Shared. |
Deprecated methods
The following methods still work but will be removed in a future major release.
createBeneficiary (deprecated, except on Android)
Alias for updatePaymentSource. On Android, createBeneficiary is still the primary name; everywhere else it's the deprecated alias.
createPaymentSource (deprecated)
Alias for connect with permissions: ["payments"] forced. Retained for older integrations where the customer already has data permissions and only needs payments. New integrations should call connect directly with the desired permissions.
Updated 8 days ago
