Balances

1. Version Control

Version

Date

Description of Changes

Bahrain OBF v1.0.0

28th Oct 2020

Initial Release

2. Overview

The balances resource is used by an AISP to retrieve in bulk or single account balance information for a specific AccountId for that the user/customer has authorised to access.

This resource description should be read in conjunction with a compatible Account Information Services API Profile.

3.  Endpoints

S. No.

Resource

HTTP Operation

Endpoint

Mandatory

Scope

Grant Type

Idempotency Key

Parameters

Request Object

Response Object

3.1

balances

GET

GET /accounts/{AccountId}/balances

Mandatory

accounts

Authorisation Code

No

 

 

OBReadBalance

3.2

balances

GET

GET /balances

Optional

accounts

Authorisation Code

No

Pagination

 

OBReadBalance

3.1 GET /accounts/{AccountId}/balances

An AISP may retrieve the account balance information resource for a specific AccountId (which is retrieved in the call to GET /accounts).

3.2 GET /balances

If an ASPSP has implemented the bulk retrieval endpoints, an AISP may optionally retrieve the account information resources in bulk. This will retrieve the resources for all authorised accounts linked to the account-request.

4.  Data Models

4.1  OBReadBalance

The OBReadBalance object will be used for the call to:

  • GET /accounts/{AccountId}/balances

  • GET /balances

4.1.1 Resource Definition

This resource represents the net increases and decreases in an account (AccountId) at a specific point in time.

An account (AccountId) may have multiple balance types (these follow the standard ISO 20022 balance type enumerations). If an ASPSP includes a credit line in an available balance, then the balance representation will have a section for the credit line amount and type.

4.1.2 UML Diagram

 

4.1.3 Notes

  • Multiple balances may be returned (each with a different value for Type) for an account. This is for ASPSPs that show multiple balances in their online channels

  • The CreditLine section may be repeated as multiple credit lines may be included in an available balance

  • A DateTime element has been used instead of a complex choice element of Date and DateTime. Where time elements do not exist in ASPSP systems, the time portion of the DateTime element will be defaulted to 00:00:00+03:00

4.1.4 Permission Codes

The resource requires the ReadBalances permission. The resource response payload does not differ depending on the permissions granted.

4.1.5 Data Dictionary

Name

Occurrence

XPath

Enhanced Definition

Class/ Datatype

Codes

Pattern

OBReadBalance

 

OBReadBalance

 

OBReadBalance

 

 

Data

1..1

OBReadBalance/Data

 

OBReadBalance/Data

 

 

Balance

1..n

OBReadBalance/Data/Balance

Set of elements used to define the balance details

OBReadBalance/Data/Balance

 

 

AccountId

1..1

OBReadBalance/Data/Balance/AccountId

A unique and immutable identifier used to identify the account resource. This identifier has no meaning to the account owner

String

 

 

CreditDebitIndicator

1..1

OBReadBalance/Data/Balance/CreditDebitIndicator

Indicates whether the balance is a credit or a debit balance. Usage: A zero balance is considered to be a credit balance

OBCreditDebitCode

Enum:

  • Credit

  • Debit

 

Type

1..1

OBReadBalance/Data/Balance/Type

Balance type, in a coded form

OBBalanceTypeCode

Enum:

  • ClosingAvailable

  • ClosingBooked

  • ClosingCleared

  • Expected

  • ForwardAvailable

  • Information

  • InterimAvailable

  • InterimBooked

  • InterimCleared

  • OpeningAvailable

  • OpeningBooked

  • OpeningCleared

  • PreviouslyClosedBooked

 

DateTime

1..1

OBReadBalance/Data/Balance/DateTime

Indicates the date (and time) of the balance

DateTime

 

 

Amount

1..1

OBReadBalance/Data/Balance/Amount

Amount of money of the cash balance

OBReadBalance/Data/Balance/Amount

 

 

Amount

1..1

OBReadBalance/Data/Balance/Amount/Amount

A number of monetary units specified in an active currency where the unit of currency is explicit and compliant with ISO 4217

OBActiveCurrencyAndAmount

 

^\d{1,13}$|^\d{1,13}.\d{1,5}$

Currency

1..1

OBReadBalance/Data/Balance/Amount/Currency

A code allocated to a currency by a Maintenance Agency under an international identification scheme, as described in the latest edition of the international standard ISO 4217 "Codes for the representation of currencies and funds"

ActiveOrHistoricCurrencyCode

 

^[A-Z]{3,3}$

CreditLine

0..n

OBReadBalance/Data/Balance/CreditLine

Set of elements used to provide details on the credit line

OBReadBalance/Data/Balance/CreditLine

 

 

