Account and Transaction API Specification - v1.0.0
- 1 Version Control
- 2 Overview
- 2.1 Document Overview
- 2.2 Design Principles
- 2.2.1 RESTful APIs
- 2.2.2 Standards
- 2.2.3 ISO 20022
- 2.2.4 Extensibility
- 2.2.5 Idempotency
- 2.2.6 Non-Repudiation
- 2.2.7 Unique Identifiers (Id Fields)
- 2.3 Scope
- 2.4 Out of Scope
- 3 Basics
- 3.1 Overview
- 3.1.1 Steps
- 3.1.2 Sequence Diagram
- 3.1.2.1 Account Info - High Level Flow
- 3.2 Actors
- 3.3 Headers
- 3.3.1 Request Headers
- 3.3.2 Response Headers
- 3.4 Return & Error Codes
- 3.5 Pre-Conditions
- 3.5.1 Pre-conditions for TPPs
- 3.5.2 Pre-conditions for ASPSPs
- 3.6 Idempotency
- 3.7 Non-repudiation
- 3.7.1 Overview
- 3.7.2 Specification
- 3.7.3 Process for signing a payload
- 3.7.4 Process for verifying a signature
- 3.7.5 Sample JOSE Header
- 3.8 Filtering
- 3.9 Pagination
- 3.10 Regulatory Considerations
- 3.10.1 RTS - Article 10
- 3.10.2 RTS - Article 31(5)
- 3.1 Overview
- 4 Endpoints
- 4.1 POST /account-requests
- 4.1.1.1 POST Account Request
- 4.1.2 Account Request Status
- 4.2 GET /account-requests/{AccountRequestId}
- 4.2.1.1 GET Account Request
- 4.2.2 Account Request Status
- 4.3 DELETE /account-requests/{AccountRequestId}
- 4.3.1 DELETE Account Request
- 4.4 GET Authorised Accounts
- 4.5 GET Resources for a Specific Account
- 4.6 GET Resources in Bulk
- 4.1 POST /account-requests
- 5 Security & Access Control
- 5.1 API Scopes
- 5.1.1 Scopes
- 5.2 Grants Types
- 5.3 Consent Authorisation
- 5.3.1 Consent Elements
- 5.3.1.1 Permissions
- 5.3.1.2 Expiration Date Time
- 5.3.1.3 Transaction To/From Date Time
- 5.3.2 Account Request Status
- 5.3.3 Error Condition
- 5.3.4 Consent Revocation
- 5.3.5 Changes to Selected Account(s)
- 5.3.6 Handling Expired Access Tokens
- 5.3.1 Consent Elements
- 5.4 Risk Scoring Information
- 5.1 API Scopes
- 6 Swagger Specification
- 7 Data Model
- 7.1 High Level Payload Structure
- 7.1.1 Request Structure
- 7.1.1.1 Account API Request
- 7.1.2 Response Structure
- 7.1.2.1 Account API Response
- 7.1.2.2 Example Links
- 7.1.2.3 Example Meta
- 7.1.1 Request Structure
- 7.2 Data Payload - Consent Object
- 7.2.1 Account Requests - Request
- 7.2.1.1 UML Diagram
- 7.2.1.2 Data Dictionary
- 7.2.2 Account Requests - Response
- 7.2.2.1 UML Diagram
- 7.2.2.2 Data Dictionary
- 7.2.1 Account Requests - Request
- 7.3 Data Payload - Resources
- 7.3.1 Accounts
- 7.3.1.1 Resource Definition
- 7.3.1.2 UML Diagram
- 7.3.1.3 Data Dictionary
- 7.3.2 Balances
- 7.3.2.1 Resource Definition
- 7.3.2.2 UML Diagram
- 7.3.2.3 Data Dictionary
- 7.3.3 Beneficiaries
- 7.3.3.1 Resource Definition
- 7.3.3.2 UML Diagram
- 7.3.3.3 Data Dictionary
- 7.3.4 Direct Debits
- 7.3.4.1 Resource Definition
- 7.3.4.2 UML Diagram
- 7.3.4.3 Data Dictionary
- 7.3.5 Product
- 7.3.5.1 Resource Definition
- 7.3.5.2 UML Diagram
- 7.3.5.3 Data Dictionary
- 7.3.6 Standing Orders
- 7.3.6.1 Resource Definition
- 7.3.6.2 UML Diagram
- 7.3.6.3 Data Dictionary
- 7.3.7 Transactions
- 7.3.7.1 Resource Definition
- 7.3.7.2 UML Diagram
- 7.3.7.3 Data Dictionary
- 7.3.1 Accounts
- 7.4 Data Payload - Enumerations
- 7.5 Mapping to Schemes & Standards
- 7.5.1 ISO 20022
- 7.1 High Level Payload Structure
- 8 Usage Examples
- 8.1 All Permissions Granted
- 8.1.1 Setup Account Request
- 8.1.1.1 Request
- 8.1.1.1.1 Post Account Requests Request
- 8.1.1.2 Response
- 8.1.1.2.1 Post Account Requests Response
- 8.1.1.1 Request
- 8.1.2 Status - AwaitingAuthorisation
- 8.1.2.1 Request
- 8.1.2.1.1 Get Account Requests Request
- 8.1.2.2 Response
- 8.1.2.2.1 Get Account Requests Response
- 8.1.2.1 Request
- 8.1.3 Status - Authorised
- 8.1.3.1 Request
- 8.1.3.1.1 Get Account Requests Request
- 8.1.3.2 Response
- 8.1.3.2.1 Get Account Requests Response
- 8.1.3.1 Request
- 8.1.4 Accounts - Bulk
- 8.1.4.1 Request
- 8.1.4.1.1 Get Accounts Request
- 8.1.4.2 Response
- 8.1.4.2.1 Get Accounts Response
- 8.1.4.1 Request
- 8.1.5 Accounts - Specific Account
- 8.1.5.1 Request
- 8.1.5.1.1 Get Accounts Request
- 8.1.5.2 Response
- 8.1.5.2.1 Get Accounts Response
- 8.1.5.1 Request
- 8.1.6 Balances - Specific Account
- 8.1.6.1 Request
- 8.1.6.1.1 Get Account Balances Request
- 8.1.6.2 Response
- 8.1.6.2.1 Get Account Balances Response
- 8.1.6.1 Request
- 8.1.7 Balances - Bulk
- 8.1.7.1 Request
- 8.1.7.1.1 Get Balances Request
- 8.1.7.2 Response
- 8.1.7.2.1 Get Balances Response
- 8.1.7.1 Request
- 8.1.8 Beneficiaries - Specific Account
- 8.1.8.1 Request
- 8.1.8.1.1 Get Account Beneficiaries Request
- 8.1.8.2 Response
- 8.1.8.2.1 Get Account Beneficiaries Response
- 8.1.8.1 Request
- 8.1.9 Beneficiaries - Bulk
- 8.1.9.1 GET /beneficiaries
- 8.1.9.1.1 Get Beneficiaries Request
- 8.1.9.2 GET /beneficiaries Response
- 8.1.9.2.1 Get Beneficiaries Response
- 8.1.9.1 GET /beneficiaries
- 8.1.10 Direct Debits - Specific Account
- 8.1.10.1 Request
- 8.1.10.1.1 Get Accounts Direct Debits Request
- 8.1.10.2 Response
- 8.1.10.2.1 Get Accounts Direct Debits Response
- 8.1.10.1 Request
- 8.1.11 Direct Debits - Bulk
- 8.1.11.1 Request
- 8.1.11.1.1 Get Direct Debits Request
- 8.1.11.2 Response
- 8.1.11.2.1 Get Direct Debits Response
- 8.1.11.1 Request
- 8.1.12 Product - Specific Account
- 8.1.12.1 Request
- 8.1.12.1.1 Get Accounts Product Request
- 8.1.12.2 Response
- 8.1.12.2.1 Get Accounts Product Response
- 8.1.12.1 Request
- 8.1.13 Products - Bulk
- 8.1.13.1 Request
- 8.1.13.1.1 Get Products Request
- 8.1.13.2 Response
- 8.1.13.2.1 Get Products Response
- 8.1.13.1 Request
- 8.1.14 Standing Orders - Specific Account
- 8.1.14.1 Request
- 8.1.14.1.1 Get Accounts Standing Orders Request
- 8.1.14.2 Response
- 8.1.14.2.1 Get Accounts Standing Orders Response
- 8.1.14.1 Request
- 8.1.15 Standing Orders - Bulk
- 8.1.15.1 Request
- 8.1.15.1.1 Get Standing Orders Request
- 8.1.15.2 Response
- 8.1.15.2.1 Get Standing Orders Response
- 8.1.15.1 Request
- 8.1.16 Transactions - Specific Account
- 8.1.16.1 Request
- 8.1.16.1.1 Get Account Transactions Request
- 8.1.16.2 Response
- 8.1.16.2.1 Get Account Transactions Response
- 8.1.16.1 Request
- 8.1.17 Transactions - Bulk
- 8.1.17.1 Request
- 8.1.17.1.1 Get Transactions Request
- 8.1.17.2 Response
- 8.1.17.2.1 Get Transactions Response
- 8.1.17.1 Request
- 8.1.18 Delete Account Request
- 8.1.18.1 Request
- 8.1.18.1.1 Delete Account Requests Request
- 8.1.18.2 Response
- 8.1.18.2.1 Delete Account Requests Response
- 8.1.18.1 Request
- 8.1.1 Setup Account Request
- 8.2 Limited Permissions Granted
- 8.2.1 Setup Account Request
- 8.2.1.1 Request
- 8.2.1.1.1 Post Account Requests Request
- 8.2.1.2 Response
- 8.2.1.2.1 Post Account Requests Response
- 8.2.1.1 Request
- 8.2.2 Accounts - Bulk
- 8.2.2.1 Request
- 8.2.2.1.1 Get Accounts Request
- 8.2.2.2 Response
- 8.2.2.2.1 Get Accounts Response
- 8.2.2.1 Request
- 8.2.3 Balances - Specific Account
- 8.2.3.1 Request
- 8.2.3.1.1 Get Account Balances Request
- 8.2.3.2 Response
- 8.2.3.2.1 Get Account Balances Response
- 8.2.3.1 Request
- 8.2.4 Transactions - Specific Account
- 8.2.4.1 Request
- 8.2.4.1.1 GET Account Transactions Request
- 8.2.4.2 Response
- 8.2.4.2.1 GET Account Transactions Response
- 8.2.4.1 Request
- 8.2.1 Setup Account Request
- 8.3 Pagination
- 8.3.1 Request
- 8.3.1.1 Paginated Transaction Request
- 8.3.2 Paginated Resource Response
- 8.3.2.1 Paginated Transaction Response
- 8.3.3 Request Next Page of Results
- 8.3.4 Paginated Resource Response
- 8.3.4.1 Paginated Transaction Response
- 8.3.1 Request
- 8.4 Alternate and Error Flows
- 8.4.1 Missing or Expired Access Token
- 8.4.1.1 Missing or Expired Access Token
- 8.4.2 Incomplete or Malformed Request Payload
- 8.4.2.1 Incomplete or Malformed Request
- 8.4.3 Missing or Invalid Access Token Scope
- 8.4.4 Sudden Burst of API Requests
- 8.4.4.1 Sudden Burst of API Requests
- 8.4.5 Failed Authorisation Consent
- 8.4.5.1 Failed Authorization Consent
- 8.4.1 Missing or Expired Access Token
- 8.1 All Permissions Granted
Version Control
Version | Date | Author | Comments |
|---|---|---|---|
1.0.0 | 23 Jun 2017 | Open Banking Read/Write API Team | This is the Baseline version. No Changes from v1.0 RC4. |
Overview
This specification describes the Account Information and Transaction API flows and payloads.
The API endpoints described here allow an AISP to:
Register an intent to retrieve account information by creating an "account request". This registers the data "permissions", expiration and transaction history timeframe the customer (PSU) has consented to provide to the AISP; and
Subsequently retrieve account and transaction data
Document Overview
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 identifies the resources, operations that are permitted on those resources, and various special cases.
Security & Access Control: Specifies the means for AISPs and PSUs to authenticate themselves and provide consent.
Swagger Specifications: Provides links to the swagger specifications for the APIs.
Data Model: Describes the data model for the API payloads.
Usage Examples: Examples for normal flows, and alternate flows.
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 the new API standards:
OBIE will adopt existing standards where relevant/appropriate to minimise re-inventing the wheel.
The initial scope of these Standards is limited to current OBIE scope - i.e., meeting CMA remedies. However, the intention is that the scope of the Standards will extend to either include or align to initiatives to cover a wider scope (i.e., PSD2).
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). Hence - only elements that are required for the account and transaction information scope are included in the Account Information API payloads for v1.0 (as this is the agreed scope for our v1.0 specification).
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
Version 1.0 of the API only caters to read access to account and transaction information for BCAs and PCAs.
However - where possible the APIs have been designed to be extensible - so they can in the future cover additional account types (e.g., card accounts) and operations (e.g., write access).
Idempotency
The Account Information and Transaction APIs will not be idempotent for v1.0.
Non-Repudiation
Subject to change
A policy decision is under consideration on whether API requests and responses will be digitally signed to provide a simpler means of non-repudiation.
This section will only be applicable if the policy decision is to implement non-repudiation through digital signatures.
The APIs will provide non-repudiation through digital signatures.
The specifications required to achieve this are described in Basics / Non-repudiation.
Unique Identifiers (Id Fields)
A REST resource should have a unique identifier (e.g. a primary key) that can 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 this specification do not have a primary key in the system of record.
For v1.0 it is not neccessary to individually address resources,
a decision has been made that Id fields will be specified for all resources - but be optional for all resources, except for the account resource.
The account resource needs to be addressed individually and must have a mandatory, unique and non-mutable identifier.
Scope
The APIs specified in this document provide the ability for AISPs to access a PSU's account and transaction information for domestic PCA and BCA accounts.
Out of Scope
This v1.0 specification does not cater for:
Write operations (the ability to create) standing orders, direct debits and beneficiaries.
Accounts other than PCAs and BCAs.
Progressive or changing consent - if the consent between the AISP and PSU changes, then the existing account-request object is deleted and a new account-request is created with the new consent/authorisation details.
The ability for the AISP to pre-specify the list of accounts that have been agreed with the PSU for consent/authorisation. At the time of writing the specification - it is not clear from a Legal perspective how the changing of these details over time (e.g, customers adding or deleting accounts) affects the original agreed authorisation.
The ability for the AISP to specify and "hints" for the types of accounts that have been agreed with the PSU for consent/authorisation (e.g., product or customer channel types). At the time of writing the specification - it is not clear from a Legal perspective how the changing of these details over time affects the original agreed authorisation.
Multi-authentication flows have been designed - but the full implications of the multi-authentication flows have not been worked through - so these are are not in the v1.0 specification.
Non-functional requirements and specification of caching and throttling.
Basics
Overview
The figure below provides a general outline of a account information requests and flow using the Account Info APIs.
Steps
Step 1: Request Account Information
This flow begins with a PSU consenting to allow an AISP to access account information data.
Step 2: Setup Account Request
The AISP connects to the ASPSP that services the PSU's account(s) and creates an account-request resource. This informs the ASPSP that one of its PSUs is granting access to account and transaction information to an AISP. The ASPSP responds with an identifier for the resource (the AccountRequestId - which is the intent identifier).
This step is carried out by making a POST request to /account-requests endpoint
The setup payload will include these fields - which describe the data that the PSU has consented with the AISP:
Permissions - a list of data clusters that have been consented for access
Expiration Date - an optional expiration for when the AISP will no longer have access to the PSU's data
Transaction Validity Period - the From/To date range which specifies a transaction history period which can be accessed by the AISP
An AISP may be a broker for data to other 4th parties, and so it is valid for a customer to have multiple account-requests for the same accounts, with different consent/authorisation parameters agreed.
Step 3: Authorise Consent
The AISP redirects the PSU to the ASPSP. The redirect includes the AccountRequestId generated in the previous step. This allows the ASPSP to correlate the account-request that was setup. The ASPSP authenticates the PSU. The ASPSP updates the state of the account-request resource internally to indicate that the account request has been authorised.
The principle we have agreed is that consent is managed between the PSU and the AISP - so the account-request details cannot be changed (with the ASPSP) in this step. The PSU will only be able to authorise or reject the account-request details in its entirety.
During authorisation - the PSU selects accounts that are authorised for the AISP request (in the ASPSP's banking interface)
The PSU is redirected back to the AISP.
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-request will be returned with a call to GET /accounts. This will always be the first call once an AISP has a valid access token.
Sequence Diagram
Account Info - High Level Flow
participant PSU
participant AISP
participant ASPSP Authorisation Server
participant ASPSP Resource Server
note over PSU, ASPSP Resource Server
Step 1: Request account information
end note
PSU -> AISP: Get account/transaction information
note over PSU, ASPSP Resource Server
Step 2: Setup account request
end note
AISP <-> ASPSP Authorisation Server: Establish TLS 1.2 MA
AISP -> ASPSP Authorisation Server: Initiate Client Credentials Grant
ASPSP Authorisation Server -> AISP: access-token
AISP <-> ASPSP Resource Server: Establish TLS 1.2 MA
AISP -> ASPSP Resource Server: POST /account-requests
ASPSP Resource Server -> AISP: HTTP 201 (Created), AccountRequestId
AISP -> PSU: HTTP 302 (Found), Redirect (AccountRequestId)
note over PSU, ASPSP Resource Server
Step 3: Authorise consent
end note
PSU -> ASPSP Authorisation Server: Follow redirect (AccountRequestId)
PSU <-> ASPSP Authorisation Server: authenticate
PSU <-> ASPSP Authorisation Server: SCA if required
PSU <-> ASPSP Authorisation Server: select accounts
ASPSP Authorisation Server -> PSU: HTTP 302 (Found), Redirect (authorization-code)
PSU -> AISP: Follow redirect (authorization-code)
AISP <-> ASPSP Authorisation Server: Establish TLS 1.2 MA
AISP -> ASPSP Authorisation Server: Exchange authorization-code for access token
ASPSP Authorisation Server -> AISP: access-token
note over PSU, ASPSP Resource Server
Step 4: Request data
end note
AISP <-> ASPSP Resource Server: Establish TLS 1.2 MA
AISP -> ASPSP Resource Server: GET /accounts
ASPSP Resource Server -> AISP: HTTP 200 (OK), List of accounts containing AccountId(s)
AISP -> ASPSP Resource Server: GET /accounts/{AccountId}/transactions
ASPSP Resource Server -> AISP: HTTP 200 (OK), List of transactions
AISP-> PSU: HTTP 200 (OK), List of transactions
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) |
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 |
Headers
Request Headers
The following headers SHOULD be inserted by the TPP in each API call:
Header Value | Notes | POST | GET | DELETE |
|---|---|---|---|---|
x-fapi-financial-id | The unique id of the ASPSP to which the request is issued. The unique id will be issued by OB. | 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 |
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 |
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 |
Content-Type | Standard HTTP Header; Represents the format of the payload being provided in the request. This must be set to application/json. | Mandatory | Do not use | Do not use |
Accept | Standard HTTP Header; Determine the Content-Type that is required from the Server. If set, it must have the value application/json. If set to any other value, ASPSP must respond with a 406 Not Acceptable. | Optional | Optional | Optional |
x-jws-signature | Header containing a detached JWS signature of the body of the payload. Mandatory for requests that contain a payload. A policy decision is under consideration on whether API requests and responses will be digitally signed to provide a simpler means of non-repudiation. This header will only be applicable if the policy decision is to implement non-repudiation through digital signatures. | TBC | TBC | TBC |
(Reference: Section 6.3 - Financial API — Part 1: Read Only API Security Profile (Implementer’s Draft).)
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 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 Content-type: application/json as a content header in response to requests that return a HTTP body (all post and get requests) | Conditionally Mandatory |
x-jws-signature | Header containing a detached JWS signature of the body of the payload. Mandatory for requests that contain a payload. A policy decision is under consideration on whether API requests and responses will be digitally signed to provide a simpler means of non-repudiation. This header will only be applicable if the policy decision is to implement non-repudiation through digital signatures. | TBC |
x-fapi-interaction-id | An RFC4122 UID used as a correlation id. This must be the same value provided in the x-fapi-interaction-id request header. Mandatory if provided in the request. | Conditionally Mandatory |
Return & Error Codes
The following are the HTTP response codes for the different HTTP methods - across all Account Info API endpoints.
Situation | HTTP Status | Notes | Returned by POST | Returned by GET | Returned by DELETE |
|---|---|---|---|---|---|
Query completed successfully | 200 OK |
| No | Yes | No |
Normal execution. The request has succeeded. | 201 Created | The operation results in the creation of a new resource. | Yes | No | No |
Delete operation completed successfully | 204 No Content |
| No | No | Yes |
Account Request has malformed, missing or non-compliant JSON body or URL parameters | 400 Bad Request | The requested operation will not be carried out. | Yes | No | No |
Authorization header missing or invalid token | 401 Unauthorized | The operation was refused access. | Yes | Yes | Yes |
Token invalid, has incorrect scope or a security policy was violated | 403 Forbidden | The operation was refused access. | Yes | Yes | Yes |
The operation was refused as too many requests have been made within a certain timeframe. | 429 Too Many Requests | Throttling is a NFR. | Yes | Yes | Yes |
Something went wrong on the API gateway or micro-service | 500 Internal Server Error | The operation failed. | Yes | Yes | Yes |
An ASPSP MAY return other standard HTTP status codes (e.g. from gateways and other edge devices) as described in RFC 7231 - Section 6.
400 (Bad Request) v/s 404 (Not Found)
When a TPP tries to request a resource URL with an resource Id that does not exist, the ASPSP must respond with a 400 (Bad Request) rather than a 404 (Not Found).
E.g., if a TPP tries to GET /accounts/22289 where 22289 is not a valid AccountId, the ASPSP must respond with a 400.
When a TPP tries to request a resource URL that results in no business data being returned (e.g. a request to retrieve standing order on an account that does not have standing orders) the ASPSP must respond with a 200 (OK) and set the array to be empty.
If the TPP tries to access a URL for a resource that is not defined by these specifications (e.g. GET /card-accounts), the ASPSP may choose to respond with a 404 (Not Found).
If an ASPSP has not implemented an optional API, it must respond with a 404 (Not Found) for requests to that URL.
The table below illustrates some examples of expected behaviour:
Situation | Request | Response |
|---|---|---|
TPP attempts to retrieve an account with an AccountId that does not exist | GET /accounts/1001 | 400 (Bad Request) |
TPP attempts to retrieve a resource that is not defined | GET /credit-cards | 404 (Not Found) |
TPP attempts to retrieve a resource that is in the specification, but not implemented by the ASPSP. E.g., an ASPSP has chosen not to implement the bulk direct-debit endpoint | GET /direct-debits | 404 (Not Found) |
TPP attempts to retrieve standing orders for an AccountId that does not exists | GET /accounts/1001/standing-orders | 400 (Bad Request) |
TPP attempts to retrieve standing orders for an AccountId that exists, but does not have any standing orders | GET /accounts/1000/standing-orders |
|
403 (Forbidden)
When a TPP tries to access a resource that it does not have permission to access, the ASPSP must return a 403 (Forbidden).
The situation could arise when:
The TPP uses an access token that is no longer valid
The TPP uses an access token that does not have the approporiate scope to access the requested resource.
The TPP does not have a consent authorisation for the AccountId
E.g., an attempt to access GET /accounts/2001 or /accounts/2001/transactions when the PSU has not selected AccountId 2001 for authorisation.The TPP does not have a consent authorisation with the right Persmissions to access the requested resource.
E.g., an attempt to access GET /standing-orders when the ReadStandingOrdersBasic permission was not included in the consent authorisation.The TPP attempted to access a resource with an Id that it does not have access to.
E.g., an attempt to access GET /account-requests/1001 where an account-request resource with Id 1001 belongs to another TPP.
429 (Too Many Requests)
When a TPP tries to access a resource too frequently the ASPSP may return a 429 (Too Many Requests). This is a Non Functional Requirement and is down to individual ASPSPs to decide throttling limits.
This situation could arise when:
The TPP has not implemented caching, it requests transactions for a PSU account, and constantly re-requests the same transactions
Similarly for any of the PSU information endpoints
Pre-Conditions
The following pre-conditions must be satisfied in order to use these APIs:
Pre-conditions for TPPs
The TPP must have completed onboarding on the Open Banking Directory
© Open Banking Limited 2019 | https://www.openbanking.org.uk/open-licence | https://www.openbanking.org.uk