ibanity v0.6.0 Ibanity.Xs2a.AccountInformationAccessRequest

Account information access requests API wrapper

Link to this section Summary

Link to this section Functions

Link to this function

create(request)

Creates an account information access request

In order for the request to be successful you must have created a Ibanity.Xs2a.CustomerAccessToken beforehand.

Example

This is the transcription of the example found in the API documentation

iex> "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9..."
...> |> Request.customer_access_token
...> |> Request.id(:financial_institution_id, "b031dfe8-ebad-410b-aa77-064f8c876540")
...> |> Request.attribute("redirect_uri", "https://fake-tpp.com/access-granted")
...> |> Request.attribute("consent_reference", "42ebed1a-d890-41d6-b4f2-ac1ef6fd0e32")
...> |> Request.attribute("requested_account_references", ["BE6338957016536095"])
...> |> AccountInformationAccessRequest.create
{:ok,
  %Ibanity.AccountInformationAccessRequest{
    id: "fff0f73b-cc51-4a18-8f11-1a8434e66b49",
    redirect_link: "https://callback.ibanity.localhost/sandbox/fi/aiar/i?state=dmF1bHQ6d...UcA==",
    requested_account_references: []
  }
}

Note: it doesn't support the meta argument yet, it will be supported in a future release.

Retrieves an account information access request

Example

This is the transcription of the example found in the API documentation

iex> "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9..."
...> |> Request.customer_access_token
...> |> Request.ids(financial_institution_id: "b031dfe8-ebad-410b-aa77-064f8c876540", id: "42ebed1a-d890-41d6-b4f2-ac1ef6fd0e32")
...> |> AccountInformationAccessRequest.find
{:ok,
  %Ibanity.AccountInformationAccessRequest{
    id: "fff0f73b-cc51-4a18-8f11-1a8434e66b49",
    requested_account_references: []
  }
}