swagger: '2.0' info: title: Account and Transaction API Specification description: Swagger for Account and Transaction API Specification termsOfService: 'https://www.openbanking.org.uk/terms' contact: name: Service Desk email: ServiceDesk@openbanking.org.uk license: name: open-licence url: 'https://www.openbanking.org.uk/open-licence' version: v3.1.0 basePath: /open-banking/v3.1/aisp schemes: - https consumes: - application/json; charset=utf-8 produces: - application/json; charset=utf-8 paths: /balances: get: tags: - Balances summary: Get Balances operationId: GetBalances parameters: - $ref: '#/parameters/x-fapi-financial-id-Param' - $ref: '#/parameters/x-fapi-customer-last-logged-time-Param' - $ref: '#/parameters/x-fapi-customer-ip-address-Param' - $ref: '#/parameters/x-fapi-interaction-id-Param' - $ref: '#/parameters/AuthorizationParam' - $ref: '#/parameters/x-customer-user-agent-Param' responses: '200': $ref: '#/responses/200BalancesRead' '400': $ref: '#/responses/400ErrorResponse' '401': $ref: '#/responses/401ErrorResponse' '403': $ref: '#/responses/403ErrorResponse' '404': $ref: '#/responses/404ErrorResponse' '405': $ref: '#/responses/405ErrorResponse' '406': $ref: '#/responses/406ErrorResponse' '429': $ref: '#/responses/429ErrorResponse' '500': $ref: '#/responses/500ErrorResponse' security: - PSUOAuth2Security: - accounts parameters: x-fapi-financial-id-Param: in: header name: x-fapi-financial-id type: string required: true description: >- The unique id of the ASPSP to which the request is issued. The unique id will be issued by OB. x-fapi-customer-ip-address-Param: in: header name: x-fapi-customer-ip-address type: string required: false description: The PSU's IP address if the PSU is currently logged in with the TPP. x-fapi-interaction-id-Param: in: header name: x-fapi-interaction-id type: string required: false description: An RFC4122 UID used as a correlation id. x-fapi-customer-last-logged-time-Param: in: header name: x-fapi-customer-last-logged-time type: string required: false description: >- The time when the PSU last logged in with the TPP. All dates in the HTTP headers are represented as RFC 7231 Full Dates. An example is below: Sun, 10 Sep 2017 19:43:31 UTC pattern: >- ^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), \d{2} (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \d{4} \d{2}:\d{2}:\d{2} (GMT|UTC)$ AuthorizationParam: in: header name: Authorization type: string required: true description: 'An Authorisation Token as per https://tools.ietf.org/html/rfc6750' x-customer-user-agent-Param: in: header name: x-customer-user-agent type: string description: Indicates the user-agent that the PSU is using. required: false responses: 200BalancesRead: description: Balances Read headers: x-fapi-interaction-id: type: string description: An RFC4122 UID used as a correlation id. schema: $ref: '#/definitions/OBReadBalance1' 400ErrorResponse: description: Bad request schema: $ref: '#/definitions/OBErrorResponse1' 401ErrorResponse: description: Unauthorized 403ErrorResponse: description: Forbidden 404ErrorResponse: description: Not found 405ErrorResponse: description: Method Not Allowed 406ErrorResponse: description: Not Acceptable 429ErrorResponse: description: Too Many Requests headers: Retry-After: description: Number in seconds to wait type: integer 500ErrorResponse: description: Internal Server Error schema: $ref: '#/definitions/OBErrorResponse1' securityDefinitions: PSUOAuth2Security: type: oauth2 flow: accessCode tokenUrl: 'https://authserver.example/token' authorizationUrl: 'https://authserver.example/authorization' scopes: accounts: Ability to read Accounts information description: >- OAuth flow, it is required when the PSU needs to perform SCA with the ASPSP when a TPP wants to access an ASPSP resource owned by the PSU definitions: OBReadBalance1: type: object properties: Data: type: object properties: Balance: items: $ref: '#/definitions/OBCashBalance1' type: array description: Set of elements used to define the balance details. minItems: 1 required: - Balance additionalProperties: false Links: $ref: '#/definitions/Links' Meta: $ref: '#/definitions/Meta' required: - Data - Links - Meta additionalProperties: false OBCashBalance1: description: Set of elements used to define the balance details. type: object properties: AccountId: $ref: '#/definitions/AccountId' CreditDebitIndicator: type: string enum: - Credit - Debit description: |- Indicates whether the balance is a credit or a debit balance. Usage: A zero balance is considered to be a credit balance. Type: $ref: '#/definitions/OBBalanceType1Code' DateTime: description: >- Indicates the date (and time) of the balance. All dates in the JSON payloads are represented in ISO 8601 date-time format. All date-time fields in responses must include the timezone. An example is below: 2017-04-05T10:43:07+00:00 type: string format: date-time Amount: $ref: '#/definitions/OBActiveOrHistoricCurrencyAndAmount' CreditLine: items: $ref: '#/definitions/OBCreditLine1' type: array description: Set of elements used to provide details on the credit line. required: - AccountId - CreditDebitIndicator - Type - DateTime - Amount additionalProperties: false minProperties: 1 AccountId: description: >- A unique and immutable identifier used to identify the account resource. This identifier has no meaning to the account owner. type: string minLength: 1 maxLength: 40 OBBalanceType1Code: description: 'Balance type, in a coded form.' type: string enum: - ClosingAvailable - ClosingBooked - ClosingCleared - Expected - ForwardAvailable - Information - InterimAvailable - InterimBooked - InterimCleared - OpeningAvailable - OpeningBooked - OpeningCleared - PreviouslyClosedBooked OBActiveOrHistoricCurrencyAndAmount: description: >- Amount of money of the cash balance after a transaction entry is applied to the account.. type: object properties: Amount: $ref: '#/definitions/OBActiveCurrencyAndAmount_SimpleType' Currency: description: >- 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". type: string pattern: '^[A-Z]{3,3}$' required: - Amount - Currency additionalProperties: false OBActiveCurrencyAndAmount_SimpleType: description: >- A number of monetary units specified in an active currency where the unit of currency is explicit and compliant with ISO 4217. type: string pattern: '^\d{1,13}\.\d{1,5}$' OBCreditLine1: description: Set of elements used to provide details on the credit line. type: object properties: Included: description: >- 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. type: boolean Type: $ref: '#/definitions/OBExternalLimitType1Code' Amount: $ref: '#/definitions/OBActiveOrHistoricCurrencyAndAmount' required: - Included additionalProperties: false OBExternalLimitType1Code: description: 'Limit type, in a coded form.' type: string enum: - Available - Credit - Emergency - Pre-Agreed - Temporary OBErrorResponse1: description: >- An array of detail error codes, and messages, and URLs to documentation to help remediation. type: object properties: Code: description: 'High level textual error code, to help categorize the errors.' type: string minLength: 1 maxLength: 40 Id: description: >- A unique reference for the error instance, for audit purposes, in case of unknown/unclassified errors. type: string minLength: 1 maxLength: 40 Message: description: >- Brief Error message, e.g., 'There is something wrong with the request parameters provided' type: string minLength: 1 maxLength: 500 Errors: items: $ref: '#/definitions/OBError1' type: array minItems: 1 required: - Code - Message - Errors additionalProperties: false OBError1: type: object properties: ErrorCode: description: 'Low level textual error code, e.g., UK.OBIE.Field.Missing' type: string minLength: 1 maxLength: 128 Message: description: >- A description of the error that occurred. e.g., 'A mandatory field isn't supplied' or 'RequestedExecutionDateTime must be in future' OBIE doesn't standardise this field type: string minLength: 1 maxLength: 500 Path: description: >- Recommended but optional reference to the JSON Path of the field with error, e.g., Data.Initiation.InstructedAmount.Currency type: string minLength: 1 maxLength: 500 Url: description: >- URL to help remediate the problem, or provide more information, or to API Reference, or help etc type: string required: - ErrorCode - Message additionalProperties: false minProperties: 1 ISODateTime: description: >- All dates in the JSON payloads are represented in ISO 8601 date-time format. All date-time fields in responses must include the timezone. An example is below: 2017-04-05T10:43:07+00:00 type: string format: date-time Links: type: object description: Links relevant to the payload properties: Self: type: string format: uri First: type: string format: uri Prev: type: string format: uri Next: type: string format: uri Last: type: string format: uri additionalProperties: false required: - Self Meta: title: MetaData type: object description: Meta Data relevant to the payload properties: TotalPages: type: integer format: int32 FirstAvailableDateTime: $ref: '#/definitions/ISODateTime' LastAvailableDateTime: $ref: '#/definitions/ISODateTime' additionalProperties: false