An Elixir client for the Weavr Multi embedded banking API.
Quick start (stateless)
config = Weavr.Config.new(api_key: System.fetch_env!("WEAVR_API_KEY"), environment: :sandbox)
{:ok, %{auth_token: token}} =
Weavr.Auth.login_with_password(config, email: "user@example.com", password: "secret")
{:ok, accounts} = Weavr.Accounts.list(config, auth_token: token)Quick start (stateful Weavr.Client)
{:ok, client} = Weavr.Client.start_link(api_key: "...", environment: :sandbox)
:ok = Weavr.Client.login_with_password(client, email: "user@example.com", password: "secret")
{:ok, token} = Weavr.Client.current_token(client)
{:ok, accounts} = Weavr.Accounts.list(Weavr.Client.config(client), auth_token: token)Module overview
Core
Weavr.Config— environment-aware configuration (Sandbox/Live, Multi/BackOffice)Weavr.Client— stateful GenServer for managing per-user auth sessionsWeavr.Auth— login, token exchange, identity listing, logout, SCA detectionWeavr.Error— error struct hierarchy (API, Network, Timeout, InvalidRequest, Decode)
Resources
Weavr.Corporates— Corporate identities and KYBWeavr.Consumers— Consumer identities and KYCWeavr.Users— Authorised Users (and root user listing)Weavr.Passwords— password creation, update, and lost-password flowWeavr.Accounts— Managed Accounts (IBAN, block/unblock, statement)Weavr.Cards— Managed Cards (virtual/physical, spend rules, statement)Weavr.Transfers— intra-identity fund transfersWeavr.Sends— Outgoing Wire Transfers between identitiesWeavr.LinkedAccounts— external bank account connectionsWeavr.StepUp— SCA/PSD2 step-up challenge initiation and verificationWeavr.AuthenticationFactors— OTP device/channel enrolmentWeavr.Bulk— bulk operation lifecycle (submit/execute/pause/resume/cancel)Weavr.BackOffice— back-office operations (Bearer token auth)Weavr.Simulator— Sandbox-only event simulation (deposits, card purchases, KYC/KYB)
Error handling
Every function returns {:ok, result} or {:error, Weavr.Error.t()}.
Use unwrap!/1 to raise on error when you prefer exceptions:
account = Weavr.Accounts.get(config, id, auth_token: token) |> Weavr.unwrap!()Zero runtime dependencies
weavr ships with zero required runtime deps — no Jason, no Hackney, no
Mint. It uses Erlang's built-in :httpc and a small vendored JSON codec.
If your app already has Jason and/or :telemetry, weavr detects and
uses them automatically. See Weavr.JSON and Weavr.Telemetry.
Summary
Functions
Unwraps {:ok, value} returning value, or raises the error struct on
{:error, reason}.
Functions
@spec unwrap!({:ok, value} | {:error, Weavr.Error.t()}) :: value when value: var
Unwraps {:ok, value} returning value, or raises the error struct on
{:error, reason}.
Examples
iex> Weavr.unwrap!({:ok, %{"id" => "123"}})
%{"id" => "123"}
iex> Weavr.unwrap!({:error, %Weavr.Error.API{status: 404, message: "not found"}})
** (Weavr.Error.API) Weavr API error (status 404): not found