Included

1..1

OBReadBalance/Data/Balance/CreditLine/Included

Indicates whether or not the credit line is included in the balance of the account. Usage: If not present, credit line is not included in the balance amount of the account

xs:boolean

 

 

Type

0..1

OBReadBalance/Data/Balance/CreditLine/Type

Limit type, in a coded form

String

Enum:

  • Available

  • Credit

  • Emergency

  • Pre-Agreed

  • Temporary

 

Amount

0..1

OBReadBalance/Data/Balance/CreditLine/Amount

Amount of money of the credit line

OBReadBalance/Data/Balance/CreditLine/Amount

 

 

Amount

1..1

OBReadBalance/Data/Balance/CreditLine/Amount/Amount

A number of monetary units specified in an active currency where the unit of currency is explicit and compliant with ISO 4217

OBActiveCurrencyAndAmount

 

^\d{1,13}$|^\d{1,13}.\d{1,5}$

Currency

1..1

OBReadBalance/Data/Balance/CreditLine/Amount/Currency

A code allocated to a currency by a Maintenance Agency under an international identification scheme, as described in the latest edition of the international standard ISO 4217 "Codes for the representation of currencies and funds"

ActiveOrHistoricCurrencyCode

 

^[A-Z]{3,3}$

 

5.  Usage Example

5.1 Bulk

5.1.1 Get Balances Request

GET /balances

Authorisation: Bearer 4ZopnFZFKjr5zDsicSQpLL

x-fapi-auth-date: Tue, 23 Mar 2020 22:34:31 GMT+03:00

x-fapi-customer-ip-address: 204.35.213.15

x-fapi-interaction-id: 75bdc714-b2dg-7676-c759-780d6815689f

Accept: application/json

5.1.2 Get Balances Response

200 OK

x-fapi-interaction-id: 75bdc714-b2dg-7676-c759-780d6815689f

Content-Type: application/json

{

  "Data": {

    "Balance": [

      {

        "AccountId": "00345897",

        "CreditDebitIndicator": "Credit",

        "Type": "ClosingAvailable",

        "DateTime": "2020-03-23T10:22:35.293+03:00”,

        "Amount": {

          "Amount": "12500",

          "Currency": "BHD"

        },

        "CreditLine": [

          {

            "Included": true,

            "Type": "Available",

            "Amount": {

              "Amount": "10000",

              "Currency": "BHD"

            }

          }

        ]

      },

      {

        "AccountId": "00145897",

        "CreditDebitIndicator": "Debit",

        "Type": "InterimAvailable",

        "DateTime": "2020-03-23T10:22:35.293+03:00”,

        "CreditLine": [

          {

            "Included": true,

            "Type": "Available",

            "Amount": {

              "Amount": "10000",

              "Currency": "BHD"

            }

          }

        ]

      }

    ]

  },

 "Links": {

    "Self": "www.TBC.com"

  },

  "Meta": {

    "TotalPages": 02,

    "FirstAvailableDateTime": "2020-03-12T09:10:17.596+03:00”,

    "LastAvailableDateTime": "2020-03-12T09:10:17.596+03:00”

  }

}

5.2 Specific Account

5.2.1 Get Account Balances Request

GET /accounts/00345897/balances

Authorisation: Bearer 4ZopnFZFKjr5zDsicSQpLL

x-fapi-auth-date: Tue, 23 Mar 2020 19:34:31 GMT+03:00

x-fapi-customer-ip-address: 204.35.213.15

x-fapi-interaction-id: 75bdc714-b2dg-7676-c759-780d6815689f

Accept: application/json

5.2.2 Get Account Balances Response

200 OK

x-fapi-interaction-id: 75bdc714-b2dg-7676-c759-780d6815689f

Content-Type: application/json

{

  "Data": {

    "Balance": [

      {

        "AccountId": "00345897",

        "CreditDebitIndicator": "Credit",

        "Type": "ClosingAvailable",

        "DateTime": "2020-03-23T10:22:35.293+03:00”,

        "Amount": {

          "Amount": "12500",

          "Currency": "BHD"

        },

        "CreditLine": [

          {

            "Included": true,

            "Type": "Available",

            "Amount": {

              "Amount": "10000",

              "Currency": "BHD"

            }

          }

        ]

      }

    ]

  },

 "Links": {

    "Self": "www.TBC.com"

  },

  "Meta": {

    "TotalPages": 02,

    "FirstAvailableDateTime": "2020-03-12T09:10:17.596+03:00”,

    "LastAvailableDateTime": "2020-03-12T09:10:17.596+03:00”

  }

}



 

CENTRAL BANK OF BAHRAIN © 2020