Connection lifecycle management: listing a user's bank connections, checking sync status, and removing connections.
A "connection" represents one instance of a user linking a single financial institution. See Connection Lifecycle, Connection Status, and Connections Management.
To create a connection, drive the user through MoneyHub.Auth with
AIS scopes - there is no direct "create connection" API call, since
establishing a connection requires user interaction with their bank.
To refresh an existing connection's data, see MoneyHub.Claims.put_connection_id/2
combined with MoneyHub.Auth.
Summary
Functions
Lists connections available to be made (bank/provider catalog), without requiring a user token - this is a client-credentials-only endpoint.
Lists only API-based (live, non-screen-scraping) connections.
Lists only legacy (screen-scraping) connections.
Lists only connections that support payment initiation (PIS).
Lists only test/mock connections, for use in sandbox development.
Removes a connection and its associated accounts/transactions.
Fetches a single connection by id.
Lists all connections for the user identified by token.
Fetches the sync status of a connection - useful for polling after initiating an asynchronous connection or a refresh.
Triggers an immediate sync of an existing connection, refreshing its
accounts/transactions outside of Moneyhub's normal background schedule.
Requires accounts:read plus either accounts:write or
accounts:write:all.
Types
@type connection() :: map()
Functions
@spec available(MoneyHub.Config.t(), String.t()) :: {:ok, [map()]} | {:error, MoneyHub.Error.t()}
Lists connections available to be made (bank/provider catalog), without requiring a user token - this is a client-credentials-only endpoint.
@spec available_api(MoneyHub.Config.t(), String.t()) :: {:ok, [map()]} | {:error, MoneyHub.Error.t()}
Lists only API-based (live, non-screen-scraping) connections.
@spec available_legacy(MoneyHub.Config.t(), String.t()) :: {:ok, [map()]} | {:error, MoneyHub.Error.t()}
Lists only legacy (screen-scraping) connections.
@spec available_payments(MoneyHub.Config.t(), String.t()) :: {:ok, [map()]} | {:error, MoneyHub.Error.t()}
Lists only connections that support payment initiation (PIS).
@spec available_test(MoneyHub.Config.t(), String.t()) :: {:ok, [map()]} | {:error, MoneyHub.Error.t()}
Lists only test/mock connections, for use in sandbox development.
@spec delete(MoneyHub.Config.t(), String.t(), String.t()) :: :ok | {:error, MoneyHub.Error.t()}
Removes a connection and its associated accounts/transactions.
@spec get(MoneyHub.Config.t(), String.t(), String.t()) :: {:ok, connection()} | {:error, MoneyHub.Error.t()}
Fetches a single connection by id.
@spec list(MoneyHub.Config.t(), String.t()) :: {:ok, [connection()]} | {:error, MoneyHub.Error.t()}
Lists all connections for the user identified by token.
@spec status(MoneyHub.Config.t(), String.t(), String.t()) :: {:ok, map()} | {:error, MoneyHub.Error.t()}
Fetches the sync status of a connection - useful for polling after initiating an asynchronous connection or a refresh.
@spec sync(MoneyHub.Config.t(), String.t(), String.t()) :: {:ok, map()} | {:error, MoneyHub.Error.t()}
Triggers an immediate sync of an existing connection, refreshing its
accounts/transactions outside of Moneyhub's normal background schedule.
Requires accounts:read plus either accounts:write or
accounts:write:all.