Read/Write Data API Specification - v3.1.2
- 1 Version Control
- 2 Overview
- 2.1 Document Structure
- 2.2 Known Issues
- 2.3 Design Principles
- 2.3.1 RESTful APIs
- 2.3.2 Standards
- 2.3.3 ISO 20022
- 2.3.4 Extensibility
- 2.3.5 Idempotency
- 2.3.6 Message Signing
- 2.3.7 Message Encryption
- 2.3.8 Agnostic to Payment Schemes
- 2.3.9 Status Codes
- 2.3.10 Unique Identifiers (Id Fields)
- 2.3.11 Categorisation of Implementation Requirements
- 3 Basics
- 3.1 Actors
- 3.2 Character Encoding
- 3.3 Date Formats
- 3.4 Resource URI Path Structure
- 3.5 Headers
- 3.5.1 Request Headers
- 3.5.2 Response Headers
- 3.6 HTTP Status Codes
- 3.6.1 400 (Bad Request) v/s 404 (Not Found)
- 3.6.2 403 (Forbidden)
- 3.6.3 401 (Unauthorized)
- 3.6.4 429 (Too Many Requests)
- 3.7 Pre-Conditions
- 3.7.1 Pre-conditions for TPPs
- 3.7.2 Pre-conditions for ASPSPs
- 3.8 Idempotency
- 3.9 Message Signing
- 3.9.1 Overview
- 3.9.2 Key Stores
- 3.9.3 Specification
- 3.9.4 Process for Signing a Payload
- 3.9.5 Process for Verifying a Signature
- 3.9.6 Sample JOSE Header
- 3.10 Message Encryption
- 3.10.1 Overview
- 3.10.2 Message Signing and Encryption
- 3.10.3 Key Stores
- 3.10.4 Encrypting Non-JSON Data
- 3.11 Filtering
- 3.12 Pagination
- 3.13 Archiving
- 3.14 Supplementary Data
- 4 Security & Access Control
- 5 Data Model
- 5.1 Enumerations
- 5.2 Common Payload Structure
- 5.2.1 Request Structure
- 5.2.2 Response Structure
- 5.2.3 Error Response Structure
- 5.2.4 Optional Fields
- 5.2.5 Links
- 5.2.6 Meta
- 6 Usage Examples
Version Control
Version | Date | Author | Comments |
|---|---|---|---|
4.0-draft7 | Mar 18, 2019 | OB R/W API Team | 4.0-draft7 changes:
|
3.1.2-RC1 | Mar 22, 2019 | OB R/W API Team | 3.1.2-RC1 changes:
|
3.1.2 | May 1, 2019 | OB R/W API Team | 3.1.2 final release. No change from RC1 |
Overview
The Read/Write Data API Specification provides a description of the elements that are common across all the Read/Write Data APIs.
This specification should be read in conjunction with the individual Read/Write API Specifications for:
This specification should be read in conjunction with the Customer Experience Guidelines and Management Information Requirements. Together these form the OBIE standard, which should enable any ASPSP which implements the specification to meet their obligations under both the CMA Order and PSD2/RTS.
The key difference between the CMA Order and PSD2/RTS requirements relate to which product types are implemented, and the timing for implementation. For example, the CMA Order requires the CMA9 to implement the standard for PCA and BCA accounts earlier (in some cases) than the PSD2/RTS timelines. The timings are defined in the Open Banking Roadmap (https://www.openbanking.org.uk/wp-content/uploads/Open-Banking-Revised-Roadmap-July-2018.pdf).
Document Structure
This document consists of the following parts:
Overview: Provides an overview of the scope of the API and the key decisions and principles that contributed to the specification.
Basics: The section begins with an introduction to how the APIs are used.
Security & Access Control: Specifies the means for TPPs and PSUs to authenticate themselves and provide consent.
Data Model: Describes the data model for the API payloads.
Known Issues
This document and its sub-pages must be read in conjunction with the Known Issues.
Design Principles
RESTful APIs
The API adheres to RESTful API concepts where possible and sensible to do so.
However, the priority is to have an API that is simple to understand and easy to use. In instances where following RESTful principles would be convoluted and complex, the principles have not been followed.
References:
The highest level Data Description Language used is the JSON Schema : http://json-schema.org/
Best Practice has also been taken from the Data Description Language for APIs; JSON API : http://jsonapi.org/
The Interface Description Language used is the Swagger Specification version 2.0 (also known as Open API) : http://swagger.io/
Standards
The OBIE principles for developing API standards:
OBIE will adopt existing standards where relevant/appropriate to minimise re-inventing the wheel.
The Standards currently being reviewed include ISO20022 and FAPI.
OBIE will favour developer/user experience over and above adoption of existing Standards, in order to create a more future proof Standard.
OBIE will work with other relevant bodies to align with, contribute to and/or adopt other Standards work, especially relating to creation of Standards around APIs and JSON payloads.
ISO 20022
The CMA Order requires the CMA9 Banks to be aligned with the Regulatory and Technical Standards (RTS) under PSD2.
A previous draft of the EBA RTS required that the interface "shall use ISO 20022 elements, components or approved message definitions". In keeping with that requirement, the API payloads are designed using the ISO 20022 message elements and components where available.
The principles we have applied to re-use of ISO message elements and components are:
Where relevant, the API payloads have been flattened so that they are more developer friendly. This has been a request from the developer community, and the stakeholders involved in the design workshop.
Only elements that are required for the functioning of the API endpoint will be included in the API payload. API endpoints are defined for specific use-cases (not to be generically extensible for all use-cases).
We will modify ISO 20022 elements where the existing standard does not cater for an API context (such as filtering, pagination etc.). An example is having latitude and longitude in decimal format, as this is how developers will work with latitude and longitude; or using simple types (e.g., a single date-time field) instead of a complex type (e.g., a choice field with a nesting of date and time).
Extensibility
It is intended that the API flows will be extended to cater for more complex use-cases in subsequent releases, and we have kept this in mind during the design.
Idempotency
Idempotency is difficult to implement consistently and leverage consistently.
As a result, idempotency is used sparingly in the Open Banking API specifications; with a preference to allow TPPs to simply re-submit a request under failure conditions.
APIs have been defined to be idempotent, where not doing so would cause a poor PSU user-experience or increase false positive risk indicators.
Message Signing
Digital signatures will facilitate non-repudiation for Open Banking APIs.
The approach for message signing is documented in Basics / Message Signing.
The applicability of signatures to individual requests and responses is documented on the page for each of the resources. However, implementors of the standards can optionally add signatures to all response and request payloads.
Message Encryption
Message Encryption is an optional feature of the Open Banking APIs to facilitate additional protection of inflight data.
The approach for message encryption is documented in Basics / Message Encryption.
Applicability to individual requests and responses is not defined in the standards. Application will be based on agreement between implementors of the standards.
Agnostic to Payment Schemes
The API will be designed so that it is agnostic to the underlying payment scheme that is responsible for carrying out the payment.
As a result, we will not design field lengths and payloads to only match the Faster Payments message, and will instead rely on the field lengths and definitions in ISO 20022. Due diligence has been carried out to ensure that the API has the necessary fields to function with Bacs payments - as per the agreed scope.
We will provide further mapping guidance to ensure that differences are understood between the Open Banking Payment API standard, and FPS and Bacs schemes where applicable.
Status Codes
The API uses two status codes that serve two different purposes:
The HTTP Status Code reflects the outcome of the API call (the HTTP operation on the resource). Granular Functional Error Codes are specified as part of API Error Response Structure, after consultation with Security and Fraud Working Group.
A Status field in some of the resource payloads reflects the status of resources.
Unique Identifiers (Id Fields)
A REST resource should have a unique identifier (e.g. a primary key) that may be used to identify the resource. These unique identifiers are used to construct URLs to identify and address specific resources.
However, considering that some of the resources described in these specifications do not have a primary key in the system of record, the Id field will be optional for some resources.
An ASPSP that chooses to populate optional Id fields must ensure that the values are unique and immutable.
Categorisation of Implementation Requirements
Where a requirement is being implemented by either an ASPSP and/or a TPP, a different categorisation is applied. The functionality, endpoints and fields within each resource are categorised as 'Mandatory', 'Conditional' or 'Optional'.
ASPSPs must make documentation available to TPPs (e.g. on their developer portals) to which 'Conditional' / 'Optional' endpoints and fields are implemented for any given implementation of the specification.
Mandatory
Functionality, endpoints and fields marked as Mandatory are required in all cases for regulatory compliance and/or for the API to function and deliver essential customer outcomes.
For functionalities and endpoints:
An ASPSP must implement an endpoint that is marked Mandatory.
An ASPSP must implement functionality that is marked Mandatory.
For fields:
A TPP must specify the value of a Mandatory field.
An ASPSP must process a Mandatory field when provided by the TPP in an API request.
An ASPSP must include meaningful values for Mandatory fields in an API response.
Conditional
Functionality, endpoints and fields marked as Conditional may be required in some cases for regulatory compliance (for example, if these are made available to the PSU in the ASPSP's existing Online Channel, or if ASPSPs (or a subset of ASPSPs) have been mandated by a regulatory requirement).
For functionalities and endpoints:
An ASPSP must implement functionality and endpoints marked as Conditional if these are required for regulatory compliance.
For fields:
All fields that are not marked as Mandatory are Conditional.
A TPP may specify the value of a Conditional field.
An ASPSP must process a Conditional field when provided by the TPP in an API request, and must respond with an error if it cannot support a particular value of a Conditional field.
An ASPSP must include meaningful values for Conditional fields in an API response if these are required for regulatory compliance.
Optional
Functionality and endpoints marked as Optional are not necessarily required for regulatory compliance but may be implemented to enable desired customer outcomes.
For functionalities and endpoints:
An ASPSP may implement an Optional endpoint.
An ASPSP may implement Optional functionality.
For fields:
There are no Optional fields.
For any endpoints which are implemented by an ASPSP, the fields are either Mandatory or Conditional.
Basics
Actors
Actor | Abbreviation | Type | Specialises | Description |
|---|---|---|---|---|
Payment Service User | PSU | Person | N/A | A natural or legal person making use of a payment service as a payee, payer or both (PSD2 Article 4(10)). |
Payment Service Provider | PSP | Legal Entity | N/A | A legal entity (and some natural persons) that provide payment services as defined by PSD2 Article 4(11). |
Account Servicing Payment Service Provider | ASPSP | Legal Entity | PSP | An ASPSP is a PSP that provides and maintains a payment account for a payment services user (PSD 2 Article 4(15). The CMA 9 are all ASPSPs. |
Third Party Providers / Trusted Third Parties | TPP | Legal Entity | PSP | A party other than an ASPSP that provides payment related services. The term is not actually defined in PSD2, but is generally deemed to include all payment service providers that are 3rd parties (the ASPSP and the PSU to whom the account belongs being the first two parties). References to a "TPP" in the specification relate to a piece of registered software with an ASPSP (with a specific client_id). |
Payment Initiation Service Provider | PISP | Legal Entity | TPP | A TPP that provides Payment Initiation Services. PSD2 does not offer a formal definition. Article 4(18) quite circularly defines a PISP as a PSP that provides Payment Initiation Services. |
Account Information Service Provider | AISP | Legal Entity | TPP | A TPP that provides Account Information Services. Again, PSD2 defines AISPs in Article 4(19) circularly as a PSP that provides account information services |
Card Based Payment Instrument Issuer | CBPII | Legal Entity | TPP | A TPP that issues card based payment instruments to PSUs and requires access to the Confirmation of Funds API. |
Character Encoding
The API requests and responses must use a UTF-8 character encoding. This is the default character encoding for JSON (RFC 7158 - Section 8.1)
However, an ASPSP's downstream system may not accept some UTF-8 characters, such as emoji characters (e.g. "Happy Birthday 🎂🎂!" may not be an acceptable Payment Reference). If the ASPSP rejects the message with a UTF-8 character that cannot be processed, the ASPSP must respond with an HTTP 400 (Bad Request) status code.
Date Formats
An ASPSP must accept all valid ISO-8601 date formats including its permitted variations (e.g. variations in how the timezone is defined, dates with or with a seconds or milliseconds part etc.) in the requests.
All dates in the JSON payloads are represented in ISO 8601 date-time format. All date-time fields in responses must include the timezone. For Example:
2017-04-05T10:43:07+00:00
2018-07-03T14:43:41ZAll dates in the query string are represented in ISO 8601 date-time format and must not include the timezone. For example:
2017-04-05T10:43:07
2017-04-05All dates in the HTTP headers are represented as RFC 7231 Full Dates. An example is below:
Sun, 10 Sep 2017 19:43:31 GMTAll dates in the JWT claims are expressed as a JSON number, representing the number of seconds from 1970-01-01T0:0:0Z as measured in GMT until the date/time.
//Sun, 12 Feb 2018 14:45:00 GMT
1518446700Resource URI Path Structure
The path of the URI must follow the structure below (from the OB API Release Management document).
[participant-path-prefix]/open-banking/[version]/[resource-group]/[resource]/[resource-id]/[sub-resource]
This consists of the following elements:
[participant-path-prefix]
An optional ASPSP specific path prefix.open-banking
The constant string "open-banking".[version]
The version of the APIs expressed as /v[major-version].[minor-version]/.[resource-group]
The resource-group identifies the group of endpoints, according to the PSD2 role used to access the API (as "aisp", "pisp" or "cbpii").[resource]/[resource-id]
Details the resource.[sub-resource]
Details the sub-resource.
An ASPSP must use the same participant-path-prefix and host name for all its resources.
Examples:
https://superbank.com/apis/open-banking/v3.1/pisp/domestic-paymentshttps://superbank.com/apis/open-banking/v3.1/aisp/account-access-consentshttps://superbank.com/apis/open-banking/v3.1/aisp/accountshttps://superbank.com/apis/open-banking/v3.1/aisp/accounts/1234https://superbank.com/apis/open-banking/v3.1/aisp/accounts/1234/transactionshttps://superbank.com/apis/open-banking/v3.1/cbpii/funds-confirmation-consents
For brevity, the APIs are referred to by their resource names in these documents and in all examples.
Headers
Request Headers
Header Value | Notes | POST Requests | GET Requests | DELETE Requests | PUT Requests |
|---|---|---|---|---|---|
x-fapi-auth-date | The time when the PSU last logged in with the TPP. The value is supplied as a HTTP-date as in section 7.1.1.1 of [RFC7231], e.g., | Optional | Optional | Optional | Do not use |
x-fapi-customer-ip-address | The PSU's IP address if the PSU is currently logged in with the TPP. | Optional | Optional | Optional | Do not use |
x-fapi-interaction-id | An RFC4122 UID used as a correlation Id. If provided, the ASPSP must "play back" this value in the x-fapi-interaction-id response header. | Optional | Optional | Optional | Optional |
Authorization | Standard HTTP Header; Allows Credentials to be provided to the Authorisation / Resource Server depending on the type of resource being requested. For OAuth 2.0 / OIDC, this comprises of either the Basic / Bearer Authentication Schemes. | Mandatory | Mandatory | Mandatory | Mandatory |
Content-Type | Standard HTTP Header; Represents the format of the payload being provided in the request. This must be set to application/json, except for the endpoints that support Content-Type other than application/json (e.g POST /file-payment-consents/{ConsentId}/file), the ASPSP must specify the available options on their developer portals. This must be set to application/jose+jwe for encrypted requests. The TPP may provide additional information (e.g. a 'q' value and charset). If set to any other value, the ASPSP must respond with a 415 Unsupported Media Type. | Mandatory | Do not use | Do not use | Mandatory |
Accept | Standard HTTP Header; Determine the Content-Type that is required from the Server. If the TPP expects an unencrypted response, it must indicate that the only a JSON response is accepted (e.g by setting the value to If the TPP expects an encrypted response, it must indicate that the only a JWT response is accepted (e.g by setting the value to For endpoints that do not respond with JSON (e.g GET ../statements/{StatementId}/file), the ASPSP must specify the available options on their developer portals. The TPP may provide additional information (e.g. a 'q' value and charset). If set to an unacceptable value the ASPSP must respond with a 406 (Not Acceptable). If not specified, the default is application/json. | Optional | Optional | Do not use | Optional |
x-idempotency-key | Custom HTTP Header; Unique request identifier to support idempotency. Mandatory for POST requests to idempotent resource end-points. Must not be specified for other requests. | Optional | Do not use | Do not use | Do not use |
x-jws-signature | Header containing a detached JWS signature of the body of the payload. Refer to resource specific documentation on when this header must be specified. | API specific | API specific | API specific | Mandatory |
| The header indicates the user-agent that the PSU is using. The TPP may populate this field with the user-agent indicated by the PSU. If the PSU is using a TPP mobile app, the TPP must ensure that the user-agent string is different from browser based user-agent strings. | Optional | Optional | Optional | Optional |
Whether the PSU is present or not-present is identified via the x-fapi-customer-ip-address header. If the PSU IP address is supplied, it is inferred that the PSU is present during the interaction.
The implications to this are:
ASPSPs will need to rely on the AISPs assertion.
As agreed at TDA (18/05), it will be up to the ASPSPs to interpret the 4-times customer not present rule, to be within the “spirit” of the RTS requirement.
This is dependent on GDPR considerations on the AISP passing a PSU's IP address to an ASPSP.
Response Headers
Header Value | Notes | Mandatory? |
|---|---|---|
Content-Type | Standard HTTP Header; Represents the format of the payload returned in the response. The ASPSP must return |
© Open Banking Limited 2019 | https://www.openbanking.org.uk/open-licence | https://www.openbanking.org.uk