Investec Open API v0.1.0 InvestecOpenApi.Accounts View Source
Methods to obtain account details
Link to this section Summary
Functions
List all the accounts for a given user. This needs an authenticated client as an input parameter.
Link to this section Types
Specs
Link to this section Functions
Specs
call_list_accounts(InvestecOpenApi.Client.t()) :: {InvestecOpenApi.Client.t(), InvestecOpenApi.HTTP.response()}
Specs
Specs
list_accounts(InvestecOpenApi.Client.t()) :: {:error, binary() | Jason.DecodeError.t()} | {:ok, [t()], InvestecOpenApi.Client.t()}
List all the accounts for a given user. This needs an authenticated client as an input parameter.
It will return a list with %InvestecOpenApi.Accounts{} objects.
With this it also returns an authenticated %InvestecOpenApi.Client{} again,
because if the previous access_token has expired, a new one woule automatically be created again
Example
iex> {:ok, client} = InvestecOpenApi.new()
...> {:ok, accounts, _client} = InvestecOpenApi.Accounts.list_accounts(client)
...> accounts
[
%InvestecOpenApi.Accounts{account_id: "172878438321553632224",
account_name: "Mr John Doe",
account_number: "10010206147",
product_name: "Private Bank Account",
reference_name: "My Investec Private Bank Account"}
]