Tink.Link (Tink v1.0.0)

Copy Markdown View Source

Tink Link URL builder for all end-user frontend flows.

Generates redirect URLs for account aggregation, payments, account check, VRP mandates, and bundled reports.

Example

# Account aggregation
url = Tink.Link.build_url(:transactions, %{
  client_id:          Tink.Config.client_id(),
  redirect_uri:       "https://yourapp.com/callback",
  market:             "GB",
  locale:             "en_US",
  scope:              "accounts:read,transactions:read,balances:read",
  authorization_code: code
})

# Payment
url = Tink.Link.build_url(:payment, %{
  client_id:    Tink.Config.client_id(),
  redirect_uri: "https://yourapp.com/callback",
  market:       "GB",
  currency:     "GBP",
  amount:       100
})

# With a pre-created session
url = Tink.Link.build_session_url(:account_check, session_id, %{
  client_id:    Tink.Config.client_id(),
  redirect_uri: "https://yourapp.com/callback",
  market:       "SE"
})

Summary

Functions

Build a Link URL via the service builder endpoint (advanced flows). Requires authorization:grant scope.

Build a Tink Link URL with a pre-created session ID.

Build a Tink Link redirect URL for a given flow.

Create a Tink Link session for pre-authorised flows.

Return all supported flow atoms.

Functions

build_service_url(client, params)

@spec build_service_url(Tink.Client.t(), map()) ::
  {:ok, map()} | {:error, Tink.Error.t()}

Build a Link URL via the service builder endpoint (advanced flows). Requires authorization:grant scope.

build_session_url(flow, session_id, params)

@spec build_session_url(atom(), String.t(), map() | keyword()) :: String.t()

Build a Tink Link URL with a pre-created session ID.

build_url(flow, params)

@spec build_url(atom(), map() | keyword()) :: String.t()

Build a Tink Link redirect URL for a given flow.

Flows

  • :transactions — bank account aggregation
  • :update_consent — refresh an existing consent
  • :account_check — Account Check verification
  • :payment — Payment Initiation
  • :sweeping_vrp — VRP mandate setup
  • :bundled_report — bundled report (income/expense/risk)

create_session(client, params)

@spec create_session(Tink.Client.t(), map()) ::
  {:ok, map()} | {:error, Tink.Error.t()}

Create a Tink Link session for pre-authorised flows.

Returns %{"id" => session_id} which can be passed to build_session_url/3. Requires a client with link-session:write scope.

supported_flows()

@spec supported_flows() :: [atom()]

Return all supported flow atoms.