# `Humaans.BankAccounts`
[🔗](https://github.com/sgerrand/ex_humaans/blob/v0.4.2/lib/humaans/bank_accounts.ex#L1)

This module provides functions for managing bank account resources in the
Humaans API.

# `delete_response`

```elixir
@type delete_response() :: {:ok, %{id: String.t(), deleted: bool()}} | {:error, any()}
```

# `list_response`

```elixir
@type list_response() ::
  {:ok,
   [
     %Humaans.Resources.BankAccount{
       account_number: term(),
       bank_name: term(),
       created_at: term(),
       id: term(),
       name_on_account: term(),
       person_id: term(),
       routing_number: term(),
       sort_code: term(),
       swift_code: term(),
       updated_at: term()
     }
   ]}
  | {:error, any()}
```

# `response`

```elixir
@type response() ::
  {:ok,
   %Humaans.Resources.BankAccount{
     account_number: term(),
     bank_name: term(),
     created_at: term(),
     id: term(),
     name_on_account: term(),
     person_id: term(),
     routing_number: term(),
     sort_code: term(),
     swift_code: term(),
     updated_at: term()
   }}
  | {:error, any()}
```

# `create`

```elixir
@callback create(client :: map(), map()) :: {:ok, map()} | {:error, any()}
```

# `delete`

```elixir
@callback delete(client :: map(), String.t()) :: {:ok, map()} | {:error, any()}
```

# `list`

```elixir
@callback list(client :: map(), map()) :: {:ok, map()} | {:error, any()}
```

# `retrieve`

```elixir
@callback retrieve(client :: map(), String.t()) :: {:ok, map()} | {:error, any()}
```

# `update`

```elixir
@callback update(client :: map(), String.t(), map()) :: {:ok, map()} | {:error, any()}
```

# `create`

```elixir
@spec create(client :: map(), params :: keyword()) :: response()
```

Creates a new bank account resource.

## Parameters

  * `client` - Client map created with `Humaans.new/1`
  * `params` - Map of parameters for the new bank account

## Examples

    client = Humaans.new(access_token: "your_access_token")

    params = %{
      personId: "person_id",
      accountType: "personal",
      accountHolder: "Jane Doe",
      accountNumber: "12345678",
      sortCode: "01-02-03"
    }

    {:ok, account} = Humaans.BankAccounts.create(client, params)

# `delete`

```elixir
@spec delete(client :: map(), id :: String.t()) :: delete_response()
```

Deletes a specific bank account by ID.

## Parameters

  * `client` - Client map created with `Humaans.new/1`
  * `id` - String ID of the bank account to delete

## Examples

    client = Humaans.new(access_token: "your_access_token")

    {:ok, result} = Humaans.BankAccounts.delete(client, "account_id")
    # result contains %{id: "account_id", deleted: true}

# `list`

```elixir
@spec list(client :: map(), params :: keyword()) :: list_response()
```

Lists all bank account resources.

Returns a list of bank account resources that match the optional filters provided in `params`.

## Parameters

  * `client` - Client map created with `Humaans.new/1`
  * `params` - Optional parameters for filtering the results (default: `%{}`)

## Examples

    client = Humaans.new(access_token: "your_access_token")

    # List all bank accounts
    {:ok, accounts} = Humaans.BankAccounts.list(client)

    # List with filtering parameters
    {:ok, accounts} = Humaans.BankAccounts.list(client, %{limit: 10})

# `retrieve`

```elixir
@spec retrieve(client :: map(), id :: String.t()) :: response()
```

Retrieves a specific bank account by ID.

## Parameters

  * `client` - Client map created with `Humaans.new/1`
  * `id` - String ID of the bank account to retrieve

## Examples

    client = Humaans.new(access_token: "your_access_token")

    {:ok, account} = Humaans.BankAccounts.retrieve(client, "account_id")

# `update`

```elixir
@spec update(client :: map(), id :: String.t(), params :: keyword()) :: response()
```

Updates a specific bank account by ID.

## Parameters

  * `client` - Client map created with `Humaans.new/1`
  * `id` - String ID of the bank account to update
  * `params` - Map of parameters to update

## Examples

    client = Humaans.new(access_token: "your_access_token")

    params = %{accountHolder: "Janet Doe"}

    {:ok, updated_account} = Humaans.BankAccounts.update(client, "account_id", params)

---

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