Humaans.BankAccounts behaviour (Humaans v0.4.0)
View SourceThis module provides functions for managing bank account resources in the Humaans API.
Summary
Functions
Creates a new bank account resource.
Deletes a specific bank account by ID.
Lists all bank account resources.
Retrieves a specific bank account by ID.
Updates a specific bank account by ID.
Types
Callbacks
Functions
Creates a new bank account resource.
Parameters
client
- Client map created withHumaans.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)
@spec delete(client :: map(), id :: String.t()) :: delete_response()
Deletes a specific bank account by ID.
Parameters
client
- Client map created withHumaans.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}
@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 withHumaans.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})
Retrieves a specific bank account by ID.
Parameters
client
- Client map created withHumaans.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")
Updates a specific bank account by ID.
Parameters
client
- Client map created withHumaans.new/1
id
- String ID of the bank account to updateparams
- 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)