Account Information Services

Account Information Services

 

1. Version Control

Version

Date

Description of Changes

Bahrain OBF v1.0.0

28th Oct 2020

Initial Release

2. Overview

The Account and Transaction API Profile describes the flows and common functionalities for the Accounts and Transaction API, which allows an Account Information Service Provider ('AISP') to:

  • Register an intent to retrieve account information by creating an "account access consent". This registers the data "permissions" and historical period allowed for transactions/statements - that the user/customer has consented to provide to the AISP

  • Subsequently, retrieve account and transaction data

  • Retrieve product specific information from ASPSP

2.1 Chapter Overview

This chapter (Account Information Services) consists of the following parts:

Overview: Provides an overview of the profile

Basics: Identifies the flows, release management and permission model

Security & Access Control: Specifies the means for AISPs to authenticate themselves and provide consent

Data Model: Mappings and enumerations that apply to all the end-points

Alternative Flows: Rules for alternative flows

2.2 Resources

Each of the Account and Transaction API resources are documented in the Resources and Data Models / AISP area of the specification. Each resource is documented with:

  • Endpoints

    • The API endpoints available for the resource

  • Data Model

    • Resource definition

    • UML diagram

    • Permissions as they relate to accessing the resource

    • Data dictionary - which defines fields, re-usable classes, mandatory (1..1) or conditional (0..1)

  • Usage Examples

3. Basics

3.1 Overview

The figure below provides a general outline of an account information request and flow using the Account Info APIs.

 

3.1.1 Steps

Step 1: Request Account Information

  • This flow begins with a user/customer consenting to allow an AISP to access account information data

Step 2: Setup Account-Access-Consents

  • The AISP connects to the ASPSP that services the user’s/customer’s account(s) and creates an account-access-consents resource. This informs the ASPSP that one of its users/customers is granting access to account and transaction information to an AISP. The ASPSP responds with an identifier for the resource (the ConsentId - which is the intent identifier). This step is carried out by making a POST request to / account-access-consents endpoint

  • The account-access-consent sresource will include these fields below - which describe the data that the user/customer has consented with the AISP:

    • Permissions - a list of data clusters that have been consented for access

    • Transaction Validity Period - the From/To date range which specifies a historical period for transactions and statements which may be accessed by the AISP

Step 3: Authorise Consent

  • The AISP requests the user/customer to authorise the consent. The ASPSP may carry this out by using a redirection flow or a decoupled flow

    • In a redirection flow, the AISP redirects the user/customer to the ASPSP

      • The redirect includes the ConsentId generated in the previous step

      • This allows the ASPSP to correlate the account-access-consents that was setup

      • The ASPSP authenticates the user/customer

      • The ASPSP updates the state of the account-access-consents resource internally to indicate that the account-access-consents has been authorised

      • Once the consent has been authorised, the user/customer is redirected back to the AISP

    • In a decoupled flow, the ASPSP requests the user/customer to authorise consent on an authentication device that is separate from the consumption device on which the user/customer is interacting with the AISP

      • The decoupled flow is initiated by the AISP calling a back-channel authorisation request

      • The request contains a 'hint' that identifies the user/customer, paired with the consent to be authorised

      • The ASPSP authenticates the user/customer and updates the state of the account-access-consents resource internally to indicate that the account-access-consents has been authorised

      • Once the consent has been authorised, the ASPSP can make a callback to the AISP to provide an access token

  • The consent is managed between the user/customer and the AISP - so the account-access-consents details must not be changed (with the ASPSP) in this step. The user/customer will only be able to authorise or reject the account-access-consents details in its entirety

  • During authorisation, the user/customer selects accounts that are authorised for the AISP request (in the ASPSP’s banking interface)

Step 4: Request Data

  • This is carried out by making a GET request the relevant resource

  • The unique AccountId(s) that are valid for the account-access-consents will be returned with a call to GET /accounts. This will always be the first call once an AISP has a valid access token

3.1.2 Sequence Diagram

 

*CIBA - Client Initiated Backchannel Authentication

