4. Data Models (Draft Version 1.0)

4. Data Models (Draft Version 1.0)

4. Data Models (Draft Version 1.0) | 4.1 Enumerations

4. Data Models (Draft Version 1.0) | 4.2 Common Payload Structure

https://kuwaitobframework.atlassian.net/wiki/spaces/KOBF/pages/5603467/4.+Data+Models+Draft+Version+1.0#4.3-Data

4. Data Models (Draft Version 1.0) | 4.4 Response Structure

4. Data Models (Draft Version 1.0) | 4.5 Error Response Structure

https://kuwaitobframework.atlassian.net/wiki/spaces/KOBF/pages/5603467/4.+Data+Models+Draft+Version+1.0#4.6-Links

4. Data Models (Draft Version 1.0) | 4.7 Meta

https://kuwaitobframework.atlassian.net/wiki/spaces/KOBF/pages/5603467/4.+Data+Models+Draft+Version+1.0#4.8-FirstAvailableDateTime-and-LastAvailableDateTime

https://kuwaitobframework.atlassian.net/wiki/spaces/KOBF/pages/5603467/4.+Data+Models+Draft+Version+1.0#4.9-Data-Standards

4.1 Enumerations

API Specifications include various fields of Enumerated data types, where either the values are fixed to a defined set of alternatives (i.e., Static Enumerations), or flexible with an initial defined set of alternatives, and ASPSPs can use/extend these alternatives (i.e., Namespaced Enumerations). While Static Enumerations are listed on each API Specification page, Namespaced Enumerations are captured on the Namespaced Enumerations page.

4.2 Common Payload Structure

The payload structure defines the contents of a data-packet, including the field-naming convention, the field path relative to the data root, and the field definition. The Bank and the OBSP could consider using the JSON object format for the request and response payload. The Bank and the OBSP could consider maintaining a consistent data format when defining the payload structure of the Open Banking APIs.

  • Request Payload: The Bank and the OBSP could consider using the JSON object format for the request payload through the POST, PATCH and PUT methods of the HTTP request. The JSON object could contain the primary input parameters required for each endpoint and meta information (e.g., pagination, authorization data, etc.)

  • Response Payload: The Bank and the OBSP could consider using the JSON object format for the response payload through the GET, POST and PUT methods of the HTTP response. The JSON object could contain the response data object of specific endpoints (e.g., account balance), links object (e.g., self-URI) and meta information (e.g., additional information specific to data error)

  • Error Response Payload: The error response payload is used to classify errors encountered in RESTful API services with error messages from the Open Banking API response. The Bank and the OBSP could consider using the JSON object format for the error response payload through the GET, POST, PATCH and PUT methods of the HTTP response. The JSON object could contain the response data object of specific endpoints (e.g., errorCode, errorMessage, URL)

This section gives an overview of the top-level structure for the API payloads for the Open Banking Read/Write APIs. The data contained within the Data section is documented with each individual API endpoint.

