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 flow

Every flow requires:

  • An app_token for your application, obtained from the developer dashboard.
  • For every flow except pay/checkout: a customer_id for the end user. Create it server-side via POST /customers/v1 — see Creating a customer.
  • For production flows: a customer-scoped access_token. See Authentication.

Method index

MethodPurposeCategory
connectLink a bank account for data access (and optionally payments).Data
reconnectRestore a broken bank connection.Data

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 a customer_id.
  • Customer-scoped access_token (recommended for production).

Config fields.

FieldRequiredNotes
app_token
customer_id
permissionsArray of permissions to request. See Config reference → permissions.
access_tokenCustomer-scoped JWT.
bank_identifierPre-select a bank, skip the selection screen.
account_type"PERSONAL" | "BUSINESS" — filter the bank list.
access_from / access_toISO 8601 date range for data access.
end_user_id, customer_metadataYour own correlation identifiers.
show_consent_explanationShow extended consent explanation.
destination_alias, destination_avatarBranding for the destination shown in UI.
sandbox, language, customization, callbackShared.

Outcomes.

  • SUCCESS → a Payment Source / Entity has been created. Lean will send a webhook.
  • CANCELLED → user closed the SDK before granting consent.
  • ERROR → inspect secondary_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_id from Lean's webhook.

Config fields.

FieldRequiredNotes
app_token
reconnect_id
access_token
destination_alias, destination_avatar
sandbox, language, customization, callbackShared.

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.