3.2 Idempotency

The API endpoints for creating account-access-consents resources are not idempotent.

If a time-out error occurs - then an AISP can create a new account-access-consents resource - rather than try with the same resource.

3.3 Release Management

This section overviews the release management and versioning strategy for the Account and Transaction API.

3.3.1 Account Access Consent

3.3.1.1 POST

  • An AISP must not create a Consent on a newer version, and use it on a previous version

    • E.g., A ConsentId for an account-access-consents created in v3, must not be used to access v2 endpoints

3.3.1.2  GET

  • An AISP must not access a Consent on an older version, via the Id for a Consent created in a newer version:

    • E.g., An account-access-consents created in v3 accessed via v2 account-request

  • An ASPSP must allow a Consent to be accessed in a newer version

  • An ASPSP must ensure Permissions set associated with a Consent are unchanged when accessed in a different version:

    • E.g., An account-request created in v2 will have the same details when accessed via v2 and v3 (as an account-access-consents)

  • An ASPSP must ensure a Consent's fields are unchanged when accessed in a different version

  • An ASPSP may allow expired Consents to be accessed in a newer version

  • An ASPSP may choose to populate new fields introduced in a resource from previous version sensible defaults (if mandatory) or not populate at all (if not mandatory):

    • E.g., OBAccountAccessConsentResponse /Data/StatusUpdateDateTime introduced in v2 accessed with v1 AccountRequestId can be populated with Last accessed date time, if not already available in the system of records

3.3.1.3 PATCH

  • An AISP must not patch a Consent on an older version, via an Id for a Consent created in a newer version:

    • E.g., An account-access-consents is created in v3, and request PATCH on v2

  • An ASPSP must support patching a Consent from a previous version via a newer version:

    • E.g., An account-request is created in v2, and request PATCH on v3

3.3.2 Account Information Resources

3.3.2.1  GET

  • An AISP may use a token that is bound to a Consent in a previous version, to access an endpoint of a newer version

  • An AISP may use an Id for a Consent created in a previous version to retrieve Account Information resources in a newer version:

    • E.g., AccountRequestId from v2 can be used as ConsentId in v3, to GET /accounts

  • An AISP must not use an Id for a Consent from a newer version to access Account Information resources in a previous version:

    • E.g., ConsentId for an account-access-consents created in v3, must not be used to access v2 Account Information endpoints

  • An ASPSP must allow an AISP to use an Id for a Consent from a previous version to access Account Information resource endpoints in a newer version:

    • E.g., AccountRequestId created in v2 must be allowed to access Account Information resource endpoints in v3

  • An ASPSP must reject the request to access a resource, for which a Consent's Permissions set does not permit

  • An ASPSP may choose to populate new fields introduced in a resource from previous version sensible defaults (if mandatory) or not populate at all:

    • E.g., OBAccountAccessConsentResponse /Data/StatusUpdateDateTime introduced in Version2 accessed with V1 AccountRequestId can be populated with Last accessed date time, if not already available in the system of records

4. Security & Access Control

4.1 Scopes

The access tokens required for accessing the Account Info APIs must have the following scope:

accounts: Ability to read Accounts information

4.2 Grants Types

AISPs must use a client credentials grant to obtain a token to access the account-access-consents resource. In the specification, this grant type is referred to as "Client Credentials".

AISPs must use an authorisation code grant using a redirect or decoupled flow to obtain a token to access all other resources. In the specification, this grant type is referred to as "Authorisation Code").

4.3  Consent Authorisation

The AISP must create an account-access-consents resource through a POST operation. This resource indicates the consent that the AISP claims it has been given by the user/customer to retrieve account and transaction information. At this stage, the consent is not yet authorised as the ASPSP has not yet verified this claim with the user/customer.

The ASPSP responds with a ConsentId. This is the intent-id that is used when initiating the authorisation code grant.

As part of the consent authorisation flow:

  • The ASPSP authenticates the user/customer

  • The ASPSP plays back the consent (registered by the AISP) back to the user/customer - to get consent authorisation. The user/customer may accept or reject the consent in its entirety (but not selectively)

  • The ASPSP presents the user/customer with a list of accounts to which the consent will apply