{ "Data": { ... },

4.3 Data

The Data section contains the request data for the specific API request. The structure of this element differs for each API endpoint.

4.4 Response Structure

The top-level response structure for Open Banking Read/Write APIs:

{ "Data": { }, "Links": { ... }, "Meta": { ... } }

In line with the principle of RESTful APIs, the full resource must be replayed as part of the response.

Two additional top-level sections are included in the response for:

  • Links

  • Meta

4.5 Error Response Structure

The error response structure for Open Banking Read/Write APIs:

{ "Code": "…", "Id": "…", "Message": "…", "Errors": [ { "ErrorCode": "...", "Message": "...", "Path": "...", "Url": "..." } ] }

4.6 Links

The Links section is optional and will always contain absolute URIs to related resources,

The "Self" member is mandatory.

For example:

"Links": { "Self": "https://api.abcbank.com/open-banking/v3.1/pisp/domestic-payments/7859342" }

Where an API provides a paginated response, the Links element may also contain the members First, Prev, Next and Last as described in the section Basics / Pagination.

For example:

"Links": { "Self": "http://example.com/articles?page[number]=5&page[size]=1", "First": "http://example.com/articles?page[number]=1&page[size]=1", "Prev": "http://example.com/articles?page[number]=4&page[size]=1", "Next": "http://example.com/articles?page[number]=6&page[size]=1", "Last": "http://example.com/articles?page[number]=10&page[size]=1" }

4.7 Meta

The Meta section is optional and may be empty.  An optional member is "TotalPages" which is specified as an integer (int32) and shows how many pages of results (for pagination) are available.

For example:

"Meta": { "TotalPages": 10 }

4.8 FirstAvailableDateTime and LastAvailableDateTime

The FirstAvailableDateTime represents the earliest point in time for which data is accessible through the Open Banking API. It is the starting timestamp from which historical account data or transaction information can be retrieved. Any data or transactions that have occurred before this date cannot be retrieved through the API.

The LastAvailableDateTime represents the most recent or latest point in time for which data is accessible through the Open Banking API. It is the ending timestamp that outlines the range of data available for retrieval. Any data or transactions that occurred after this date would not be accessible through the API.

4.9 Data Standards

The data standards element sets out the API specifications to enable the customer data access process using the Kuwait Open Banking Technical API specifications to retrieve account details (accounts, balances, beneficiaries, direct debits, scheduled payments, standing orders, and transactions), process payments, notifications and generate leads. An example of Accounts API with all the elements encompassing data standards have been detailed below for ease of reference:

Accounts: API Specifications - This resource description should be read in conjunction with a compatible Account and Transaction API Profile defined as part of the Account Information Use Cases Technical API Specifications document.

Overview: The accounts resource is used by an AISP to retrieve full list of accounts and account information that the user/customer has authorized to access.

Endpoints: Endpoints for the resource - and available methods.

S. No.

Resource

HTTP Operation

Endpoint

Scope

Grant Type

Idempotency Key

Parameters

Request Object

Response Object

S. No.

Resource

HTTP Operation

Endpoint

Scope

Grant Type

Idempotency Key

Parameters

Request Object

Response Object

2.1

accounts

GET

GET /accounts

accounts

Authorisation Code

No

Pagination

 

OBReadAccount

2.2

accounts

GET

GET/accounts/{AccountId}

accounts

Authorisation Code

No

 

 

OBReadAccount

A. GET/accounts

The first step for an AISP after an account-request is authorised - is to call the GET /accounts endpoint.

The AISP will be given the full list of accounts (the AccountId(s)) that the user/customer has authorised the AISP to access. The AccountId(s) returned may then be used to retrieve other resources for a specific AccountId. The selection of the authorised accounts happens only at the ASPSP’s interface.

B. GET /accounts/{AccountId}

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

Data Models

The OBReadAccount object will be used for the call to:

  • GET /accounts/{AccountId}

  • GET /accounts

Resource Definition: This resource represents the account to which credit and debit entries are made. Each account resource will have a unique and immutable AccountId.

UML Diagram:

Notes

  • The Account and Servicer structure has been designed to:

    • Reflect the DebtorAccount, DebtorAgent, CreditorAccount and CreditorAgent structures in the PISP use case.

    • Defining a SchemeName for the Account and Servicer blocks can help accommodate multiple types of accounts.

  • For common Domestic Kuwait identification schemes:

    • Account/Account

      • Where "KW.OBF.IBAN" is specified as the SchemeName, the Identification field must be populated with the full IBAN

    • Account/Servicer

      • Where "KW.OBF.BICFI" is populated as the SchemeName, the Identification field must be populated with the BIC

Permission Codes

The resource differs depending on the permissions (ReadAccountsBasic and ReadAccountsDetail) used to access the resource. In the event that the resource is accessed with both ReadAccountsBasic and ReadAccountsDetail, the most detailed level (ReadAccountsDetail) must be used.

  • These objects must not be returned without the ReadAccountsDetail permission:

    • OBReadAccount/Data/Account/Account

    • OBReadAccount/Data/Account/Servicer

  • If the ReadAccountsDetail is granted by the user/customer:

    • OBReadAccount/Data/Account/Account must be returned (1..n)

    • OBReadAccount/Data/Account/Servicer may be returned if applicable to the account and ASPSP (0..1)

Data Dictionary

Name

Occurrence

XPath

Definition

Class/Datatype

Codes

Pattern

Name

Occurrence

XPath

Definition

Class/Datatype

Codes

Pattern

OBReadAccount

 

OBReadAccount

 

OBReadAccount

 

 

Data

1..1

OBReadAccount/Data

 

OBReadAccount/Data

 

 

Account

0..n

OBReadAccount/Data/Account

Unambiguous identification of the account to which credit and debit entries are made.

OBReadAccount/Data/Account

 

 

AccountId

1..1

OBReadAccount/Data/Account/AccountId

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

String

 

 

Status

0..1

OBReadAccount/Data/Account/Status

Specifies the status of account resource in code form.

OBAccountStatusCode

Enum:

  • Active

  • NotActive

  • Dormant

  • Unclaimed

  • Pending

  • Suspended

  • Closed

 

StatusUpdateDateTime

0..1

OBReadAccount/Data/Account/StatusUpdateDateTime

Date and time at which the resource status was updated.

ISODateTime

 

 

Currency

1..1

OBReadAccount/Data/Account/Currency

Identification of the currency in which the account is held.

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

String

 

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

AccountType

0..1

OBReadAccount/Data/Account/AccountType

Specifies the type of account (personal or business).

OBAccountType

Enum:

  • Retail

  • Corporate

 

AccountSubType

0..1

OBReadAccount/Data/Account/AccountSubType

Specifies the sub type of account (product family group).

String

 

 

Description

0..1

OBReadAccount/Data/Account/Description

Specifies the description of the account type.

String

 

 

Nickname

0..1

OBReadAccount/Data/Account/Nickname

The nickname of the account, assigned by user/customer to provide an additional and easier means of identification of the account at the ASPSP.

String

 

 

OpeningDate

0..1

OBReadAccount/Data/Account/OpeningDate

Date on which the account and its related basic services by ASPSP started to be operational for the user/customer.

ISODate

 

 

MaturityDate

0..1

OBReadAccount/Data/Account/MaturityDate

Maturity date for the account.

ISODate

 

 

Account

0..n

OBReadAccount/Data/Account/Account

Provides the details to identify an account.

OBReadAccount/Data/Account/Account

 

 

SchemeName

1..1

OBReadAccount/Data/Account/Account/SchemeName

Name of the identification scheme, in a coded form as published in an external list.

String

Enum:

KW.OBF.IBAN

 

Identification

1..1

OBReadAccount/Data/Account/Account/Identification

Identification assigned by an ASPSP to identify an account. This identification is known by the account owner.

String

 

 

Name

0..1

OBReadAccount/Data/Account/Account/Name

The account name is the name or names of the account owner(s) represented at an account level, as displayed by the ASPSP’s online channels. Note, the account name is not the product name or the nickname of the account.

String

 

 

Servicer

0..1

OBReadAccount/Data/Account/Servicer

Party that manages the account on behalf of the account owner, that is manages the registration and booking of entries on the account, calculates balances on the account and provides information about the account.

OBReadAccount/Data/Account/Servicer

 

 

SchemeName

1..1

OBReadAccount/Data/Account/Servicer/SchemeName

Name of the identification scheme, in a coded form as published in an external list.

String

Enum:

KW.OBF.BICFI

 

Identification

1..1

OBReadAccount/Data/Account/Servicer/Identification

Unique and unambiguous identification of the servicing institution.

String

 

 

Usage Examples

A. Bulk Accounts

The call to GET /accounts is the first step after an account-request is authorised. This will allow the AISP to discover which accounts (and AccountId values) are associated with the authorisation of consent.

I Get Accounts Request

GET /accounts HTTP/1.1 Authorisation: Bearer 4AopnAZFKjr5zBsicSQpLL x-fapi-auth-date: Tue, 13 June 2023 19:43:31 GMT+03:00 x-fapi-customer-ip-address: 204.35.213.15 x-fapi-interaction-id: 75fdc714-f2dg-7676-c759-710d6715689g Accept: application/json

II Get Accounts Response

HTTP/1.1 200 OK x-fapi-interaction-id: 75fdc714-f2dg-7676-c759-710d6715689g Content-Type: application/json { "Data": { "Account": [ { "AccountId": "00786543", "Status": "Active", "StatusUpdateDateTime": "2023-06-13T08:27:44.180+03:00”, "Currency": "KWD", "AccountType": "Personal", "AccountSubType": "SavingsAccount", "Nickname": "Mubarak", "OpeningDate": "2021-05-23”, }, { "AccountId": "00346891", "Status": "Active", "StatusUpdateDateTime": "2023-06-13T08:27:44.180+03:00”, "Currency": "KWD", "AccountType": "Business", "AccountSubType": "CurrentAccount", "OpeningDate": "2018-03-25”, "Account": [ { "SchemeName": "KW.OBF.IBAN", "Identification": "KW10AKBU00100000009923", "Name": "Mohammed Abdulla Mubarak", } ], "Servicer": { "SchemeName": "KW.OBF.BICFI", "Identification": "KWOBFBICFIABC" } } ] }, }, "Links": { "Self": "www.ABC.com" }, "Meta": { "TotalPages": 02, "FirstAvailableDateTime": "2023-06-13T09:10:17.596+03:00”, "LastAvailableDateTime": "2023-06-13T09:10:17.596+03:00” }

B. Specific Account

An AISP may also retrieve the account resource details specifically for AccountId 00347895. The ReadAccountsDetail permission has been granted.

I Get Accounts Request

GET /accounts/00347895 HTTP/1.1 Authorisation: Bearer 4AopnAZFKjr5zBsicSQpLL x-fapi-auth-date: Tue, 18 Mar 2020 19:43:31 GMT+03:00 x-fapi-customer-ip-address: 204.35.213.15 x-fapi-interaction-id: 75fdc714-f2dg-7676-c759-710d6715689g Accept: application/json

II Get Accounts Response

HTTP/1.1 200 OK x-fapi-interaction-id: 75fdc714-f2dg-7676-c759-710d6715689g Content-Type: application/json { "Data": { "Account": [ { "AccountId": "00347895", "Status": "Active", "StatusUpdateDateTime": "2023-06-13T08:27:44.180+03:00”, "Currency": "KWD", "AccountType": "Personal", "AccountSubType": "SavingsAccount", "Nickname": "Salah", "OpeningDate": "2017-04-21”, }, ] }, "Links": { "Self": "www.ABC.com" }, "Meta": { "TotalPages": 02, "FirstAvailableDateTime": "2023-06-13T09:10:17.596+03:00”, "LastAvailableDateTime": "2023-06-13T09:10:17.596+03:00” } }