View Source Ibanity.Xs2a.Account (ibanity v1.1.0)
Accounts API wrapper
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.
Functions
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
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", ...}}
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
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
Fetches the financial institution this account belongs to.
Returns:
{:ok, institution}if successful,nilif no financial institution link was set on the structure{:error, reason}otherwise
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
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", ...}}
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 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
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)
View SourceList 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
iex> token
...> |> Request.customer_access_token
...> |> Account.list("b031dfe8-ebad-410b-aa77-064f8c876540", "42ebed1a-d890-41d6-b4f2-ac1ef6fd0e32")
Fetches the pending_transactions associated to this account.
Returns:
{:ok, pending_transactions}if successful, wherepending_transactionsis anIbanity.Collectionnilif no pending transactions link was set on the structure{:error, reason}otherwise
Fetches the transactions associated to this account.
Returns:
{:ok, transactions}if successful, wheretransactionsis anIbanity.Collectionnilif no transaction link was set on the structure{:error, reason}otherwise