# `TruelayerClient.Merchant`
[🔗](https://github.com/iamkanishka/truelayer_client/blob/v1.0.0/lib/truelayer_client/merchant.ex#L1)

TrueLayer Merchant Accounts API.

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

# `disable_sweeping`

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

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

# `get_account`

```elixir
@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`

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

Get payment sources for a merchant account.

# `get_sweeping`

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

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

# `get_transactions`

```elixir
@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`

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

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

# `setup_sweeping`

```elixir
@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).

---

*Consult [api-reference.md](api-reference.md) for complete listing*
