Read/Write Data API Specification - v3.0
- 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 Agnostic to Payment Schemes
- 2.3.8 Status Codes
- 2.3.9 Unique Identifiers (Id Fields)
- 2.3.10 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.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 Specification
- 3.9.2 Process for Signing a Payload
- 3.9.3 Process for Verifying a Signature
- 3.9.4 Sample JOSE Header
- 3.10 Filtering
- 3.11 Pagination
- 3.12 Archiving
- 4 Security & Access Control
- 5 Data Model
- 5.1 Common Payload Structure
- 5.1.1 Request Structure
- 5.1.2 Response Structure
- 5.1.3 Error Response Structure
- 5.1.4 Optional Fields
- 5.1.5 Links
- 5.1.6 Meta
- 5.2 Enumerations
- 5.2.1 Basics
- 5.2.2 Common Namespaced Enumerations
- 5.1 Common Payload Structure
- 6 Usage Examples
Version Control
Version | Date | Author | Comments |
|---|---|---|---|
2.0-rc1 | Jan 19, 2018 | OB R/W API Team | This is the initial draft version for rc1 |
2.0-rc2 | Feb 2, 2018 | OB R/W API Team | Moved Usage Examples from Account and Transactions Specification to this page Updated the Response Headers section to state the x-fapi-interaction-id should be generated if required. Matches FAPI specification. Clarified that x-fapi-financial-id corresponds to the organization id of the ASPSP in the Open Banking Directory. Clarified that x-jws-signature is only valid for some APIs. Removed x-jws-signature from examples. Changes to the Message Signing section to:
Added error code 415 Unsupported Media Type, for invalid Content-Type header value |
2.0-rc3 | Feb 16, 2018 | OB R/W API Team | This is the initial draft version for rc3. Updates:
Errata:
|
3.0-draft1 | May 1, 2018 | OB R/W API Team | No change. |
3.0-draft2 | May 8, 2018 | OB R/W API Team | No Change |
3.0-draft3 | May 15, 2018 | OB R/W API Team | Clarified that x-fapi-financial-id should be validated. Clarified wording in 400 (Bad Request) v/s 404 (Not Found) section from "If an ASPSP has not implemented an optional API, it must respond with a 404 (Not Found) for requests to that URL." to "If an ASPSP has not implemented an API endpoint, it must respond with a 404 (Not Found) for requests to that URL." |
3.0-draft4 | Jun 4, 2018 | OB R/W API Team | Clarified use of Idempotency Key. Updated Resource URI Path Structure to state the use of API pre-fixes for [resource-group] based on 132 |
3.0-draft5 | Jun 13, 2018 | OB R/W API Team | Updated examples to change UTC to GMT to be in line with https://tools.ietf.org/html/rfc7231#page-66 Clarified the usage of the http://openbanking.org.uk/iss field in the JOSE header for non-repudiation Clarified in "Return & Error Codes" that an ASPSP must return a 429 when a request has been throttled. Clarified the definition of Content-Type and Accept header behaviour. Specifically, added "The TPP may provide additional information (e.g. a 'q' value and charset). " |
3.0-draft6 | Jun 22, 2018 | OB R/W API Team | Some further tightening up on "Return & Error Codes" (429) and that it must be documented as part of fair usage policies. Modified definition for 400s to state that they could be used for DELETE and GET requests. Also stated that incorrect headers may lead to 400s. Added OAuth Error Code alignment as a must for ASPSP to implement Added Error Response Structure and Error Codes for response payload Updated Message Signing principles (out of date text removed) Clarified detail on the use of RS256/PS256 as a signing algorithm. Added Data / Enumerations to document how namespaced enumerations are used Added Date Format Guideline for ASPSPs: 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. |
3.0-draft7 | Jul 10, 2018 | OB R/W API Team | Added more ErrorCode(s) in the CodeList Removed Error Response/Codes for Http Error: 401, 403 and 429. Updated the Authorized Intent example from "AwaitingAuthorisation" to “Revoked“ state Rewrote "Changes to an Intent's Authorized State" so that it is clearer. Added a section on Data Model / Common Payload Structure / Optional Fields to ensure that optional fields are encoded consistently. |
3.0-RC2 | Jul 19, 2018 | OB R/W API Team | Re-ordered Error Code table and fixed grammatical errors. Clarified that Error Code types for UK.OBIE.Signature.* only relate to the x-jws-signature. Changed the title of Basics → Return & Error Codes to Basics / HTTP Status Codes Modified the Error Descriptions to clarify what should be populated into path and url fields Modified the UK.OBIE. Listed child pages as API specifications in Overview section. Modifications to cater to re-authentication:
Modifications for the introduction of CIBA
|
3.0-RC3 | Aug 3, 2018 | OB R/W API Team | Renamed the Refresh Token expiry field from Type of the http://openbanking.org.uk/refresh_token_expires_at Removed reference of Discovery API Specification from Overview section. For information note added in Supported Grant Types / CIBA on status of the CIBA profile. Consent Re-authorisation section and content within, is renamed to Consent Re-authentication (for Authorised Consents) In OBErrorResponse1 object - increased the size of:
Added Security & Access Control / Consent Authorisation / Exemptions from Strong Customer Authentication to clarify that the spec does not dwell upon this topic. Replaced section on 'Definition of Optionality' with new section on 'Categorisation of implementation requirements'. Added Updated Code definition in data dictionary. Updated Error Code Usage Example with valid code and values. Aug 16, 2018 updates:
|
3.0 | Sep 7, 2018 | OB R/W API Team | This is the baseline version. No change from RC3. |
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/ and
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.
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 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). The Security Working Group has stated that granular error codes may expose threat vectors - so these are limited to the HTTP Status Codes.
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 | Specializes | 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 following structure (from the OB API Release Management document).
[participant-path-prefix]/open-banking/[version]/[resource-group]/[resource]/[sub-resource]/[resource-id]
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]/[sub-resource]/[resource-id]
Details the resource.
Examples:
/superbank/open-banking/v1.0/pisp/payments/open-banking/v2.0/aisp/account-access-consents/apis/open-banking/v2.1/aisp/accounts/open-banking/v3.0/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 |
|---|---|---|---|---|
x-fapi-financial-id | The unique id of the ASPSP to which the request is issued. The unique id will be issued by OB and corresponds to the Organization Id of the ASPSP in the Open Banking Directory. If the value does not match the expected value (based on the Client ID or network certificate of the caller, the ASPSP must reject the request with a 403 (Not Authorized) status code. | Mandatory | Mandatory | Mandatory |
x-fapi-customer-last-logged-time | The time when the PSU last logged in with the TPP. | Optional | Optional | Optional |
x-fapi-customer-ip-address | The PSU's IP address if the PSU is currently logged in with the TPP. | Optional | Optional | Optional |
© Open Banking Limited 2019 | https://www.openbanking.org.uk/open-licence | https://www.openbanking.org.uk