Ibanity.Xs2a.Account (ibanity v0.12.0)
Accounts API wrapper
Link to this section Summary
Functions
Deletes an account
based on the financial_institution_id
and id
(e.g. the account id) stored in the Ibanity.Request
.
Convenience function to delete an account based on the account_id
financial_institution_id
given as arguments.
Convenience function to delete an account based on the account_id
financial_institution_id
given as arguments.
Fetches the financial institution this account belongs to.
Retrieves an account
based on the financial_institution_id
and id
(e.g. the account id) stored in the Ibanity.Request
.
Convenience function to retrieve an account based on the account_id
financial_institution_id
given as arguments.
List all accounts
according to the financial_institution_id
from the Ibanity.Request
.
List accounts for a specific financial institution and account information access request.
Fetches the pending_transactions associated to this account.
Fetches the transactions associated to this account.
Link to this section Functions
delete(request)
Deletes an account
based on the financial_institution_id
and id
(e.g. the account id) stored in the Ibanity.Request
.
Returns {:ok, account}
if found, otherwise {:error, reason}
example
Example
iex> token
...> |> Request.customer_access_token
...> |> Request.id(:financial_institution_id, "e1865795-dfa6-4c61-8f1f-1806957ddbdc")
...> |> Request.id(:id, "060d959f-e784-4a5b-a5ca-30c857ca0371")
...> |> Account.delete
{:ok, %Ibanity.Account{id: "060d959f-e784-4a5b-a5ca-30c857ca0371", ...}}
delete(account_id, financial_institution_id)
Convenience function to delete an account based on the account_id
financial_institution_id
given as arguments.
Returns {:ok, account}
if found, otherwise {:error, reason}
See delete/1
delete(request, account_id, financial_institution_id)
Convenience function to delete an account based on the account_id
financial_institution_id
given as arguments.
Returns {:ok, account}
if found, otherwise {:error, reason}
See delete/1
financial_institution(account)
Fetches the financial institution this account belongs to.
Returns:
{:ok, institution}
if successful,nil
if no financial institution link was set on the structure{:error, reason}
otherwise
find(request)
Retrieves an account
based on the financial_institution_id
and id
(e.g. the account id) stored in the Ibanity.Request
.
Returns {:ok, account}
if found, otherwise {:error, reason}
example
Example
iex> token
...> |> Request.customer_access_token
...> |> Request.id(:financial_institution_id, "e1865795-dfa6-4c61-8f1f-1806957ddbdc")
...> |> Request.id(:id, "060d959f-e784-4a5b-a5ca-30c857ca0371")
...> |> Account.find
{:ok, %Ibanity.Account{id: "060d959f-e784-4a5b-a5ca-30c857ca0371", ...}}
find(request, account_id, financial_institution_id)
Convenience function to retrieve an account based on the account_id
financial_institution_id
given as arguments.
Returns {:ok, account}
if found, otherwise {:error, reason}
See find/1
list(request)
List all accounts
according to the financial_institution_id
from the Ibanity.Request
.
If financial_institution_id
is nil
or is not set, it will list all the accounts.
If set it will list accounts for that specific financial institution.
examples
Examples
iex> token
...> |> Request.customer_access_token
...> |> Account.list
{:ok, %Ibanity.Collection{items: [...]}}
iex> token
...> |> Request.customer_access_token
...> |> Request.id(:financial_institution_id, "0a089c79-bfef-45e7-b647-a4654e4bff9f")
...> |> Account.list
{:ok, %Ibanity.Collection{items: [...]}}
list(request, financial_institution_id, account_information_access_request_id)
List accounts for a specific financial institution and account information access request.
Returns {:ok, coll}
with coll
being an Ibanity.Collection
with Ibanity.Xs2a.Account
as items, {:error, reason}
otherwise
example
Example
iex> token
...> |> Request.customer_access_token
...> |> Account.list("b031dfe8-ebad-410b-aa77-064f8c876540", "42ebed1a-d890-41d6-b4f2-ac1ef6fd0e32")
pending_transactions(account)
Fetches the pending_transactions associated to this account.
Returns:
{:ok, pending_transactions}
if successful, wherepending_transactions
is anIbanity.Collection
nil
if no pending transactions link was set on the structure{:error, reason}
otherwise
transactions(account)
Fetches the transactions associated to this account.
Returns:
{:ok, transactions}
if successful, wheretransactions
is anIbanity.Collection
nil
if no transaction link was set on the structure{:error, reason}
otherwise