TruelayerClient.Merchant (truelayer_client v1.0.0)

Copy Markdown View Source

TrueLayer Merchant Accounts API.

Provides access to merchant accounts, ledger transactions, sweeping configuration, and payment sources.

Summary

Functions

Disable sweeping (DELETE /v3/merchant-accounts/{id}/sweeping).

Get a merchant account by ID (GET /v3/merchant-accounts/{id}).

Get payment sources for a merchant account.

Get sweeping configuration (GET /v3/merchant-accounts/{id}/sweeping).

Get paginated ledger transactions for a merchant account (GET /v3/merchant-accounts/{id}/transactions).

List all merchant accounts (GET /v3/merchant-accounts).

Configure sweeping for a merchant account (POST /v3/merchant-accounts/{id}/sweeping).

Functions

disable_sweeping(client, account_id)

@spec disable_sweeping(TruelayerClient.t(), String.t()) ::
  :ok | {:error, TruelayerClient.Error.t()}

Disable sweeping (DELETE /v3/merchant-accounts/{id}/sweeping).

get_account(client, account_id)

@spec get_account(TruelayerClient.t(), String.t()) ::
  {:ok, map()} | {:error, TruelayerClient.Error.t()}

Get a merchant account by ID (GET /v3/merchant-accounts/{id}).

get_payment_sources(client, account_id)

@spec get_payment_sources(TruelayerClient.t(), String.t()) ::
  {:ok, [map()]} | {:error, TruelayerClient.Error.t()}

Get payment sources for a merchant account.

get_sweeping(client, account_id)

@spec get_sweeping(TruelayerClient.t(), String.t()) ::
  {:ok, map()} | {:error, TruelayerClient.Error.t()}

Get sweeping configuration (GET /v3/merchant-accounts/{id}/sweeping).

get_transactions(client, account_id, opts \\ [])

@spec get_transactions(TruelayerClient.t(), String.t(), keyword()) ::
  {:ok, map()} | {:error, TruelayerClient.Error.t()}

Get paginated ledger transactions for a merchant account (GET /v3/merchant-accounts/{id}/transactions).

Options

  • :from - ISO 8601 start datetime string
  • :to - ISO 8601 end datetime string
  • :type - filter by transaction type (e.g. "payout", "refund")
  • :cursor - pagination cursor from previous response

list_accounts(client)

@spec list_accounts(TruelayerClient.t()) ::
  {:ok, [map()]} | {:error, TruelayerClient.Error.t()}

List all merchant accounts (GET /v3/merchant-accounts).

setup_sweeping(client, account_id, params)

@spec setup_sweeping(TruelayerClient.t(), String.t(), map()) ::
  {:ok, map()} | {:error, TruelayerClient.Error.t()}

Configure sweeping for a merchant account (POST /v3/merchant-accounts/{id}/sweeping).