Once these steps are complete, the consent is considered to have been authorised by the user/customer.

4.3.1 Consent Elements

The Account-access-consents resource consists of the following fields, which together form the elements of the consent provided by the user/customer to the AISP:

  • Permissions: The set of data clusters that the user/customer has consented to allow the AISP to access

  • TransactionFromDateTime: The earliest point of the transaction/statement historical period that the user/customer has consented to provide access to the AISP

  • TransactionToDateTime: The last point of the transaction/statement historical period that the user/customer has consented to provide access to the AISP

4.3.1.1  Permissions

Permissions codes will be used to limit the data that is returned in response to a resource request.

When permission is granted for a "Detail" permission code (e.g., ReadAccountsDetail) it implies that access is also granted to the corresponding "Basic" permission code (e.g., ReadAccountsBasic).

While it is duplication for an AISP to request a "Basic" permission code and the corresponding "Detail" permission code, it is not a malformed request, and the ASPSP must not reject solely on the basis of duplication.

The permissions array must contain at least ReadAccountsBasic or ReadAccountsDetail.

The following combinations of permissions are not allowed, and the ASPSP must reject these account-access-consents with a 400 response code:

  • Account Access Consents with an empty permissions array

  • Account Access Consents with a permission code that is not supported by the ASPSP (APSPSs are expected to publish which API endpoints are supported)

  • Account Access Consents with a Permissions array that contains ReadTransactionsBasic but does not contain at least one of ReadTransactionsCredits and ReadTransactionsDebits

  • Account Access Consents with a Permissions array that contains ReadTransactionsDetail but does not contain at least one of ReadTransactionsCredits and ReadTransactionsDebits

  • Account Access Consents with a Permissions array that contains ReadTransactionsCredits but does not contain at least one of ReadTransactionsBasic and ReadTransactionsDetail

  • Account Access Consents with a Permissions array that contains ReadTransactionsDebits but does not contain at least one of ReadTransactionsBasic and ReadTransactionsDetail

 

Permissions

Endpoints

Business Logic

Data Cluster Description

ReadAccountsBasic

/accounts
/accounts/{AccountId}

 

Ability to read basic account information

ReadAccountsDetail

/accounts
/accounts/{AccountId}

Access to additional elements in the payload

Ability to read account identification details

ReadBalances

/balances
/accounts/{AccountId}/balances

 

Ability to read all balance information

ReadBeneficiariesBasic

/beneficiaries
/accounts/{AccountId}/beneficiaries

 

Ability to read basic beneficiary details

ReadBeneficiariesDetail

/beneficiaries
/accounts/{AccountId}/beneficiaries

Access to additional elements in the payload

Ability to read account identification details for the beneficiary

ReadDirectDebits

/direct-debits
/accounts/{AccountId}/direct-debits

 

Ability to read all direct debit information

ReadTransactionsBasic

/transactions
/accounts/{AccountId}/transactions
/accounts/{AccountId}/statements/{StatementId}/transactions

Permissions must also include at least one of:

  • ReadTransactionsCredits

  • ReadTransactionsDebits

Ability to read basic transaction information

ReadTransactionsDetail

/transactions
/accounts/{AccountId}/transactions
/accounts/{AccountId}/statements/{StatementId}/transactions

Access to additional elements in the payload

Permissions must also include at least one of:

  • ReadTransactionsCredits

  • ReadTransactionsDebits

Ability to read transaction data elements which may hold silent party details

ReadTransactionsCredits

/transactions
/accounts/{AccountId}/transactions
/accounts/{AccountId}/statements/{StatementId}/transactions

Access to credit transactions.

Permissions must also include one of:

  • ReadTransactionsBasic

  • ReadTransactionsDetail

Ability to read only credit transactions

ReadTransactionsDebits

/transactions
/accounts/{AccountId}/transactions
/accounts/{AccountId}/statements/{StatementId}/transactions

Access to debit transactions.

