ibanity v0.6.0 Ibanity.Xs2a.Account

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 transactions associated to this account.

Link to this section Functions

Link to this function

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

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", ...}}
Link to this function

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

Link to this function

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

Link to this function

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

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", ...}}
Link to this function

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 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: [...]}}
Link to this function

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

iex> token
...> |> Request.customer_access_token
...> |> Account.list("b031dfe8-ebad-410b-aa77-064f8c876540", "42ebed1a-d890-41d6-b4f2-ac1ef6fd0e32")
Link to this function

transactions(account)

Fetches the transactions associated to this account.

Returns:

  • {:ok, transactions} if successful, where transactions is an Ibanity.Collection
  • nil if no transaction link was set on the structure
  • {:error, reason} otherwise