Accounts BG API Flow

Onboarding your user

Before your first call to account information services API your user should authorize you to access user's personal data.

1Giving consent from your user to you to access his/her personal banking data

  • All consent details have to be defined in your application. Your application initiates the flow by making a /consent
  • The bank sends back to your application a consent ID.
  • Your application directs your user browser to the authorization endpoint. Initiation is carried out by making a GET /oauth2/authorizerequest with consent ID included.
  • The bank authenticates your user and establishes whether the user grants or denies your access request.
  • Assuming your user grants access, the bank server redirects the user browser back to your application using the redirection URI provided during your application registration. The redirection URI includes an authorization code.
  • Your application requests an access token from the bank server's token endpoint by including the authorization code received in the previous step. The authorization code exchange is carried out by making a POST /oauth2/token request.
  • The bank server authenticates your application, validates the authorization code, and ensures that the redirection URI received matches the URI used to redirect your application in step 3. If it is valid, the bank server responds back with an access token and a refresh token. Issued refresh token expires after 90 days, when new authorization has to be completed by client.

After token revocation

Issued token can be revoked by your user or after time period - 90 days for PSD2 AISP APIs by default. In this case the bank server responses with HTTP 401 Unauthorized to your API call. In this case you need to get the giving consent flow again.

2Get Consented Accounts List

  • Your application initiate GET /v1/accounts request with valid access token.
  • The bank server validates access token and returns consented accounts list.

3Get Account Balances

  • To provide your user with balance information about account your application initiates GET /v1/accounts/{accountId}/balances request with valid access token.
  • The bank server validates access token and returns account's detail and balances.

 4.  Get Account Transactions History

  • Your application requests account transaction history by GET /v1/accounts/(accountId)/transactions with valid access token.
  • The bank server validates access token and returns a page with account's transactions                         

Refresh Expired Access Token

When an access token obtained through an authorization code grant expires, your application should attempt to get a new access and refresh token by calling POST /oauth2/token. For more information see Section 6 Refreshing an Access Token in of the OAuth 2.0 specification.

OAuth 2.0 specification 
If your application fails to get an access token using a refresh token, your application would have to get your client to initiate a fresh authorization code grant using an existing consent