Permissions must also include one of:

  • ReadTransactionsBasic

  • ReadTransactionsDetail

Ability to read only debit transactions

ReadStatementsBasic

/statements
/accounts/{AccountId}/statements

 

Ability to read basic statement details

ReadStatementsDetail

/statements
/accounts/{AccountId}/statements
/accounts/{AccountId}/statements/{StatementId}/file

Access to additional elements in the payload

Access to download the statement file (if the ASPSP makes this available).

Ability to read statement data elements which may leak other information about the account

ReadSupplementaryAccountInfo

/supplementary-account-info
/accounts/{AccountId}/supplementary-account-info

 

Ability to read all product information relating to the account

ReadOffers

/offers
/accounts/{AccountId}/offers

 

Ability to read all offer information

ReadParty

/accounts/{AccountId}/party
/accounts/{AccountId}/parties

 

Ability to read party information on the account owner

ReadPartyCustomer

/party

 

Ability to read party information on the user/customer logged in

ReadFutureDatedPaymentsBasic

/future-dated-payments
/accounts/{AccountId}/future-dated-payments

 

Ability to read basic statement details

ReadFutureDatedPaymentsDetail

/future-dated-payments
/accounts/{AccountId}/future-dated-payments

Access to additional elements in the payload

 

ReadPAN

All API endpoints where PAN is available as a structured field

Request to access to PAN in the clear

Request to access PAN in the clear across the available endpoints.

If this permission code is not in the account-access-consents, the AISP will receive a masked PAN.

While an AISP may request to access PAN in the clear, an ASPSP may still respond with a masked PAN if:

  • The ASPSP does not display PAN in the clear in existing online channels

  • The ASPSP takes a legal view to respond with only the masked PAN

  • ASPSP should return last 4 digits unmasked, or

  • ASPSP should return at max first 6 and last 4 digits unmasked. e.g. 5555 **** **** 4444, **** **** **** 4444 etc.

4.3.1.1.a  Detail Permissions

The additional elements that are granted for "Detail" permissions are listed in this section.

All other fields (other than these fields listed) are available with the "Basic" Permission access.

Permission - Detail Codes

Data Element Name

Occurrence

XPath

ReadAccountsDetail

Account

0..1

OBReadAccount/Data/Account/Account

ReadAccountsDetail

Servicer

0..1

OBReadAccount/Data/Account/Servicer

ReadBeneficiariesDetail

CreditorAgent

0..1

OBReadBeneficiary/Data/Beneficiary/CreditorAgent

ReadBeneficiariesDetail

CreditorAccount

0..1

OBReadBeneficiary/Data/Beneficiary/CreditorAccount

ReadStandingOrdersDetail

CreditorAgent

0..1

OBReadStandingOrder/Data/StandingOrder/CreditorAgent

ReadStandingOrdersDetail

CreditorAccount

0..1

OBReadStandingOrder/Data/StandingOrder/CreditorAccount

ReadTransactionsDetail

TransactionInformation

0..1

OBReadTransaction/Data/Transaction/TransactionInformation

ReadTransactionsDetail

Balance

0..1

OBReadTransaction/Data/Transaction/Balance

ReadTransactionsDetail

MerchantDetails

0..1

OBReadTransaction/Data/Transaction/MerchantDetails

ReadTransactionsDetail

CreditorAgent

0..1

OBReadTransaction/Data/Transaction/CreditorAgent

ReadTransactionsDetail

CreditorAccount

0..1

OBReadTransaction/Data/Transaction/CreditorAccount

ReadTransactionsDetail

DebtorAgent

0..1

OBReadTransaction/Data/Transaction/DebtorAgent

ReadTransactionsDetail

DebtorAccount

0..1

OBReadTransaction/Data/Transaction/DebtorAccount

ReadStatementsDetail

StatementAmount

0..n

OBReadStatement/Data/Statement/StatementAmount

ReadFutureDatedPaymentsDetail

CreditorAgent

0..1

OBReadFutureDatedPayment/Data/FutureDatedPayment/CreditorAgent