Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Expand
titleMENU
Table of Contents
minLevel1
maxLevel6
outlinefalse
stylenone
typelist
printabletrue

1. Specification

Awesome api app render macro
authHeaderName
linksColor#0052cc
showInfotrue
allowSpecUrlLoadfalse
primaryColor#0052CC
schemaStyletable
methodGetColor#0065FF
authHeaderValue
methodPutColor#6554c0
generalThemeconfluence_light
allowTryfalse
layoutHeight1000
allowAdvancedSearchfalse
codeBg#F4F5F7
methodHeadColor#ffab00
navHoverTextColor
showComponentsfalse
allowServerSelectiontrue
methodPatchColor#ffab00
textColor#172B4D
navBgColor#FAFBFC
codeFg#172B4D
navTextColor#172B4D
fontSizedefault
sortEndpointsBymethod
usePathInNavBartrue
navAccentColor#6554C0
methodDeleteColor#ff5630
allowAuthenticationfalse
headerColor#fff
bgColor#fff
allowSearchfalse
sortTagstrue
methodPostColor#36b37e
themelight
authTypeNone
inlineCodeFg#6554C0
resourceContentTypejson
showHeaderfalse
allowSpecFileLoadfalse
inlineCodeBg#F4F5F7
renderStyleread
layoutrow
headingText
navItemSpacingdefault
infoDescriptionHeadingsInNavbartrue
specUrl
navHoverBgColor
resourceTypeCONTENT
openapi: 3.0.1
servers:
  - url: https://{server}/v2024.07
    description: Ozone Connect - Data Sharing APIs
    variables:
      server:
        default: rs1.*
        description: The server that the API is hosted on.
info:
  title: Ozone Connect - Data Sharing APIs
  description: |
    This document provides the OAS3 specification for Data Sharing APIs for Ozone Connect.

    These APIs should be implemented by an LFI so that Ozone
    can expose these end-points to TPPs.


  version: Version 2.3 Release 2023.14.1
tags:
  - name: accounts
    description: |
      APIs that should be implemented by LFIs to expose `accounts` information to TPPs.

  - name: balances
    description: |
      APIs that should be implemented by LFIs to expose `balances` information to TPPs.

  - name: transactions
    description: |
      APIs that should be implemented by LFIs to expose `transactions` information to TPPs.

  - name: customer
    description: |
      APIs that should be implemented by LFIs to expose `customer` information to TPPs.

  - name: direct-debits
    description: |
      APIs that should be implemented by LFIs to expose `direct debit` information to TPPs.

  - name: scheduled-payments
    description: |
      APIs that should be implemented by LFIs to expose `scheduled payment` information to TPPs.

  - name: standing-orders
    description: |
      APIs that should be implemented by LFIs to expose `standing order` information to TPPs.

  - name: offers
    description: |
      APIs that should be implemented by LFIs to expose `offer` information to TPPs.

  - name: products
    description: |
      APIs that should be implemented by LFIs to expose `product` information to TPPs.

  - name: statement
    description: |
      APIs that should be implemented by LFIs to expose `statement` information to TPPs.

paths:
  /accounts:
    get:
      tags:
        - accounts
      summary: Fetch accounts
      description: |

        ###### ACC-010-010

        The API must return all the accounts specified by the `accountIds` query parameter.

        ###### ACC-010-140

        If one or more specified accountIds does not exist or cannot be retrieved the call should continue to return other accounts.

        ###### ACC-010-150

        If no accounts are found, the call must return a success status code `200` with an empty `data` array.

        ## Optionality
        At least one of `/accounts` or `/accounts/:accountId` must be implemented.

        If not implemented, Ozone will use the `/accounts/:accountId` end-point.
        However, that is not as performant an alternative and LFIs are encouraged to implement this end-point.

      operationId: findAccounts
      parameters:
        # common header parameters that set context
        - $ref: "#/components/parameters/aspspId"
        - $ref: "#/components/parameters/callerOrgId"
        - $ref: "#/components/parameters/callerClientId"
        - $ref: "#/components/parameters/callerSoftwareStatementId"
        - $ref: "#/components/parameters/apiUri"
        - $ref: "#/components/parameters/apiOperation"
        - $ref: "#/components/parameters/consentId"
        - $ref: "#/components/parameters/callerInteractionId"
        - $ref: "#/components/parameters/ozoneInteractionId"
        - $ref: "#/components/parameters/psuIdentifier"

        # query parameters
        - name: accountIds
          in: query
          description: Comma separated ids of the accounts to be returned
          schema:
            type: string
            minimum: 1
          required: true

      responses:
        200:
          description: successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AccountsResponse"
        400:
          description: |
            The operation __must__ be failed with a status of `400` under the following error conditions:

            - ###### ACC-010-020
              If the `accountsIds` query parameter is not supplied.

            - ###### ACC-010-040
              The `o3-psu-identifier` header parameter is not specified.

            - ###### ACC-010-050
              Both the `accountIds` query parameter and the `o3-psu-identifier` header parameter are not specified.

            - ###### ACC-010-030
              The `o3-aspsp-id` header is missing or has an unexpected value


            The operation __may__ be failed with a status of `400` under the following error conditions:

            - ###### ACC-010-070, ACC-010-080, ACC-010-090
              One or more of the mandatory header parameters is not specified or has an unexpected value
              - `o3-api-uri`,
              - `o3-api-operation`,
              - `o3-ozone-interaction-id`

          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"

        401:
          description: |
            The operation __must__ be failed with a status of `401` under the following error conditions:

            - ###### ACC-010-100
              The API consumer is not authorised.

          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
      security:
        - bearerAuth: []

  /accounts/{accountId}:
    get:
      tags:
        - accounts
      summary: Fetch the account specified by the account id

      description: |
        ###### ACC-020-010

        The API must return the account specified by the `accountId` path parameter.

        ## Optionality
        At least one of `/accounts` or `/accounts/:accountId` must be implemented.

      operationId: findByAccountId
      parameters:
        # common header parameters that set context
        - $ref: "#/components/parameters/aspspId"
        - $ref: "#/components/parameters/callerOrgId"
        - $ref: "#/components/parameters/callerClientId"
        - $ref: "#/components/parameters/callerSoftwareStatementId"
        - $ref: "#/components/parameters/apiUri"
        - $ref: "#/components/parameters/apiOperation"
        - $ref: "#/components/parameters/consentId"
        - $ref: "#/components/parameters/callerInteractionId"
        - $ref: "#/components/parameters/ozoneInteractionId"
        - $ref: "#/components/parameters/psuIdentifier"

        # Path param definitions
        - name: accountId
          in: path
          description: Id of the account to be queried
          required: true
          schema:
            type: string

      responses:
        200:
          description: successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AccountResponse"
        400:
          description: |
            The operation __must__ be failed with a status of `400` under the following error conditions:

            - ###### ACC-020-020
              The account corresponding to the `accountId` query parameter does not exist or is under a bar

            - ###### ACC-020-030
              The `o3-aspsp-id` header is missing or has an unexpected value

            The operation __should__ be failed with a status of `400` under the following error conditions:

            - ###### ACC-020-040
              The LFI should fail the call if the `o3-psu-identifier` header is not specified.

            - ###### ACC-020-050
              If both the `accountId` and `o3-psu-identifier` header are not specified.

            The operation __may__ be failed with a status of `400` under the following error conditions:

            - ###### ACC-020-070, ACC-020-080, ACC-020-090
              One or more of the mandatory header parameters is not specified or has an unexpected value
              - `o3-api-uri`,
              - `o3-api-operation`,
              - `o3-ozone-interaction-id`

          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"

        401:
          description: |
            The operation __must__ be failed with a status of `401` under the following error conditions:

            - ###### ACC-020-100
              The API consumer is not authorised.

          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"

      security:
        - bearerAuth: []

  /balances:
    get:
      tags:
        - balances
      summary: Fetch balances
      operationId: findBalancesByAccountIds
      description: |

        ###### BAL-010-010

        The API must return all the balances for accounts specified by the `accountIds` query parameter.

        ###### BAL-010-140

        If one or more specified accountIds does not exist or cannot be retrieved the call should continue to return balances of other accounts.

        ###### BAL-010-150

        If no accounts are found, the call must return a success status code `200` with an empty `data` array.

        ###### BAL-010-110

        If the `balanceType` is specified, the LFI must return the specified balance type only.

        ###### BAL-010-120
        If the `balanceType` is not specified, the LFI may return more than one balance record for each account. Each row would represent a balance of a different type.

        ## Optionality
        At least one of `/balances` or `/accounts/:accountId/balances` must be implemented.

        If not implemented, Ozone will use the `/accounts/:accountId/balances` end-point.

        However, that is not as performant an alternative and LFIs are encouraged to implement this end-point.

      parameters:
        # common header parameters that set context
        - $ref: "#/components/parameters/aspspId"
        - $ref: "#/components/parameters/callerOrgId"
        - $ref: "#/components/parameters/callerClientId"
        - $ref: "#/components/parameters/callerSoftwareStatementId"
        - $ref: "#/components/parameters/apiUri"
        - $ref: "#/components/parameters/apiOperation"
        - $ref: "#/components/parameters/consentId"
        - $ref: "#/components/parameters/callerInteractionId"
        - $ref: "#/components/parameters/ozoneInteractionId"
        - $ref: "#/components/parameters/psuIdentifier"

        # query parameters
        - name: accountIds
          in: query
          description: Comma separated ids of the accounts to be returned
          schema:
            type: string
            minimum: 1
          required: true

        - name: balanceType
          in: query
          description: Type of balance to be returned
          schema:
            type: string


      responses:
        200:
          description: successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BalancesResponse"
        400:
          description: |
            The operation __must__ be failed with a status of `400` under the following error conditions:

            - ###### BAL-010-020
              If the `accountsIds` query parameter is not supplied

            - ###### BAL-010-040
              The LFI should fail the call if the `o3-psu-identifier` header is not specified.

            - ###### BAL-010-050
              Both the `accountIds` query parameter and the `o3-psu-identifier` header parameter are not specified.

            - ###### BAL-010-030
              The `o3-aspsp-id` header is missing or has an unexpected value

            - ###### BAL-010-130
              The `balanceType` query parameter has an unexpected value or is not supported by the connector.

            The operation __may__ be failed with a status of `400` under the following error conditions:

            - ###### BAL-010-070, BAL-010-080, BAL-010-090
              One or more of the mandatory header parameters is not specified or has an unexpected value
              - `o3-api-uri`,
              - `o3-api-operation`,
              - `o3-ozone-interaction-id`

          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        401:
          description: |
            The operation __must__ be failed with a status of `401` under the following error conditions:

            - ###### BAL-010-100
              The API consumer is not authorised.

          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"

      security:
        - bearerAuth: []

  /accounts/{accountId}/balances:
    get:
      tags:
        - balances
      summary: Fetch the balances for the account specified by the account id.
      operationId: findBalancesByAccountId

      description: |
        ###### BAL-020-010

        Retrieves the balance for account specified by the `accountId` parameter.

        ###### BAL-020-110

        If the `balanceType` is specified, the LFI must return the specified balance type only.

        ###### BAL-020-120
        If the balanceType is not specified, the LFI may return more than one balance record for each account. Each row would represent a balance of a different type.

        ## Optionality
        At least one of `/balances` or `/accounts/:accountId/balances` must be implemented.

      parameters:
        # common header parameters that set context
        - $ref: "#/components/parameters/aspspId"
        - $ref: "#/components/parameters/callerOrgId"
        - $ref: "#/components/parameters/callerClientId"
        - $ref: "#/components/parameters/callerSoftwareStatementId"
        - $ref: "#/components/parameters/apiUri"
        - $ref: "#/components/parameters/apiOperation"
        - $ref: "#/components/parameters/consentId"
        - $ref: "#/components/parameters/callerInteractionId"
        - $ref: "#/components/parameters/ozoneInteractionId"
        - $ref: "#/components/parameters/psuIdentifier"

        # Path param definitions
        - name: accountId
          in: path
          description: Id of the account to be queried
          required: true
          schema:
            type: string

        - name: balanceType
          in: query
          description: Type of balance to be returned
          schema:
            type: string
      responses:
        200:
          description: successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BalancesResponse"
        400:
          description: |
            The operation __must__ be failed with a status of `400` under the following error conditions:

            - ###### BAL-020-020
              The balance for account corresponding to the `accountId` query parameter does not exist or is under a bar

            - ###### BAL-020-030
              The `o3-aspsp-id` header is missing or has an unexpected value

            - ###### BAL-020-130
              The `balanceType` query parameter has an unexpected value or is not supported by the connector.

            The operation __should__ be failed with a status of `400` under the following error conditions:

            - ###### BAL-020-040
              The LFI should fail the call if the `o3-psu-identifier` header is not specified.

            - ###### BAL-020-050
              Both the `accountId` query parameter and the `o3-psu-identifier` header parameter are not specified.

            The operation __may__ be failed with a status of `400` under the following error conditions:

            - ###### BAL-020-070, BAL-020-080, BAL-020-090
              One or more of the mandatory header parameters is not specified or has an unexpected value
              - `o3-api-uri`,
              - `o3-api-operation`,
              - `o3-ozone-interaction-id`
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"

        401:
          description: |
            The operation __must__ be failed with a status of `401` under the following error conditions:

            - ###### BAL-020-100
              The API consumer is not authorised.

          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"

      security:
        - bearerAuth: []

  /transactions:
    get:
      tags:
        - transactions
      summary: Fetch transactions
      description: |
        One of the `psuIdentifier` header parameter or `accountIds` query parameter would always be specified.

        The field `creditDebitIndicator` should contain "Credit" if it is incoming transaction / adding money to account, or "Debit" if it is outgoing transaction / paying someone.

        The term `creditor` refers to the one receiving the money. So, when the account holder is the one sending the money, the field `creditorAccount` needs to contain the information about the receiving side, and the field `creditorAgent` needs to contain the information about the financial institution that serves the creditor.

        The term `debtor` refers to the one sending the money. So, when the account holder is the one receiving the money, the field `debtorAccount` needs to contain the information about the sender, and the field `debtorAgent` needs to contain information about the financial institution that serves the debtor.

        For the field `balance`, “Credit” is 0 or positive balance and “Debit” is when customer has negative balance on their account. The `amount` in the `balance` field is always a positive value.

        `transactionInformation` should match up with the narration (description) seen on the direct channels and statements.

        Populate `bankTransactionCode` when using ISO codes in direct channels. Populate `proprietaryBankTransactionCode` when not using ISO codes in direct channels.

        `currencyExchange` section is used where Forex transactions are made off pre-negotiated treasury or forex contracts with "call off" rates. Usually only used with mid to high-end corporate accounts

        Most of those fields are optional, the bank would typically provide those they are included on the online transactions or statements.

        For e.g. CreditorAgent / PostalAddress is typically found on inward foreign remittances (on SWIFT messages)

        General rule of thumb: shouldn't have to compute data / find data from multiple systems because the information expected is what would "match" the direct channels. If there are situations where data is not readily available, chances are that that information is already stretching beyond regulatory needs.

        ###### TXN-010-010
        Retrieves all the transactions for the accounts specified.

        If `accountIds` is specified, transactions for the specified accounts.

        If only `psuIdentifier` is specified, return transactions for all the accounts for the PSU.

        ###### TXN-010-011
        Retrieves the transactions for the list of accounts specified, either as accountIds in the query params, or the psuIdentified in the header, starting from the specified valid `fromBookingDateTime` query parameter, until today.

        ###### TXN-010-012
        Retrieves the transactions for the account specified, starting from the begining, and ending at the specified valid `toBookingDateTime` query parameter.

        ###### TXN-010-013
        Retrieves the transactions for the account specified, starting from the the specified valid `fromBookingDateTime` query parameter, and ending at the specified valid `toBookingDateTime` query parameter.

        ###### TXN-010-020
        If one or more specified accountIds does not exist or cannot be retrieved, the call should continue to return transactions for other accounts.

        ## Optionality
        At least one of `/transactions` or `/accounts/:accountId/transactions` must be implemented.

        ## Optionality
        At least one of `/transactions` or `/accounts/:accountId/transactions` must be implemented.

        If not implemented, Ozone will use the `/accounts/:accountId/transactions` end-point.

        However, that is not as performant an alternative and LFIs are encouraged to implement this end-point.

      operationId: findTransactions
      parameters:
        # common header parameters that set context
        - $ref: "#/components/parameters/aspspId"
        - $ref: "#/components/parameters/callerOrgId"
        - $ref: "#/components/parameters/callerClientId"
        - $ref: "#/components/parameters/callerSoftwareStatementId"
        - $ref: "#/components/parameters/apiUri"
        - $ref: "#/components/parameters/apiOperation"
        - $ref: "#/components/parameters/consentId"
        - $ref: "#/components/parameters/callerInteractionId"
        - $ref: "#/components/parameters/ozoneInteractionId"
        - $ref: "#/components/parameters/psuIdentifier"
        - $ref: "#/components/parameters/pagination-page"

        # query parameters
        - name: accountIds
          in: query
          description: Comma separated ids of the accounts to be returned
          schema:
            type: string
            minimum: 1
          required: true

        - $ref: "#/components/parameters/transaction-status"
        - $ref: "#/components/parameters/transaction-fromBookingDateTime"
        - $ref: "#/components/parameters/transaction-toBookingDateTime"
        - $ref: "#/components/parameters/transaction-creditDebitIndicator"

      responses:
        200:
          description: successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TransactionsResponse"
        400:
          description: |
            The operation __must__ be failed with a status of `400` under the following error conditions:

            - ###### TXN-010-020
              If one or more specified accountIds does not exist or cannot be retrieved, the call should continue to return transactions for other accounts.

            - ###### TXN-010-040
              If the `o3-psu-identifier` header parameter is not specified.

            - ###### TXN-010-050
              Both the `accountIds` query parameter and the `o3-psu-identifier` header parameter are not specified.

            - ###### TXN-010-030
              The `o3-aspsp-id` header is missing or has an unexpected value

            - ###### TXN-010-170
              The `fromBookingDateTime` is not in ISO Date format

            - ###### TXN-010-180
              The `toBookingDateTime` is not in ISO Date format

            The operation __may__ be failed with a status of `400` under the following error conditions:

            - ###### TXN-010-070, TXN-010-080, TXN-010-090
              One or more of the mandatory header parameters is not specified or has an unexpected value
              - `o3-api-uri`,
              - `o3-api-operation`,
              - `o3-ozone-interaction-id`

          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        401:
          description: |
            The operation __must__ be failed with a status of `401` under the following error conditions:

            - ###### TXN-010-100
              The API consumer is not authorised.

          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
      security:
        - bearerAuth: []

  /accounts/{accountId}/transactions:
    get:
      tags:
        - transactions
      summary: Fetch transactions for the account specified by the accountId
      description: |
        For details on the data to be returned in the response, refer to the `/transactions` endpoint documentation above.

        ###### TXN-020-010
        Retrieves all the transactions for the account specified by the `accountId` in the URL.

        ###### TXN-020-011
        Retrieves the transactions for the account specified, starting from the specified valid `fromBookingDateTime` query parameter, until today.

        ###### TXN-020-012
        Retrieves the transactions for the account specified, starting from the begining, and ending at the specified valid `toBookingDateTime` query parameter.

        ###### TXN-020-013
        Retrieves the transactions for the account specified, starting from the the specified valid `fromBookingDateTime` query parameter, and ending at the specified valid `toBookingDateTime` query parameter.

        ###### TXN-020-020
        If the account does not exist or is under a bar, then the LFI should return an error with status 400.

        ## Optionality
        At least one of `/transactions` or `/accounts/:accountId/transactions` must be implemented.

      operationId: findTransactionsByAccountId
      parameters:
        # common header parameters that set context
        - $ref: "#/components/parameters/aspspId"
        - $ref: "#/components/parameters/callerOrgId"
        - $ref: "#/components/parameters/callerClientId"
        - $ref: "#/components/parameters/callerSoftwareStatementId"
        - $ref: "#/components/parameters/apiUri"
        - $ref: "#/components/parameters/apiOperation"
        - $ref: "#/components/parameters/consentId"
        - $ref: "#/components/parameters/callerInteractionId"
        - $ref: "#/components/parameters/ozoneInteractionId"
        - $ref: "#/components/parameters/psuIdentifier"
        - $ref: "#/components/parameters/pagination-page"


        # Path param definitions
        - name: accountId
          in: path
          description: Id of the account to be queried
          required: true
          schema:
            type: string
          example: abc-123

        - $ref: "#/components/parameters/transaction-status"
        - $ref: "#/components/parameters/transaction-fromBookingDateTime"
        - $ref: "#/components/parameters/transaction-toBookingDateTime"
        - $ref: "#/components/parameters/transaction-creditDebitIndicator"

      responses:
        200:
          description: successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TransactionsResponse"
        400:
          description: |
            The operation __must__ be failed with a status of `400` under the following error conditions:

            - ###### TXN-020-020
              If the account does not exist or is under a bar, then the LFI should return an error with status 400.

            - ###### TXN-020-040
              If the `o3-psu-identifier` header parameter is not specified.

            - ###### TXN-020-030
              The `o3-aspsp-id` header is missing or has an unexpected value

            - ###### TXN-020-050
              Both the `accountId` query parameter and the `o3-psu-identifier` header parameter are not specified.

            - ###### TXN-020-170
              The `fromBookingDateTime` is not in ISO Date format

            - ###### TXN-020-180
              The `toBookingDateTime` is not in ISO Date format

            The operation __may__ be failed with a status of `400` under the following error conditions:

            - ###### TXN-020-070, TXN-020-080, TXN-020-090
              One or more of the mandatory header parameters is not specified or has an unexpected value
              - `o3-api-uri`,
              - `o3-api-operation`,
              - `o3-ozone-interaction-id`

          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        401:
          description: |
            The operation __must__ be failed with a status of `401` under the following error conditions:

            - ###### TXN-020-100
              The API consumer is not authorised.

      security:
        - bearerAuth: []

  /accounts/{accountId}/transactions/{transactionId}:
    get:
      tags:
        - transactions
      summary: Fetch transaction for the account specified by the accountId and transactionId
      description: |
        For details on the data to be returned in the response, refer to the `/transactions` endpoint documentation above.

        ###### TXN-020-010
        Retrieves  the transaction for the account specified by the `accountId` and `transactionId` in the URL.

        ###### TXN-020-011
        Retrieves the transaction for the account specified, starting from the specified valid `fromBookingDateTime` query parameter, until today.

        ###### TXN-020-012
        Retrieves the transaction for the account specified, starting from the begining, and ending at the specified valid `toBookingDateTime` query parameter.

        ###### TXN-020-013
        Retrieves the transactions for the account specified, starting from the the specified valid `fromBookingDateTime` query parameter, and ending at the specified valid `toBookingDateTime` query parameter.

        ###### TXN-020-020
        If the account does not exist or is under a bar, then the LFI should return an error with status 400.

        ## Optionality
        At least one of `/transactions` or `/accounts/:accountId/transactions` must be implemented.

      operationId: findTransactionsByAccountIdAndTransactionId
      parameters:
        # common header parameters that set context
        - $ref: "#/components/parameters/aspspId"
        - $ref: "#/components/parameters/callerOrgId"
        - $ref: "#/components/parameters/callerClientId"
        - $ref: "#/components/parameters/callerSoftwareStatementId"
        - $ref: "#/components/parameters/apiUri"
        - $ref: "#/components/parameters/apiOperation"
        - $ref: "#/components/parameters/consentId"
        - $ref: "#/components/parameters/callerInteractionId"
        - $ref: "#/components/parameters/ozoneInteractionId"
        - $ref: "#/components/parameters/psuIdentifier"
        - $ref: "#/components/parameters/pagination-page"

        # Path param definitions
        - name: accountId
          in: path
          description: Id of the account to be queried
          required: true
          schema:
            type: string
          example: abc-123

        - name: transactionId
          in: path
          description: Id of the account to be queried
          required: true
          schema:
            type: string
          example: abc-123
        - $ref: "#/components/parameters/transaction-status"
        - $ref: "#/components/parameters/transaction-fromBookingDateTime"
        - $ref: "#/components/parameters/transaction-toBookingDateTime"
        - $ref: "#/components/parameters/transaction-creditDebitIndicator"

      responses:
        200:
          description: successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TransactionResponse"
        400:
          description: |
            The operation __must__ be failed with a status of `400` under the following error conditions:

            - ###### TXN-020-020
              If the account does not exist or is under a bar, then the LFI should return an error with status 400.

            - ###### TXN-020-040
              If the `o3-psu-identifier` header parameter is not specified.

            - ###### TXN-020-030
              The `o3-aspsp-id` header is missing or has an unexpected value

            - ###### TXN-020-050
              Both the `accountId` query parameter and the `o3-psu-identifier` header parameter are not specified.

            - ###### TXN-020-170
              The `fromBookingDateTime` is not in ISO Date format

            - ###### TXN-020-180
              The `toBookingDateTime` is not in ISO Date format

            The operation __may__ be failed with a status of `400` under the following error conditions:

            - ###### TXN-020-070, TXN-020-080, TXN-020-090
              One or more of the mandatory header parameters is not specified or has an unexpected value
              - `o3-api-uri`,
              - `o3-api-operation`,
              - `o3-ozone-interaction-id`

          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        401:
          description: |
            The operation __must__ be failed with a status of `401` under the following error conditions:

            - ###### TXN-020-100
              The API consumer is not authorised.

      security:
        - bearerAuth: []

  /accounts/{accountId}/statements/{statementId}/transactions:
    get:
      tags:
        - transactions
      summary: "Get Transactions for given statement id"
      operationId: "FindTransactionsByAccountsAccountIdStatementsStatementId"
      parameters:
        - $ref: "#/components/parameters/aspspId"
        - $ref: "#/components/parameters/callerOrgId"
        - $ref: "#/components/parameters/callerClientId"
        - $ref: "#/components/parameters/callerSoftwareStatementId"
        - $ref: "#/components/parameters/apiUri"
        - $ref: "#/components/parameters/apiOperation"
        - $ref: "#/components/parameters/consentId"
        - $ref: "#/components/parameters/callerInteractionId"
        - $ref: "#/components/parameters/ozoneInteractionId"
        - $ref: "#/components/parameters/psuIdentifier"

        # Path param definitions
        - name: accountId
          in: path
          description: accountId of the statement to be queried
          required: true
          schema:
            type: string

        - name: statementId
          in: path
          description: statementId of the statement to be queried
          required: true
          schema:
            type: string
      responses:
        200:
          description: successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TransactionByStatementId"
        400:
          description: |
            The operation __must__ be failed with a status of `400` under the following error conditions:

            - ###### TXN-020-020
              If the account does not exist or is under a bar, then the LFI should return an error with status 400.

            - ###### TXN-020-040
              If the `o3-psu-identifier` header parameter is not specified.

            - ###### TXN-020-030
              The `o3-aspsp-id` header is missing or has an unexpected value

            - ###### TXN-020-050
              Both the `accountId` query parameter and the `o3-psu-identifier` header parameter are not specified.

            The operation __may__ be failed with a status of `400` under the following error conditions:

            - ###### TXN-020-070, TXN-020-080, TXN-020-090
              One or more of the mandatory header parameters is not specified or has an unexpected value
              - `o3-api-uri`,
              - `o3-api-operation`,
              - `o3-ozone-interaction-id`

          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        401:
          description: |
            The operation __must__ be failed with a status of `401` under the following error conditions:

            - ###### TXN-020-100
              The API consumer is not authorised.
      security:
        - bearerAuth: []

  /direct-debits:
    get:
      tags:
        - direct-debits
      summary: Fetch direct debits
      description: |

        ###### DBT-010-010

        The API must return all the direct debits specified by the `accountIds` query parameter.

        ###### DBT-010-020

        If the `accountsIds` query parameter is not specified.

        ###### DBT-010-140

        If one or more specified accountIds does not exist or cannot be retrieved the call should continue to return other accounts.

        ###### DBT-010-150

        If no accounts are found, the call must return a success status code `200` with an empty `data` array.

        ## Optionality
        At least one of `/direct-debits` or `/accounts/:accountId/direct-debits` must be implemented.

        If not implemented, Ozone will use the `/accounts/:accountId/direct-debits` end-point.
        However, that is not as performant an alternative and LFIs are encouraged to implement this end-point.

      operationId: findDirectDebits
      parameters:
        # common header parameters that set context
        - $ref: "#/components/parameters/aspspId"
        - $ref: "#/components/parameters/callerOrgId"
        - $ref: "#/components/parameters/callerClientId"
        - $ref: "#/components/parameters/callerSoftwareStatementId"
        - $ref: "#/components/parameters/apiUri"
        - $ref: "#/components/parameters/apiOperation"
        - $ref: "#/components/parameters/consentId"
        - $ref: "#/components/parameters/callerInteractionId"
        - $ref: "#/components/parameters/ozoneInteractionId"
        - $ref: "#/components/parameters/psuIdentifier"

        # query parameters
        - name: accountIds
          in: query
          description: Comma separated ids of the accounts to be returned
          schema:
            type: string
            minimum: 1
          required: true


      responses:
        200:
          description: successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DirectDebitsResponse"
        400:
          description: |
            The operation __must__ be failed with a status of `400` under the following error conditions:

            - ###### DBT-010-020
              If the `accountsIds` query parameter is not specified.

            - ###### DBT-010-040
              If the `o3-psu-identifier` header parameter is not specified.

            - ###### DBT-010-050
              Both the `accountIds` query parameter and the `o3-psu-identifier` header parameter are not specified.

            - ###### DBT-010-030
              The `o3-aspsp-id` header is missing or has an unexpected value


            The operation __may__ be failed with a status of `400` under the following error conditions:

            - ###### DBT-010-070, DBT-010-080, DBT-010-090
              One or more of the mandatory header parameters is not specified or has an unexpected value
              - `o3-api-uri`,
              - `o3-api-operation`,
              - `o3-ozone-interaction-id`

          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"

        401:
          description: |
            The operation __must__ be failed with a status of `401` under the following error conditions:

            - ###### DBT-010-100
              The API consumer is not authorised.

          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
      security:
        - bearerAuth: []

  /accounts/{accountId}/direct-debits:
    get:
      tags:
        - direct-debits
      summary: Fetch the direct debits specified by the account id

      description: |
        ###### DBT-020-010

        Retrieves the direct debits specified by the `accountId` parameter.

        ## Optionality
        At least one of `/direct-debits` or `/accounts/:accountId/direct-debits` must be implemented.

      operationId: findDirectDebitByAccountId
      parameters:
        # common header parameters that set context
        - $ref: "#/components/parameters/aspspId"
        - $ref: "#/components/parameters/callerOrgId"
        - $ref: "#/components/parameters/callerClientId"
        - $ref: "#/components/parameters/callerSoftwareStatementId"
        - $ref: "#/components/parameters/apiUri"
        - $ref: "#/components/parameters/apiOperation"
        - $ref: "#/components/parameters/consentId"
        - $ref: "#/components/parameters/callerInteractionId"
        - $ref: "#/components/parameters/ozoneInteractionId"
        - $ref: "#/components/parameters/psuIdentifier"

        # Path param definitions
        - name: accountId
          in: path
          description: Id of the account to be queried
          required: true
          schema:
            type: string

      responses:
        200:
          description: successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DirectDebitsResponse"
        400:
          description: |
            The operation __must__ be failed with a status of `400` under the following error conditions:

            - ###### DBT-020-020
              The account corresponding to the `accountId` query parameter does not exist or is under a bar

            - ###### DBT-020-030
              The `o3-aspsp-id` header is missing or has an unexpected value

            The operation __should__ be failed with a status of `400` under the following error conditions:

            - ###### DBT-020-040
              The LFI should fail the call if the `o3-psu-identifier` header is not specified.

            - ###### DBT-020-050
              Both the `accountId` query parameter and the `o3-psu-identifier` header parameter are not specified.

            The operation __may__ be failed with a status of `400` under the following error conditions:

            - ###### DBT-020-070, DBT-020-080, DBT-020-090
              One or more of the mandatory header parameters is not specified or has an unexpected value
              - `o3-api-uri`,
              - `o3-api-operation`,
              - `o3-ozone-interaction-id`

          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"

        401:
          description: |
            The operation __must__ be failed with a status of `401` under the following error conditions:

            - ###### DBT-020-100
              The API consumer is not authorised.

          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"

      security:
        - bearerAuth: []

  /scheduled-payments:
    get:
      tags:
        - scheduled-payments
      summary: Fetch scheduled payments
      description: |

        ###### FDP-010-010

        The API must return all the scheduled payments specified by the `accountIds` query parameter.

        ###### FDP-010-020

        If the `accountsIds` query parameter is not specified.

        ###### FDP-010-050

        Both the `accountsIds` and `o3-psu-identifier` are not specified.

        ###### FDP-010-140

        If one or more specified accountIds does not exist or cannot be retrieved the call should continue to return other accounts.

        ###### FDP-010-150

        If no accounts are found, the call must return a success status code `200` with an empty `data` array.

        ## Optionality
        At least one of `/scheduled-payments` or `/accounts/:accountId/scheduled-payments` must be implemented.

        If not implemented, Ozone will use the `/accounts/:accountId/scheduled-payments` end-point.
        However, that is not as performant an alternative and LFIs are encouraged to implement this end-point.

      operationId: findScheduledPayments
      parameters:
        # common header parameters that set context
        - $ref: "#/components/parameters/aspspId"
        - $ref: "#/components/parameters/callerOrgId"
        - $ref: "#/components/parameters/callerClientId"
        - $ref: "#/components/parameters/callerSoftwareStatementId"
        - $ref: "#/components/parameters/apiUri"
        - $ref: "#/components/parameters/apiOperation"
        - $ref: "#/components/parameters/consentId"
        - $ref: "#/components/parameters/callerInteractionId"
        - $ref: "#/components/parameters/ozoneInteractionId"
        - $ref: "#/components/parameters/psuIdentifier"

        # query parameters
        - name: accountIds
          in: query
          description: Comma separated ids of the accounts to be returned
          schema:
            type: string
            minimum: 1
          required: true


      responses:
        200:
          description: successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ScheduledPaymentsResponse"
        400:
          description: |
            The operation __must__ be failed with a status of `400` under the following error conditions:

            - ###### FDP-010-020
              If the `accountsIds` query parameter is not specified.

            - ###### FDP-010-040
              If the `o3-psu-identifier` header is not specified.

            - ###### FDP-010-050
              Both the `accountIds` query parameter and the `o3-psu-identifier` header parameter are not specified.

            - ###### FDP-010-030
              The `o3-aspsp-id` header is missing or has an unexpected value


            The operation __may__ be failed with a status of `400` under the following error conditions:

            - ###### FDP-010-070, FDP-010-080, FDP-010-090
              One or more of the mandatory header parameters is not specified or has an unexpected value
              - `o3-api-uri`,
              - `o3-api-operation`,
              - `o3-ozone-interaction-id`

          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"

        401:
          description: |
            The operation __must__ be failed with a status of `401` under the following error conditions:

            - ###### FDP-010-100
              The API consumer is not authorised.

          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
      security:
        - bearerAuth: []

  /accounts/{accountId}/scheduled-payments:
    get:
      tags:
        - scheduled-payments
      summary: Fetch the scheduled payments specified by the account id

      description: |
        ###### FDP-020-010

        Retrieves the scheduled payments  specified by the `accountId` parameter.

        ## Optionality
        At least one of `/scheduled-payments` or `/accounts/:accountId/scheduled-payments` must be implemented.

      operationId: findScheduledPaymentByAccountId
      parameters:
        # common header parameters that set context
        - $ref: "#/components/parameters/aspspId"
        - $ref: "#/components/parameters/callerOrgId"
        - $ref: "#/components/parameters/callerClientId"
        - $ref: "#/components/parameters/callerSoftwareStatementId"
        - $ref: "#/components/parameters/apiUri"
        - $ref: "#/components/parameters/apiOperation"
        - $ref: "#/components/parameters/consentId"
        - $ref: "#/components/parameters/callerInteractionId"
        - $ref: "#/components/parameters/ozoneInteractionId"
        - $ref: "#/components/parameters/psuIdentifier"

        # Path param definitions
        - name: accountId
          in: path
          description: Id of the account to be queried
          required: true
          schema:
            type: string

      responses:
        200:
          description: successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ScheduledPaymentsResponse"
        400:
          description: |
            The operation __must__ be failed with a status of `400` under the following error conditions:

            - ###### FDP-020-020
              The account corresponding to the `accountId` query parameter does not exist or is under a bar

            - ###### FDP-020-030
              The `o3-aspsp-id` header is missing or has an unexpected value

            The operation __should__ be failed with a status of `400` under the following error conditions:

            - ###### FDP-020-040
              The LFI should fail the call if the `o3-psu-identifier` header is not specified.

            - ###### FDP-020-050
              Both the `accountId` query parameter and the `o3-psu-identifier` header parameter are not specified.

            The operation __may__ be failed with a status of `400` under the following error conditions:

            - ###### FDP-020-070, FDP-020-080, FDP-020-090
              One or more of the mandatory header parameters is not specified or has an unexpected value
              - `o3-api-uri`,
              - `o3-api-operation`,
              - `o3-ozone-interaction-id`

          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"

        401:
          description: |
            The operation __must__ be failed with a status of `401` under the following error conditions:

            - ###### FDP-020-100
              The API consumer is not authorised.

          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"

      security:
        - bearerAuth: []

  /standing-orders:
    get:
      tags:
        - standing-orders
      summary: Fetch standing orders
      description: |

        ###### STO-010-010

        The API must return all the standing orders specified by the `:accountIds` query parameter.

        ###### STO-010-020

        If the `accountsIds` query parameter is not specified, the API must return all the standing orders for
        the PSU identified by the `o3-psu-identifier` header.

        ###### STO-010-030

        If one or more specified accountIds does not exist or cannot be retrieved the call should continue to return other accounts.

        ###### STO-010-040

        If no accounts are found, the call must return a success status code `200` with an empty `data` array.

        ## Optionality
        At least one of `/standing-orders` or `/accounts/:accountId/standing-orders` must be implemented.

        If not implemented, Ozone will use the `/accounts/:accountId/standing-orders` end-point.
        However, that is not as performant an alternative and LFIs are encouraged to implement this end-point.

      operationId: findStandingOrders
      parameters:
        # common header parameters that set context
        - $ref: "#/components/parameters/aspspId"
        - $ref: "#/components/parameters/callerOrgId"
        - $ref: "#/components/parameters/callerClientId"
        - $ref: "#/components/parameters/callerSoftwareStatementId"
        - $ref: "#/components/parameters/apiUri"
        - $ref: "#/components/parameters/apiOperation"
        - $ref: "#/components/parameters/consentId"
        - $ref: "#/components/parameters/callerInteractionId"
        - $ref: "#/components/parameters/ozoneInteractionId"
        - $ref: "#/components/parameters/psuIdentifier"

        # query parameters
        - name: accountIds
          in: query
          description: Comma separated ids of the accounts to be returned
          schema:
            type: string
            minimum: 1
          required: true

      responses:
        200:
          description: successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/StandingOrdersResponse"
        400:
          description: |
            The operation __must__ be failed with a status of `400` under the following error conditions:

            - ###### STO-010-020
              If the `accountsIds` query parameter is not specified.

            - ###### STO-010-040
              If the `o3-psu-identifier` header is not specified.

            - ###### STO-010-050
              Both the `accountIds` query parameter and the `o3-psu-identifier` header parameter are not specified.

            - ###### STO-010-030
              The `o3-aspsp-id` header is missing or has an unexpected value


            The operation __may__ be failed with a status of `400` under the following error conditions:

            - ###### STO-010-070, STO-010-080, STO-010-090
              One or more of the mandatory header parameters is not specified or has an unexpected value
              - `o3-api-uri`,
              - `o3-api-operation`,
              - `o3-ozone-interaction-id`

          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"

        401:
          description: |
            The operation __must__ be failed with a status of `401` under the following error conditions:

            - ###### STO-010-100
              The API consumer is not authorised.

          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
      security:
        - bearerAuth: []

  /accounts/{accountId}/standing-orders:
    get:
      tags:
        - standing-orders
      summary: Fetch the standing orders specified by the account id

      description: |
        ###### STO-020-010

        Retrieves the standing orders specified by the `accountId` parameter.

        ## Optionality
        At least one of `/standing-orders` or `/accounts/:accountId/standing-orders` must be implemented.

      operationId: findStandingOrderByAccountId
      parameters:
        # common header parameters that set context
        - $ref: "#/components/parameters/aspspId"
        - $ref: "#/components/parameters/callerOrgId"
        - $ref: "#/components/parameters/callerClientId"
        - $ref: "#/components/parameters/callerSoftwareStatementId"
        - $ref: "#/components/parameters/apiUri"
        - $ref: "#/components/parameters/apiOperation"
        - $ref: "#/components/parameters/consentId"
        - $ref: "#/components/parameters/callerInteractionId"
        - $ref: "#/components/parameters/ozoneInteractionId"
        - $ref: "#/components/parameters/psuIdentifier"

        # Path param definitions
        - name: accountId
          in: path
          description: Id of the account to be queried
          required: true
          schema:
            type: string
      responses:
        200:
          description: successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/StandingOrdersResponse"
        400:
          description: |
            The operation __must__ be failed with a status of `400` under the following error conditions:

            - ###### STO-020-020
              The account corresponding to the `accountId` query parameter does not exist or is under a bar

            - ###### STO-020-030
              The `o3-aspsp-id` header is missing or has an unexpected value

            The operation __should__ be failed with a status of `400` under the following error conditions:

            - ###### STO-020-040
              The LFI should fail the call if the `o3-psu-identifier` header is not specified.

            - ###### STO-020-050
              The LFI should fail the call if the `accountId` does not refer to an account that
              is accessible by a the PSU identified by the `o3-psu-identifier` header.

            The operation __may__ be failed with a status of `400` under the following error conditions:

            - ###### STO-020-060, STO-020-070, STO-020-080
              One or more of the mandatory header parameters is not specified or has an unexpected value
              - `o3-api-uri`,
              - `o3-api-operation`,
              - `o3-ozone-interaction-id`

          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"

        401:
          description: |
            The operation __must__ be failed with a status of `401` under the following error conditions:

            - ###### STO-020-090
              The API consumer is not authorised.

          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"

      security:
        - bearerAuth: []

  /customer:
    get:
      tags:
        - customer
      summary: Fetch customer
      description: |

        ###### CUS-010-040

        The API must return the customer for the PSU identified by the `o3-psu-identifier` header.

        ###### CUS-010-190

        If no customer is found, the call must return a success status code `200` with an empty `data` object.

        ## Optionality

      operationId: findCustomer
      parameters:
        # common header parameters that set context
        - $ref: "#/components/parameters/aspspId"
        - $ref: "#/components/parameters/callerOrgId"
        - $ref: "#/components/parameters/callerClientId"
        - $ref: "#/components/parameters/callerSoftwareStatementId"
        - $ref: "#/components/parameters/apiUri"
        - $ref: "#/components/parameters/apiOperation"
        - $ref: "#/components/parameters/consentId"
        - $ref: "#/components/parameters/callerInteractionId"
        - $ref: "#/components/parameters/ozoneInteractionId"
        - name: o3-psu-identifier
          in: header
          schema:
            type: string
          required: true
          description: A Base64 encoded representation of the psuIdentifier JSON object.

      responses:
        200:
          description: successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CustomerResponse"
        400:
          description: |
            The operation __must__ be failed with a status of `400` under the following error conditions:

            - ###### CUS-010-040
              The `o3-psu-identifier` header parameter are not specified.

            - ###### CUS-010-030
              The `o3-aspsp-id` header is missing or has an unexpected value


            The operation __may__ be failed with a status of `400` under the following error conditions:

            - ###### CUS-010-070, CUS-010-080, CUS-010-090
              One or more of the mandatory header parameters is not specified or has an unexpected value
              - `o3-api-uri`,
              - `o3-api-operation`,
              - `o3-ozone-interaction-id`

          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"

        401:
          description: |
            The operation __must__ be failed with a status of `401` under the following error conditions:

            - ###### CUS-010-100
              The API consumer is not authorised.

          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
      security:
        - bearerAuth: []

  /accounts/{accountId}/customer:
    get:
      tags:
        - customer
      summary: Fetch the customers specified by the account id
      description: |

        ###### CUS-020-040

        The API must return the customer for the PSU identified by the `o3-psu-identifier` header.

        ###### CUS-020-190

        If no customer is found, the call must return a success status code `200` with an empty `data` object.

        ## Optionality

      operationId: findCustomerByAccountId
      parameters:
        # common header parameters that set context
        - $ref: "#/components/parameters/aspspId"
        - $ref: "#/components/parameters/callerOrgId"
        - $ref: "#/components/parameters/callerClientId"
        - $ref: "#/components/parameters/callerSoftwareStatementId"
        - $ref: "#/components/parameters/apiUri"
        - $ref: "#/components/parameters/apiOperation"
        - $ref: "#/components/parameters/consentId"
        - $ref: "#/components/parameters/callerInteractionId"
        - $ref: "#/components/parameters/ozoneInteractionId"
        - name: o3-psu-identifier
          in: header
          schema:
            type: string
          required: true
          description: A Base64 encoded representation of the psuIdentifier JSON object.

        # Path param definitions
        - name: accountId
          in: path
          description: Id of the account to be queried
          required: true
          schema:
            type: string
          example: abc-123

      responses:
        200:
          description: successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CustomersResponse"
        400:
          description: |
            The operation __must__ be failed with a status of `400` under the following error conditions:

            - ###### CUS-020-040
              The `o3-psu-identifier` header parameter are not specified.

            - ###### CUS-020-030
              The `o3-aspsp-id` header is missing or has an unexpected value


            The operation __may__ be failed with a status of `400` under the following error conditions:

            - ###### CUS-020-070, CUS-020-080, CUS-020-090
              One or more of the mandatory header parameters is not specified or has an unexpected value
              - `o3-api-uri`,
              - `o3-api-operation`,
              - `o3-ozone-interaction-id`

          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"

        401:
          description: |
            The operation __must__ be failed with a status of `401` under the following error conditions:

            - ###### CUS-020-100
              The API consumer is not authorised.

          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
      security:
        - bearerAuth: []

  /offers:
    get:
      tags:
        - offers
      summary: Fetch offers
      operationId: findOffers
      description: |
        ###### OFF-010-010

        The API must return all the offers for accounts consented to by the psu - identifed by the `o3-psu-identifier` header.

        ###### OFF-010-020
        If the PSU identifed by `o3-psu-identifier` header exists but has no offers, the call must return a success status code 200 with an empty data array.

        ###### OFF-010-030

        If the PSU identified by `o3-psu-identifier` header does not exist, the call must return a success status code 200 with an empty data array.

      parameters:
        # common header parameters that set context
        - $ref: "#/components/parameters/aspspId"
        - $ref: "#/components/parameters/callerOrgId"
        - $ref: "#/components/parameters/callerClientId"
        - $ref: "#/components/parameters/callerSoftwareStatementId"
        - $ref: "#/components/parameters/apiUri"
        - $ref: "#/components/parameters/apiOperation"
        - $ref: "#/components/parameters/consentId"
        - $ref: "#/components/parameters/callerInteractionId"
        - $ref: "#/components/parameters/ozoneInteractionId"
        - name: o3-psu-identifier
          in: header
          schema:
            type: string
          required: true
          description: A Base64 encoded representation of the psuIdentifier JSON object.

        # query parameters
        - name: accountIds
          in: query
          description: Comma separated ids of the accounts to be returned
          schema:
            type: string
            minimum: 1

      responses:
        200:
          description: successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/OffersResponse"
        400:
          description: |
            The operation __must__ be failed with a status of `400` under the following error conditions:

            ###### OFF-010-040

            The `o3-psu-identifier` header parameter is not specified.

            ###### OFF-010-030

            The `o3-aspsp-id` header is missing or has an unexpected value

            ###### OFF-010-060
            The o3-api-uri header is missing or has an unexpected value

            The operation __may__ be failed with a status of `400` under the following error conditions:

            - ###### OFF-010-060, OFF-010-070, OFF-010-080
              One or more of the mandatory header parameters is not specified or has an unexpected value
              - `o3-api-uri`,
              - `o3-api-operation`,
              - `o3-ozone-interaction-id`

          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        401:
          description: |
            The operation __must__ be failed with a status of `401` under the following error conditions:

            - ###### OFF-010-090
              The API consumer is not authorised

          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"

      security:
        - bearerAuth: []

  /accounts/{accountId}/offers:
    get:
      tags:
        - offers
      summary: Fetch the offers for the account specified by the account id.
      operationId: findOffersByAccountId

      description: |
        ###### OFF-020-010

        Retrieves the offers for account specified by the `accountId` parameter.

        ## Optionality

      parameters:
        # common header parameters that set context
        - $ref: "#/components/parameters/aspspId"
        - $ref: "#/components/parameters/callerOrgId"
        - $ref: "#/components/parameters/callerClientId"
        - $ref: "#/components/parameters/callerSoftwareStatementId"
        - $ref: "#/components/parameters/apiUri"
        - $ref: "#/components/parameters/apiOperation"
        - $ref: "#/components/parameters/consentId"
        - $ref: "#/components/parameters/callerInteractionId"
        - $ref: "#/components/parameters/ozoneInteractionId"
        - name: o3-psu-identifier
          in: header
          schema:
            type: string
          required: true
          description: A Base64 encoded representation of the psuIdentifier JSON object.

        # Path param definitions
        - name: accountId
          in: path
          description: Id of the account to be queried
          required: true
          schema:
            type: string
          example: abc-123
      responses:
        200:
          description: successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/OffersResponse"
        400:
          description: |
            The operation __must__ be failed with a status of `400` under the following error conditions:

              ###### OFF-020-020
              The account corresponding to the `accountId` query parameter does not exist or is under a bar.

              ###### OFF-020-040
              The LFI should fail the call if the `o3-psu-identifier` header is not specified.

              ###### OFF-020-050
              The LFI should fail the call if the `accountId` does not refer to an account that
              is accessible by the PSU identified by the `o3-psu-identifier` header.

            The operation __may__ be failed with a status of `400` under the following error conditions:

              ###### OFF-020-060, OFF-020-070, OFF-020-080
              One or more of the mandatory header parameters is not specified or has an unexpected value
              - `o3-api-uri`,
              - `o3-api-operation`,
              - `o3-ozone-interaction-id`
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"

        401:
          description: |
            The operation __must__ be failed with a status of `401` under the following error conditions:

              ###### OFF-020-090
              The API consumer is not authorised.

          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"

      security:
        - bearerAuth: []

  /beneficiaries:
    get:
      tags:
        - beneficiaries
      summary: Fetch beneficiaries
      description: |

        ###### BEN-010-010

        The API must return all the beneficiaries specified by the `accountIds` query parameter.

        ###### BEN-010-020

        If the `accountsIds` query parameter is not specified, the API must return all the beneficiaries for
        the PSU identified by the `o3-psu-identifier` header.

        ###### BEN-010-140

        If one or more specified accountIds does not exist or cannot be retrieved the call should continue to return other accounts.

        ###### BEN-010-150

        If no accounts are found, the call must return a success status code `200` with an empty `data` array.

        ## Optionality
        At least one of `/beneficiaries` or `/accounts/:accountId/beneficiaries` must be implemented.

      operationId: findBeneficiaries
      parameters:
        # common header parameters that set context
        - $ref: "#/components/parameters/aspspId"
        - $ref: "#/components/parameters/callerOrgId"
        - $ref: "#/components/parameters/callerClientId"
        - $ref: "#/components/parameters/callerSoftwareStatementId"
        - $ref: "#/components/parameters/apiUri"
        - $ref: "#/components/parameters/apiOperation"
        - $ref: "#/components/parameters/consentId"
        - $ref: "#/components/parameters/callerInteractionId"
        - $ref: "#/components/parameters/ozoneInteractionId"
        - $ref: "#/components/parameters/psuIdentifier"

        # query parameters
        - name: accountIds
          in: query
          description: Comma separated ids of the accounts to be returned
          schema:
            type: string
            minimum: 1
          required: true

      responses:
        200:
          description: successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BeneficiariesResponse"
        400:
          description: |
            The operation __must__ be failed with a status of `400` under the following error conditions:

            - ###### BEN-010-020
              If the `accountsIds` query parameter is not specified.

            - ###### BEN-010-030
              The `o3-aspsp-id` header is missing or has an unexpected value

            - ###### BEN-010-040
              The `o3-psu-identifier` is not specified.

            The operation __may__ be failed with a status of `400` under the following error conditions:

            - ###### BEN-010-070, BEN-010-080, BEN-010-090
              One or more of the mandatory header parameters is not specified or has an unexpected value
              - `o3-api-uri`,
              - `o3-api-operation`,
              - `o3-ozone-interaction-id`

          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"

        401:
          description: |
            The operation __must__ be failed with a status of `401` under the following error conditions:

            - ###### BEN-010-100
              The API consumer is not authorised.

          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
      security:
        - bearerAuth: []

  /accounts/{accountId}/beneficiaries:
    get:
      tags:
        - beneficiaries
      summary: Fetch the beneficiaries specified by the account id

      description: |
        ###### BEN-020-010

        Retrieves the beneficiaries specified by the `accountId` parameter.

        ###### BEN-020-020

        The account corresponding to the `accountId` query parameter does not exist or is under a bar

        ## Optionality
        At least one of `/beneficiaries` or `/accounts/:accountId/beneficiaries` must be implemented.

      operationId: findBeneficiariesByAccountId
      parameters:
        # common header parameters that set context
        - $ref: "#/components/parameters/aspspId"
        - $ref: "#/components/parameters/callerOrgId"
        - $ref: "#/components/parameters/callerClientId"
        - $ref: "#/components/parameters/callerSoftwareStatementId"
        - $ref: "#/components/parameters/apiUri"
        - $ref: "#/components/parameters/apiOperation"
        - $ref: "#/components/parameters/consentId"
        - $ref: "#/components/parameters/callerInteractionId"
        - $ref: "#/components/parameters/ozoneInteractionId"
        - $ref: "#/components/parameters/psuIdentifier"

        # Path param definitions
        - name: accountId
          in: path
          description: Id of the account to be queried
          required: true
          schema:
            type: string
      responses:
        200:
          description: successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BeneficiariesResponse"
        400:
          description: |
            The operation __must__ be failed with a status of `400` under the following error conditions:

            - ###### BEN-020-020
              If the `accountsId` query parameter is not specified.

            - ###### BEN-020-030
              The `o3-aspsp-id` header is missing or has an unexpected value

            The operation __should__ be failed with a status of `400` under the following error conditions:

            - ###### BEN-020-040
              The LFI should fail the call if the `o3-psu-identifier` header is not specified.

            - ###### BEN-020-050
              Both the `accountId` query parameter and the `o3-psu-identifier` header parameter are not specified.

            The operation __may__ be failed with a status of `400` under the following error conditions:

            - ###### BEN-020-060, BEN-020-070, BEN-020-080
              One or more of the mandatory header parameters is not specified or has an unexpected value
              - `o3-api-uri`,
              - `o3-api-operation`,
              - `o3-ozone-interaction-id`

          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"

        401:
          description: |
            The operation __must__ be failed with a status of `401` under the following error conditions:

            - ###### BEN-020-100
            The API consumer is not authorised.

          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"

      security:
        - bearerAuth: []

  /customer/beneficiaries:
    get:
      tags:
        - beneficiaries
      summary: Fetch the beneficiaries specified by the `o3-psu-identifier` header

      description: |
        ###### BEN-030-010

        Retrieves the beneficiaries specified by the `o3-psu-identifier` header

      operationId: findBeneficiariesByCustomerId
      parameters:
        # common header parameters that set context
        - $ref: "#/components/parameters/aspspId"
        - $ref: "#/components/parameters/callerOrgId"
        - $ref: "#/components/parameters/callerClientId"
        - $ref: "#/components/parameters/callerSoftwareStatementId"
        - $ref: "#/components/parameters/apiUri"
        - $ref: "#/components/parameters/apiOperation"
        - $ref: "#/components/parameters/consentId"
        - $ref: "#/components/parameters/callerInteractionId"
        - $ref: "#/components/parameters/ozoneInteractionId"
        - $ref: "#/components/parameters/psuIdentifier"

      responses:
        200:
          description: successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BeneficiariesResponse"
        400:
          description: |
            The operation __must__ be failed with a status of `400` under the following error conditions:

            - ###### BEN-030-030
              The `o3-aspsp-id` header is missing or has an unexpected value

            The operation __should__ be failed with a status of `400` under the following error conditions:

            - ###### BEN-030-040
              The LFI should fail the call if the `o3-psu-identifier` header is not specified.

            The operation __may__ be failed with a status of `400` under the following error conditions:

            - ###### BEN-030-070, BEN-030-080, BEN-030-090
              One or more of the mandatory header parameters is not specified or has an unexpected value
              - `o3-api-uri`,
              - `o3-api-operation`,
              - `o3-ozone-interaction-id`

          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"

        401:
          description: |
            The operation __must__ be failed with a status of `401` under the following error conditions:

            - ###### BEN-030-100
              The API consumer is not authorised.

          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"

      security:
        - bearerAuth: []

  /products:
    get:
      tags:
        - products
      summary: Fetch products.
      description: |

        The API must return all the products that are provided by the LFI.

        If no products are found, the call must return a success status code `200` with an empty `data` array.

        It should be noted that the TPP calling the standards based API may not do so under a consent. The PSU is not identifiable and the `o3-consent-id` and `o3-psu-identifier` headers should not be expected.

      operationId: findProducts
      parameters:
        # common header parameters that set context
        - $ref: "#/components/parameters/aspspId"
        - $ref: "#/components/parameters/callerOrgId"
        - $ref: "#/components/parameters/callerClientId"
        - $ref: "#/components/parameters/callerSoftwareStatementId"
        - $ref: "#/components/parameters/apiUri"
        - $ref: "#/components/parameters/apiOperation"
        # - $ref: '#/components/parameters/consentId'
        - $ref: "#/components/parameters/callerInteractionId"
        - $ref: "#/components/parameters/ozoneInteractionId"
        - $ref: "#/components/parameters/psuIdentifier"


      responses:
        200:
          description: successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ProductsResponse"
        400:
          description: |
            The operation __must__ be failed with a status of `400` under the following error conditions:

            - ###### PRD-010-030
              The `o3-aspsp-id` header is missing or has an unexpected value

            -  ###### PRD-010-040
              The `o3-psu-identifier` header parameter is not specified.              

            The operation __may__ be failed with a status of `400` under the following error conditions:

            - ###### PRD-010-070, PRD-010-080, PRD-010-090
              One or more of the mandatory header parameters is not specified or has an unexpected value
              - `o3-api-uri`,
              - `o3-api-operation`,
              - `o3-ozone-interaction-id`

          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"

        401:
          description: |
            The operation __must__ be failed with a status of `401` under the following error conditions:

            - ###### PRD-010-100
              The API consumer is not authorised.

          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
      security:
        - bearerAuth: []

  /statement/accounts:
    get:
      tags:
        - statement
      summary: Fetch statement accounts.
      description: |

        ###### STT-010-010

        The API must return all the statements specified by the `:accountIds` query parameter.

        ###### STT-010-020

        If the `accountsIds` query parameter is not specified, the API must return all the statements for
        the PSU identified by the `o3-psu-identifier` header.

        ###### STT-010-030

        If one or more specified accountIds does not exist or cannot be retrieved the call should continue to return other accounts.

        ###### STT-010-040

        If no accounts are found, the call must return a success status code `200` with an empty `data` array.

      operationId: findStatement
      parameters:
        # common header parameters that set context
        - $ref: "#/components/parameters/aspspId"
        - $ref: "#/components/parameters/callerOrgId"
        - $ref: "#/components/parameters/callerClientId"
        - $ref: "#/components/parameters/callerSoftwareStatementId"
        - $ref: "#/components/parameters/apiUri"
        - $ref: "#/components/parameters/apiOperation"
        - $ref: "#/components/parameters/consentId"
        - $ref: "#/components/parameters/callerInteractionId"
        - $ref: "#/components/parameters/ozoneInteractionId"
        - $ref: "#/components/parameters/psuIdentifier"

        # query parameters
        - name: accountIds
          in: query
          description: Comma separated ids of the accounts to be returned
          schema:
            type: string
            minimum: 1
          required: true

      responses:
        200:
          description: successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/StatementResponse"
        400:
          description: |
            The operation __must__ be failed with a status of `400` under the following error conditions:

            - ###### PRD-010-030
              The `o3-aspsp-id` header is missing or has an unexpected value

            The operation __may__ be failed with a status of `400` under the following error conditions:

            - ###### PRD-010-070, PRD-010-080, PRD-010-090
              One or more of the mandatory header parameters is not specified or has an unexpected value
              - `o3-api-uri`,
              - `o3-api-operation`,
              - `o3-ozone-interaction-id`

          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"

        401:
          description: |
            The operation __must__ be failed with a status of `401` under the following error conditions:

            - ###### PRD-010-100
              The API consumer is not authorised.

          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
      security:
        - bearerAuth: []

  /accounts/{accountId}/statements:
    get:
      tags:
        - statement
      summary: Fetch statement by accountId.
      description: |
        ###### STT-020-010

        Retrieves the statements specified by the `accountId` parameter.

      operationId: findStatementByAccountId
      parameters:
        # common header parameters that set context
        - $ref: "#/components/parameters/aspspId"
        - $ref: "#/components/parameters/callerOrgId"
        - $ref: "#/components/parameters/callerClientId"
        - $ref: "#/components/parameters/callerSoftwareStatementId"
        - $ref: "#/components/parameters/apiUri"
        - $ref: "#/components/parameters/apiOperation"
        - $ref: "#/components/parameters/consentId"
        - $ref: "#/components/parameters/callerInteractionId"
        - $ref: "#/components/parameters/ozoneInteractionId"
        - $ref: "#/components/parameters/psuIdentifier"

        # Path param definitions
        - name: accountId
          in: path
          description: accountId of the statement to be queried
          required: true
          schema:
            type: string

      responses:
        200:
          description: successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/StatementResponse"
        400:
          description: |
            The operation __must__ be failed with a status of `400` under the following error conditions:

            - ###### PRD-010-030
              The `o3-aspsp-id` header is missing or has an unexpected value

            The operation __may__ be failed with a status of `400` under the following error conditions:

            - ###### PRD-010-070, PRD-010-080, PRD-010-090
              One or more of the mandatory header parameters is not specified or has an unexpected value
              - `o3-api-uri`,
              - `o3-api-operation`,
              - `o3-ozone-interaction-id`

          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"

        401:
          description: |
            The operation __must__ be failed with a status of `401` under the following error conditions:

            - ###### PRD-010-100
              The API consumer is not authorised.

          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
      security:
        - bearerAuth: []

  /accounts/{accountId}/statements/{statementId}:
    get:
      tags:
        - statement
      summary: Fetch statement by accountId.
      description: |
        ###### STT-030-010

        Retrieves the statements specified by the `accountId` parameter.

      operationId: findStatementByStatementId
      parameters:
        # common header parameters that set context
        - $ref: "#/components/parameters/aspspId"
        - $ref: "#/components/parameters/callerOrgId"
        - $ref: "#/components/parameters/callerClientId"
        - $ref: "#/components/parameters/callerSoftwareStatementId"
        - $ref: "#/components/parameters/apiUri"
        - $ref: "#/components/parameters/apiOperation"
        - $ref: "#/components/parameters/consentId"
        - $ref: "#/components/parameters/callerInteractionId"
        - $ref: "#/components/parameters/ozoneInteractionId"
        - $ref: "#/components/parameters/psuIdentifier"

        # Path param definitions
        - name: accountId
          in: path
          description: accountId of the statement to be queried
          required: true
          schema:
            type: string

        - name: statementId
          in: path
          description: statementId of the statement to be queried
          required: true
          schema:
            type: string

      responses:
        200:
          description: successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/StatementResponse"
        400:
          description: |
            The operation __must__ be failed with a status of `400` under the following error conditions:

            - ###### PRD-010-030
              The `o3-aspsp-id` header is missing or has an unexpected value

            The operation __may__ be failed with a status of `400` under the following error conditions:

            - ###### PRD-010-070, PRD-010-080, PRD-010-090
              One or more of the mandatory header parameters is not specified or has an unexpected value
              - `o3-api-uri`,
              - `o3-api-operation`,
              - `o3-ozone-interaction-id`

          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"

        401:
          description: |
            The operation __must__ be failed with a status of `401` under the following error conditions:

            - ###### PRD-010-100
              The API consumer is not authorised.

          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
      security:
        - bearerAuth: []

components:
  schemas:
    #
    # Schemas for Accounts
    #
    AccountsResponse:
      type: object
      example:
        data:
          - id: string
            brandName: string
            companyCnpj: string
            accountType: string
            accountSubType: string
            currency: string
            status: string
            compeCode: string
            branchCode: string
            checkDigit: string
            resourceType: string
            resourceStatus: string
            accountHolderName: string
            accountholderShortName: string
            servicer:
              schemeName: string
              identification: string
            accountNumbers:
              - name: string
                schemeName: string
                identification: string
                secondaryIdentification: string
            product:
              id: string
              productName: string
              bundleName: string
            accountOwnership: string
            productCategory: string
            isOwned: boolean
            specificAccountUType: string
            creditCard:
              minPaymentAmount: string
              paymentDueAmount: string
              paymentCurrency: string
              paymentDueDate: string
            termDeposit:
              - lodgementDate: string
                maturityDate: string
                maturityAmount: string
                maturityCurrency: string
                maturityInstructions: string
            loan:
              originalStartDate: string
              originalLoanAmount: string
              originalLoanCurrency: string
              loanEndDate: string
              nextInstalmentDate: string
              minInstalmentAmount: string
              minInstalmentCurrency: string
              maxRedraw: string
              maxRedrawCurrency: string
              minRedraw: string
              minRedrawCurrency: string
              offsetAccountEnabled: boolean
              offsetAccountIds: string[]
              repaymentType: string
              repaymentFrequency: string
            depositRate: string
            lendingRate: string
            depositRates:
              - depositRateType: string
                rate: string
                calculationFrequency: string
                applicationFrequency: string
                tiers:
                  - name: string
                    unitOfMeasure: string
                    minimumValue: string
                    maximumValue: string
                    rateApplicationMethod: string
                    applicabilityConditions:
                      additionalInfo: string
                      additionalInfoUri: string
                    additionalInfo: string
                    additionalInfoUri: string
                additionalValue: string
                additionalInfo: string
                additionalInfoUri: string
            lendingRates:
              - lendingRateType: string
                rate: string
                comparisonRate: string
                calculationFrequency: string
                applicationFrequency: string
                interestPaymentDue: string
                repaymentType: string
                loanPurpose: string
                tiers:
                  - name: string
                    unitOfMeasure: string
                    minimumValue: string
                    maximumValue: string
                    rateApplicationMethod: string
                    applicabilityConditions:
                      additionalInfo: string
                      additionalInfoUri: string
                    additionalInfo: string
                    additionalInfoUri: string
                additionalValue: string
                additionalInfo: string
                additionalInfoUri: string
            features:
              - featureType: string
                additionalValue: string
                additionalInfo: string
                additionalInfoUri: string
                isActivated: boolean
            fees:
              - name: string
                feeType: string
                amount: string
                balanceRate: string
                transactionRate: string
                accruedRate: string
                accrualFrequency: string
                currency: string
                additionalValue: string
                additionalInfo: string
                additionalInfoUri: string
                discounts:
                  - description: string
                    discountType: string
                    amount: string
                    balanceRate: string
                    transactionRate: string
                    accruedRate: string
                    feeRate: string
                    additionalValue: string
                    additionalInfo: string
                    additionalInfoUri: string
                    eligibility:
                      - discountEligibilityType: string
                        additionalValue: string
                        additionalInfo: string
                        additionalInfoUri: string
                addresses:
                  - addressUType: string
                    simple:
                      mailingName: string
                      addressLine1: string
                      addressLine2: string
                      addressLine3: string
                      postcode: string
                      city: string
                      state: string
                      country: string
                    paf:
                      dpid: string
                      thoroughfareNumber1: number
                      thoroughfareNumber1Suffix: string
                      thoroughfareNumber2: number
                      thoroughfareNumber2Suffix: string
                      flatUnitType: string
                      flatUnitNumber: string
                      floorLevelType: string
                      floorLevelNumber: string
                      lotNumber: string
                      buildingName1: string
                      buildingName2: string
                      streetName: string
                      streetType: string
                      streetSuffix: string
                      postalDeliveryType: string
                      postalDeliveryNumber: string
                      postalDeliveryNumberPrefix: number
                      postalDeliveryNumberSuffix: string
                      localityName: string
                      postcode: string
                      state: string
        meta: {}
      properties:
        data:
          type: array
          items:
            $ref: "#/components/schemas/Account"
        meta:
          $ref: "#/components/schemas/Meta"

    AccountResponse:
      type: object
      properties:
        data:
          $ref: "#/components/schemas/Account"
        meta:
          $ref: "#/components/schemas/Meta"

    Account:
      type: object
      description: |
        A descriptor for an account.
        This is a composite object that may be expanded in the future to support
        additional account types for new API standards and account types.
      oneOf:
        - $ref: "#/components/schemas/GenericAccount"

    GenericAccount:
      type: object
      properties:
        id:
          type: string
        product:
          $ref: "#/components/schemas/ProductIdentifier"
        multiAuth:
          description: |
          
          type: boolean
        currency:
          $ref: "#/components/schemas/TCurrency"
        businessCustomer:
          type: array
          items:
            $ref: "#/components/schemas/CustomerIdentifier"
        customers:
          description: |
          
          type: array
          items:
            $ref: "#/components/schemas/CustomerIdentifier"
          minimum: 1
        accountNumbers:
          type: array
          items:
            $ref: "#/components/schemas/AccountNumber"
          minimum: 1
        status:
          description: |
            The status of the account.
            The LFI must return a status code from the enumeration of the underlying standard.
          type: string

        statusUpdateDateTime:
          description: The last time when the status was updated

            Only used for SAMA KSA

          type: string
          format: date-time

        accountType:
          type: string
          description: |
            
        accountSubType:
          type: string
        description:
          type: string
        nickName:
          type: string
        openingDate:
          type: string
          format: date-time
        maturityDate:
          type: string
          format: date-time
        accountHolderName:
          $ref: "#/components/schemas/AccountHolderName"
        accountholderShortName:
          $ref: "#/components/schemas/AccountHolderShortName"
        servicer:
          $ref: "#/components/schemas/Agent"

      required:
        - id
        - product
        - accountNumbers
      additionalProperties: false

    CustomersResponse:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: "#/components/schemas/Customer"
        meta:
          $ref: "#/components/schemas/Meta"

    CustomerResponse:
      type: object
      properties:
        data:
          $ref: "#/components/schemas/Customer"
        meta:
          $ref: "#/components/schemas/Meta"

    Customer:
      type: object
      properties:
        id:
          type: string
          description: |
            
        number:
          type: string
          description: |
            
        customerName:
          type: string
          description: |
            
        accountRole:
          type: string
        legalStructure:
          type: string
        contact:
          $ref: "#/components/schemas/Contact"
        verifiedClaims:
          type: "array"
          description: "Container object containing entries for the trust framework and the evidence used to verify the PSU 1 claims"
          items:
            $ref: "#/components/schemas/VerifiedClaim"
      required:
        - customerType

    Contact:
      type: object
      properties:
        email:
          type: string
        phone:
          type: string
        mobile:
          type: string
        address:
          type: array
          items:
            $ref: "#/components/schemas/Address"
      required:
        - email
        - phone
        - mobile
    VerifiedClaim:
      description: |
        Verified Claims :This is Required field for ksa
        Container object containing entries for the trust framework and the evidence used to verify the PSU 1 claims
        [https://openid.net/specs/openid-connect-4-identity-assurance-1_0.html#name-representing-verified-claim](https://openid.net/specs/openid-connect-4-identity-assurance-1_0.html#name-representing-verified-claim)
      type: "object"
      required:
        - "claims"
      properties:
        verification:
          description: |
            Verification
            [https://openid.net/specs/openid-connect-4-identity-assurance-1_0.html#name-verification-element](https://openid.net/specs/openid-connect-4-identity-assurance-1_0.html#name-verification-element)
          type: "object"
          required:
            - "trustFramework"
          properties:
            trustFramework:
              type: "string"
              enum: [SA_IAM, SA_AML, SA_MyAddress, SA_MobileTelecoms]
              description: |
                Identifies the trust framework used for PSU 1 verification. This consists of a set of rules and standards and sets out requirements so that organisations know what ‘good’ identity verification looks like.
                Trust Frameworks: [https://bitbucket.org/openid/ekyc-ida/wiki/identifiers](https://bitbucket.org/openid/ekyc-ida/wiki/identifiers)
                SA_IAM, SA_AML, SA_MYAddress, SA_MobileTelecoms are to be confirmed as the finalised list from SAMA
            assuranceLevel:
              type: "string"
              description: |
                Determines the assurance level associated with the PSU1 in the respective VerifiedClaims. The value range depends on the respective TrustFramework value.
                Assurance Level: [https://bitbucket.org/openid/ekyc-ida/wiki/identifiers](https://bitbucket.org/openid/ekyc-ida/wiki/identifiers)
            assuranceProcess:
              type: "object"
              description: |
                Determines the assurance process that was followed. This reflects how the evidence meets the requirements of the TrustFramework and AssuranceLevel. The factual record of the evidence and the procedures followed are recorded in the evidence element, this element is used to cross reference the evidence to the AssuranceLevel followed
                OpenID Connect for Identity Assurance 1.0: [https://openid.net/specs/openid-connect-4-identity-assurance-1_0.html#name-verification-element](https://openid.net/specs/openid-connect-4-identity-assurance-1_0.html#name-verification-element)
              properties:
                policy:
                  type: "string"
                  description: "Representing the standard or policy that was followed."
                procedure:
                  type: "string"
                  description: "Representing a specific procedure from the policy that was followed."
                assuranceDetails:
                  type: "array"
                  description: "Denoting the details about how the evidence complies with the policy"
                  items:
                    type: "object"
                    properties:
                      assuranceType:
                        description: "String denoting which part of the assurance_process the evidence fulfils"
                        type: "string"
                      assuranceClassification:
                        description: "String reflecting how the evidence has been classified or measured as required by the TrustFramework"
                        type: "string"
                      evidenceRef:
                        description: "Evidence being referred to"
                        type: "array"
                        items:
                          type: "object"
                          required:
                            - "txn"
                          properties:
                            txn:
                              description: "Identifier referring to the txn used in the CheckDetails."
                              type: "string"
                            evidenceMetadata:
                              description: "Object indicating any meta data about the evidence that is required by the AssuranceProcess in order to demonstrate compliance with the TrustFramework. It has the following sub-elements"
                              type: "object"
                              properties:
                                evidenceClassification:
                                  type: "string"
                                  description: "String indicating how the process demonstrated by the check_details for the evidence is classified by the AssuranceProcess in order to demonstrate compliance with the TrustFramework."
            time:
              type: "string"
              format: "date-time"
              description: |
                Representing the date and time when the identity verification process took place. 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
            verificationProcess:
              type: "string"
              description: |
                Unique reference to the identity verification process as performed by the OP. Used for identifying and retrieving details in case of disputes or audits. Presence of this element might be required for certain trust frameworks.
            evidence:
              description: |
                The type of evidence allowed for providing PSU 1 verification.
                OpenID Connect for Identity Assurance 1.0: [https://openid.net/specs/openid-connect-4-identity-assurance-1_0.html#name-evidence-element](https://openid.net/specs/openid-connect-4-identity-assurance-1_0.html#name-evidence-element)
              type: "array"
              items:
                anyOf:
                  - $ref: "#/components/schemas/OBPartyIdentityEvidenceTypeDocument"
                  - $ref: "#/components/schemas/OBPartyIdentityEvidenceTypeElectronicRecord"

        claims:
          description: |
            Standard Claims:
            [https://openid.net/specs/openid-connect-core-1_0.html#StandardClaims](https://openid.net/specs/openid-connect-core-1_0.html#StandardClaims)
            IdentityAssurance Claims:
            [https://openid.net/specs/openid-connect-4-identity-assurance-1_0.html#name-claims](https://openid.net/specs/openid-connect-4-identity-assurance-1_0.html#name-claims)
          type: "object"
          properties:
            sub:
              description: |
                Subject - Identifier for the PSU 1 at the Issuer.
              type: "string"
            name:
              description: |
                The PSU 1 name claim that has been verified by the PASP in english
              type: "string"
            nameInLocalLanguage:
              description: |
                name in local language
              type: string
            givenName:
              description: |
                The PSU 1 given name claim that has been verified by the PASP.
                Given name (also called forename) is used to differentiate from the surname or family name. Also called first name to distinguish it from the family name. Some people have two or more given names or acquired names that they use before the family name.
              type: "string"
            givenNameInLocalLanguage:
              description: |
                given name in local language
              type: string
            grandfatherName:
              description: |
                The PSU 1 grandfather name claim that has been verified by the PASP.
              type: "string"
            grandfatherNameInLocalLanguage:
              description: |
                grandfather name in local language
              type: string
            familyName:
              description: |
                The PSU 1 family name claim that has been verified by the PASP.
              type: "string"
            familyNameInLocalLanguage:
              description: |
                family name in local language
              type: string
            middleName:
              description: |
                The PSU 1 middle name claim that has been verified by the PASP.
              type: "string"
            middleNameInLocalLanguage:
              description: |
                middle name in local language
              type: string
            nickname:
              description: |
                The PSU 1 nickname claim that has been verified by the PASP.
              type: "string"
            nickNameInLocalLanguage:
              description: |
                nickname in local language
              type: string
            preferredUsername:
              description: |
                The PSU 1 preferred username claim that has been verified by the PASP.
              type: "string"
            profile:
              description: |
                The PSU 1 profile id claim that has been verified by the PASP.
              type: "string"
            picture:
              description: |
                The PSU 1 photo claim that has been verified by the PASP.
              type: "string"
            website:
              description: |
                The PSU 1 website claim that has been verified by the PASP.
              type: "string"
            email:
              description: |
                The PSU 1 Email claim that has been verified by the PASP.
              type: "string"
            emailVerified:
              description: |
                The PSU 1 Email Verified claim that has been verified by the PASP.
              type: "boolean"
            gender:
              description: |
                The PSU 1 Gender claim that has been verified by the PASP.
              type: "string"
            birthDate:
              description: |
                The PSU 1 date of birth claim that has been verified by the PASP.
              type: "string"
              format: "date"
            zoneInfo:
              description: |
                The PSU 1 timezone claim that has been verified by the PASP.
              type: "string"
            locale:
              description: |
                The PSU 1 locale claim that has been verified by the PASP.
              type: "string"
            phoneNumber:
              description: |
                The PSU 1 phone number claim that has been verified by the PASP.
              type: "string"
            phoneNumberVerified:
              description: |
                The PSU 1 verified phone number claim that has been verified by the PASP.
              type: "boolean"
            salutation:
              description: |
                The PSU 1 Salutation claim that has been verified by the PASP.
              type: "string"
            title:
              description: |
                The PSU 1 Title claim that has been verified by the PASP.
              type: "string"
            msisdn:
              description: |
                The PSU 1 MSISDN claim that has been verified by the PASP.
                The MSISDN uniquely identifies a mobile subscriber across the globe. It is the phone number digits along with other protocol information.
              type: "string"
            birthFamilyName:
              description: |
                The PSU 1 birth family name claim that has been verified by the PASP.
              type: "string"
            birthGivenName:
              description: |
                The PSU 1 birth given name claim that has been verified by the PASP.
              type: "string"
            birthMiddleName:
              description: |
                The PSU 1 birth middle name claim that has been verified by the PASP.
              type: "string"
            alsoKnownAs:
              description: |
                The PSU 1 other name claim that has been verified by the PASP.
              type: "string"
            placeOfBirth:
              description: |
                Place of Birth Claim
              type: "object"
              properties:
                country:
                  # The PSU 1 country of birth claim that has been verified by the PASP.
                  $ref: "#/components/schemas/CountryCode"
                region:
                  description: |
                    The PSU 1 region of birth claim that has been verified by the PASP.
                  type: "string"
                locality:
                  description: |
                    The PSU 1 locality (village, town, city etc) of birth claim that has been verified by the PASP.
                  type: "string"
            nationalities:
              type: "array"
              description: |
                The PSU 1 nationality claim that has been verified by the PASP.
                This is an array which may contain multiple entries
              items:
                type: string
            address:
              items:
                $ref: "#/components/schemas/OBPartyIdentityAddressClaim"
              type: "array"
            postalAddresses:
              $ref: "#/components/schemas/OBAddress"
            educationLevel:
              description: |
                The PSU 1 education level that has been verified by the PASP.
              type: "string"
              enum:
                - KSAOB.Elementary
                - KSAOB.Intermediate
                - KSAOB.Secondary
                - KSAOB.University
                - KSAOB.Other
            partyIdentity:
              description: |
                The PSU 1 Party Data that has been verified by the PASP.
              type: "object"
              additionalProperties: false
              properties:
                type:
                  type: "string"
                  enum:
                    - "KSAOB.NationalID"
                    - "KSAOB.IqamaID"
                    - "KSAOB.GCCNationalID"
                number:
                  type: "string"
                placeOfIssuance:
                  type: "string"
                expirationDate:
                  type: "string"
                  format: "date"
                calendarType:
                  $ref: "#/components/schemas/OBPartyCalendarType"
            additionalContactInformation:
              description: |
                The PSU 1 additional contact information.
              type: "array"
              items:
                additionalProperties: false
                properties:
                  fullName:
                    description: "Full name in arabic (1st, 2nd, 3rd and family)"
                    type: "string"
                  relation:
                    description: "The relationship of the contact with the PSU 1"
                    type: "string"
                  mobilePhoneNumber:
                    description: "The mobile phone number of the contact"
                    type: "string"
                  homePhoneNumber:
                    description: "The home phone number of the contact"
                    type: "string"
            jobInformation:
              description: |
                The PSU 1 job information.
              type: "object"
              additionalProperties: false
              properties:
                employerName:
                  description: "The PSU1 employer name"
                  type: "string"
                jobTitle:
                  description: "The PSU1 job title "
                  type: "string"
                employmentSector:
                  description: "The PSU1 employment sector"
                  type: "string"
                  enum:
                    - KSAOB.Governmental
                    - KSAOB.Private
                    - KSAOB.Semi-Governmental
                    - KSAOB.Other
                professionalActivity:
                  description: "The PSU1 profession"
                  type: "string"
                dateOfEmployment:
                  description: "The PSU1 date of employment"
                  type: "string"
                  format: "date"
                calendarType:
                  $ref: "#/components/schemas/OBPartyCalendarType"
            financialInformation:
              description: |
                The PSU 1 financial information.
              type: "array"
              additionalProperties: false
              items:
                properties:
                  income:
                    description: "Basic / Additional income amount by source"
                    type: "object"
                    additionalProperties: false
                    properties:
                      type:
                        description: |
                          The type of income.

                          Where Type is BasicMonthlyIncome, then Source can only be one of the following:
                          * Salary
                          * FreelanceWork
                          * Subvention
                          * Reward
                          * Other

                          Where Type is AdditionalMonthlyIncome, then Source can only be one of:
                          * Rental
                          * EquityInvestment
                          * Other
                        type: "string"
                        enum:
                          - KSAOB.BasicMonthlyIncome
                          - KSAOB.AdditionalMonthlyIncome
                      amount:
                        $ref: "#/components/schemas/OBActiveCurrencyAndAmountSimpleType"
                      currency:
                        $ref: "#/components/schemas/ActiveOrHistoricCurrencyCode"
                      source:
                        description: |
                          Source of Income.

                          * Salary, FreelanceWork, Subvention, Reward, Other apply only where Type is: BasicMonthlyIncome
                          * Rental, EquityInvestment, Other apply only where Type is: AdditionalMonthlyIncome
                        type: "string"
                        enum:
                          - KSAOB.Salary
                          - KSAOB.FreelanceWork
                          - KSAOB.Subvention
                          - KSAOB.Reward
                          - KSAOB.Other
                          - KSAOB.Rental
                          - KSAOB.EquityInvestment
            transactionFrequency:
              description: "Anticipated transaction frequency"
              type: "object"
              additionalProperties: false
              properties:
                expectedIncomingTransactionFrequency:
                  description: "Anticipated incoming transaction frequency"
                  type: "string"
                expectedOutgoingTransactionFrequency:
                  description: "Anticipated outgoing transaction frequency"
                  type: "string"
            additionalInformation:
              description: "Additional information about the PSU 1"
              type: "object"
              additionalProperties: false
              properties:
                politicalAcquaintance:
                  type: "object"
                  description: "Capture PSU 1 Political Acquaintance information"
                  additionalProperties: false
                  properties:
                    isPoliticallyAcquainted:
                      description: "Are you politically acquianted?"
                      type: "boolean"
                    hasFirstOrSecondDegreeRelationship:
                      description: "Do you have a first or second degree relationship with a political acquiantaince ?"
                      type: "boolean"
                disability:
                  type: "object"
                  description: "Capture PSU 1 disabled information"
                  additionalProperties: false
                  properties:
                    isDisabled:
                      description: "Are you a person with a disability ?"
                      type: "boolean"
                    disabilityType:
                      description: "The type of disability"
                      type: "string"
                      enum:
                        - "KSAOB.Hearing"
                        - "KSAOB.Visual"
                        - "KSAOB.Physical"
                        - "KSAOB.Other"
                isRealBeneficiary:
                  description: "Confirms if the PSU1 is the real beneficiary of the account"
                  type: "boolean"
            guardianInformation:
              description: "PSU 1 Guardian Information"
              type: "object"
              additionalProperties: false
              properties:
                relationshipType:
                  type: "string"
                  enum:
                    - "KSAOB.Father"
                    - "KSAOB.Mother"
                    - "KSAOB.Guardian"
                    - "KSAOB.Other"
                firstName:
                  description: "PSU 1 Guardian First Name"
                  type: "string"
                firstNameInLocalLanguage:
                  description: "PSU 1 Guardian First Name in local language"
                  type: "string"
                fatherName:
                  description: "PSU 1 Guardian Father Name in english"
                  type: "string"
                fatherNameInLocalLanguage:
                  description: "PSU 1 Guardian Father Name in local language"
                  type: "string"
                grandfatherName:
                  description: "PSU 1 Guardian GrandFather Name in english"
                  type: "string"
                grandfatherNameInLocalLanguage:
                  description: "PSU 1 Guardian GrandFather Name in local language"
                  type: "string"
                familyName:
                  description: "PSU 1 Guardian Family Name"
                  type: "string"
                familyNameInLocalLanguage:
                  description: "PSU 1 Guardian Family Name in local language"
                  type: "string"
                gender:
                  description: |
                    PSU 1 Guardian Gender.
                    Male or Female.
                  type: "string"
                  enum:
                    - "Male"
                    - "Female"
                nationality:
                  description: |
                    PSU 1 Guardian Nationality .
                  type: "string"
                birthDate:
                  description: |
                    PSU 1 Guardian date of birth.
                  type: "string"
                  format: "date"
                birthDateCalendarType:
                  $ref: "#/components/schemas/OBPartyCalendarType"
                placeOfBirth:
                  description: |
                    PSU 1 Guardian Birth Claim
                  type: "object"
                  properties:
                    country:
                      # The PSU 1 country of birth claim that has been verified by the PASP.
                      $ref: "#/components/schemas/OBCountryCode"
                    region:
                      description: |
                        PSU 1 Guardian region of birth claim that has been verified by the PASP.
                      type: "string"
                    locality:
                      description: |
                        The PSU 1 locality (village, town, city etc) of birth claim that has been verified by the PASP.
                      type: "string"
                  additionalProperties: false
                educationLevel:
                  description: |
                    PSU 1 Guardian education level that has been verified by the PASP.
                  type: "string"
                  enum:
                    - KSAOB.Elementary
                    - KSAOB.Intermediate
                    - KSAOB.Secondary
                    - KSAOB.University
                    - KSAOB.Other
                nationalId:
                  description: |
                    PSU 1 Guardian NationalId Data that has been verified by the PASP.
                  type: "object"
                  additionalProperties: false
                  properties:
                    type:
                      type: "string"
                    number:
                      type: "string"
                    placeOfIssuance:
                      type: "string"
                    expirationDate:
                      type: "string"
                      format: "date"
                    calendarType:
                      $ref: "#/components/schemas/OBPartyCalendarType"
                nationalAddress:
                  $ref: "#/components/schemas/OBAddress"
                mobilePhoneNumber:
                  description: "PSU 1 Guardian mobile phone number"
                  type: "string"
                homePhoneNumber:
                  description: "PSU 1 Guardian home phone number"
                  type: "string"
                email:
                  description: "PSU 1 Guardian Email"
                  type: "string"
                jobInformation:
                  description: |
                    PSU 1 Guardian job information.
                  type: "object"
                  additionalProperties: false
                  properties:
                    employerName:
                      description: "PSU 1 Guardian employer name"
                      type: "string"
                    jobTitle:
                      description: "PSU 1 Guardian job title "
                      type: "string"
                    employmentSector:
                      description: "PSU 1 Guardian employment sector"
                      type: "string"
                      enum:
                        - KSAOB.Governmental
                        - KSAOB.Private
                        - KSAOB.Semi-Governmental
                        - KSAOB.Other
            updatedAt:
              description: |
                Time the PSU1's information was last updated. Its value is a JSON number representing the number of seconds from 1970-01-01T0:0:0Z as measured in UTC until the date/time.
              type: "string"


    OBAddress:
      title: "OBAddress"
      description: |
        (Array) Address information that locates and identifes a specific address, as defined by a national or international postal service."
      type: "array"
      minItems: 1
      items:
        type: "object"
        required:
          - "addressType"
          - "country"
        properties:
          addressType:
            $ref: "#/components/schemas/OBAddressTypeCode"
          addressSubType:
            $ref: "#/components/schemas/OBAddressSubTypeCode"
          shortAddress:
            $ref: "#/components/schemas/OBShortAddress"
          unitNumber:
            $ref: "#/components/schemas/OBUnitNumber"
          floorNumber:
            $ref: "#/components/schemas/OBFloorNumber"
          buildingNumber:
            $ref: "#/components/schemas/OBBuildingNumber"
          streetName:
            $ref: "#/components/schemas/OBStreetName"
          secondaryNumber:
            $ref: "#/components/schemas/OBSecondaryNumber"
          district:
            $ref: "#/components/schemas/OBDistrict"
          postalCode:
            $ref: "#/components/schemas/OBPostalCode"
          poBox:
            $ref: "#/components/schemas/OBPOBox"
          zipCode:
            $ref: "#/components/schemas/OBZipCode"
          city:
            $ref: "#/components/schemas/OBCity"
          region:
            $ref: "#/components/schemas/OBRegion"
          country:
            $ref: "#/components/schemas/OBCountryCode"
        additionalProperties: false
    OBAddressTypeCode:
      title: "OBAddressTypeCode"
      description: "Specifies the nature of the Address."
      type: "string"
      enum:
        - "KSAOB.National"
        - "KSAOB.HomeCountry"
      example: "KSAOB.National"

    OBAddressSubTypeCode:
      title: "OBAddressSubTypeCode"
      description: "Specifies the nature of the Address."
      type: "string"
      enum:
        - "KSAOB.Business"
        - "KSAOB.Correspondence"
        - "KSAOB.Residential"
      example: "KSAOB.Residential"
    OBShortAddress:
      title: "OBShortAddress"
      description: "A short address consists of four letters: region code, branch code, division code, unique code and a four-digit number for the building."
      type: "string"
      minLength: 1
      maxLength: 8
      example: "ABCD1234"
    OBUnitNumber:
      title: "OBUnitNumber"
      description: "Identifies the unit or apartment number."
      type: "string"
      minLength: 1
      maxLength: 10
      example: "6"
    OBFloorNumber:
      title: "OBFloorNumber"
      description: "Identifies the building floor number."
      type: "string"
      minLength: 1
      maxLength: 10
      example: "2"
    OBBuildingNumber:
      title: "OBBuildingNumber"
      description: "Identifies the building number."
      type: "string"
      minLength: 1
      maxLength: 10
      example: "34"
    OBStreetName:
      title: "OBStreetName"
      description: "Identifies the street name or road."
      type: "string"
      minLength: 1
      maxLength: 70
      example: "Omar Bin Hassan Street"
    OBDistrict:
      title: "OBDistrict"
      description: "Identifies the district of a city."
      type: "string"
      minLength: 1
      maxLength: 35
      example: "Olaya Dist."
    OBCountryCode:
      title: "OBCountryCode"
      description: "Indicates the country code in which the address is located (References ISO 3166-1 alpha-2)."
      type: "string"
      pattern: "^[A-Z]{2,2}$"
      example: "SA"
    OBPostalCode:
      title: "OBPostalCode"
      description: " Identifies the postal code; a unique code assigned to a specific geographic area for efficient mail sorting and delivery purposes."
      type: "string"
      minLength: 1
      maxLength: 10
      example: "12345"
    OBPOBox:
      title: "POBox"
      description: " Identifies the POBox."
      type: "string"
      minLength: 1
      maxLength: 10
      example: "11562"
    OBZipCode:
      title: "ZipCode"
      description: "Identifies the ZIP code; a unique code assigned to a specific geographic area for efficient mail sorting and delivery purposes."
      type: "string"
      minLength: 1
      maxLength: 10
      example: "12366"
    OBSecondaryNumber:
      title: "OBSecondaryNumber"
      description: "4 numbers representing the accurate location coordinates of the address"
      type: "string"
      minLength: 4
      maxLength: 4
      example: "1233"
    OBCity:
      title: "OBCity"
      description: "Identifies the name of the city or town where the address is situated."
      type: "string"
      minLength: 1
      maxLength: 35
      example: "Riyadh"
    OBRegion:
      title: "OBRegion"
      description: "Identifies the region."
      type: "string"
      minLength: 1
      maxLength: 35
      example: "North"

    Address:
      type: object
      properties:
        addressType:
          type: string
        department:
          type: string
        subDepartment:
          type: string
        street:
          type: string
        building:
          type: string
        postCode:
          type: string
        town:
          type: string
        countrySubDivision:
          type: string
        country:
          type: string
        addressLine:
          type: array
          items:
            type: string

    ProductIdentifier:
      type: object
      properties:
        id:
          description: |
            
          type: string
        productName:
          type: string
        bundleName:
          description: Optional field to indicate if this account is part of a bundle that is providing additional benefit for to the customer
          type: string
      required:
        - productName

    CustomerIdentifier:
      type: object
      properties:
        id:
          type: string
        customerName:
          type: string
      required:
        - id
        - customerName

    #
    # Schemas related to Balances
    #
    OBPartyIdentityEvidenceTypeDocument:
      description: |
        Document Evidence
        [https://openid.net/specs/openid-connect-4-identity-assurance-1_0.html#name-evidence-type-document](https://openid.net/specs/openid-connect-4-identity-assurance-1_0.html#name-evidence-type-document)
      type: "object"
      properties:
        type:
          description: "The type of evidence allowed for providing PSU 1 verification."
          type: "string"
          enum: [document]
        checkDetails:
          $ref: "#/components/schemas/OBPartyIdentityCheckDetails"
        verifier:
          type: "object"
          properties:
            organization:
              type: "string"
            txn:
              type: "string"
        time:
          # Date and time at which the the evidence was verified by the PASP
          $ref: "#/components/schemas/ISODateTime"
        documentDetails:
          type: "object"
          properties:
            type:
              description: |
                The type of document used for evidence checking by the PASP
                [https://bitbucket.org/openid/ekyc-ida/wiki/identifiers](https://bitbucket.org/openid/ekyc-ida/wiki/identifiers)"
              type: "string"
              enum: [passport, driving_permit, idcard, residence_permit]
            documentNumber:
              description: "The unique id number in the evidence used for verification checking"
              type: "string"
            personalNumber:
              description: |
                An identifier that is assigned to the End-User and is not limited to being used in one document, for example a national identification number, personal identity number, citizen number, social security number, driver number, account number, customer number, licensee number, etc
              type: "string"
            serialNumber:
              description: |
                An identifier/number that identifies the document irrespective of any personalization information (this usually only applies to physical artifacts and is present before personalization).
              type: "string"
            calendarType:
              $ref: "#/components/schemas/OBPartyCalendarType"
            dateOfIssuance:
              # The issuing date of the document used for verification checking.
              $ref: "#/components/schemas/ISODateTime"
            dateOfExpiry:
              # The expiry date of the document used for verification checking
              $ref: "#/components/schemas/ISODateTime"
            issuer:
              type: "object"
              properties:
                name:
                  description: |
                    Designation of the issuer of the document.
                  type: "string"
                address:
                  # All elements of the OpenID Connect address Claim
                  items:
                    $ref: "#/components/schemas/OBPartyIdentityAddressClaim"
                  type: array
                countryCode:
                  description: |
                    String denoting the country or supranational organization that issued the document as ISO 3166
                  type: "string"
                jurisdiction:
                  description: |
                    String containing the name of the region(s)/state(s)/province(s)/municipality(ies) that issuer has jurisdiction over (if this information is not common knowledge or derivable from the address)
                  type: "string"
        attachments:
          $ref: "#/components/schemas/OBPartyIdentityEvidenceAttachments"
    OBPartyIdentityEvidenceTypeElectronicRecord:
      description: |
        Electronic Record Evidence
        [https://openid.net/specs/openid-connect-4-identity-assurance-1_0.html#name-evidence-type-electronic_re](https://openid.net/specs/openid-connect-4-identity-assurance-1_0.html#name-evidence-type-electronic_re)
      type: "object"
      properties:
        type:
          description: "The type of evidence allowed for providing PSU 1 verification."
          type: "string"
          enum: [electronic_record]
        checkDetails:
          $ref: "#/components/schemas/OBPartyIdentityCheckDetails"
        time:
          #Date and time at which the the evidence was verified by the PASP
          $ref: "#/components/schemas/ISODateTime"
        record:
          description: |
            Representing the record used to perform the identity verification.
          type: "object"
          properties:
            type:
              description: |
                String denoting the type of electronic record
                "[https://bitbucket.org/openid/ekyc-ida/wiki/identifiers](https://bitbucket.org/openid/ekyc-ida/wiki/identifiers)"
              type: "string"
              enum: [bank_account, mortgage_account, loan_account]
            personalNumber:
              description: |
                String representing an identifier that is assigned to the PSU1 and is not limited to being used in one record, for example a national identification number, personal identity number, citizen number, social security number, driver number, account number, customer number, licensee number, etc.
              type: "string"
            calendarType:
              $ref: "#/components/schemas/OBPartyCalendarType"
            createdAt:
              # The time the record was created
              $ref: "#/components/schemas/ISODateTime"
            dateOfExpiry:
              # The date the evidence will expire
              $ref: "#/components/schemas/ISODateTime"
            source:
              type: "object"
              description: |
                Information about the source of this record
              properties:
                name:
                  description: |
                    Designation of the source of the electronic_record
                  type: "string"
                address:
                  # All elements of the OpenID Connect address Claim
                  items:
                    $ref: "#/components/schemas/OBPartyIdentityAddressClaim"
                  type: "array"
                countryCode:
                  description: |
                    String denoting the country or supranational organization that issued the evidence as ISO 3166
                  type: "string"
                jurisdiction:
                  description: |
                    String containing the name of the region(s) / state(s) / province(s) / municipality(ies) that source has jurisdiction over (if it's not common knowledge or derivable from the address)
                  type: "string"
        attachments:
          $ref: "#/components/schemas/OBPartyIdentityEvidenceAttachments"
    OBPartyIdentityCheckDetails:
      description: |
        Identifes the method used by PASP for checking the PSU 1 evidence for verification.
        Representing the checks done in relation to the evidence
        OpenID Connect for Identity Assurance 1.0: [https://openid.net/specs/openid-connect-4-identity-assurance-1_0.html#name-evidence-element](https://openid.net/specs/openid-connect-4-identity-assurance-1_0.html#name-evidence-element)
      type: "array"
      items:
        type: "object"
        properties:
          checkMethod:
            description: |
              Identifes the method used by PASP for checking the PSU 1 evidence for verification
              String representing the check done, this includes processes such as checking the authenticity of the document, or verifying the user's biometric against an identity document.
            type: "string"
          organization:
            description: |
              String denoting the legal entity that performed the check. This SHOULD be included if the OP did not perform the check itself
            type: "string"
          txn:
            description: |
              Identifier referring to the identity verification transaction. The OP MUST ensure that this is present when EvidenceRef element is used. The OP MUST ensure that the transaction identifier can be resolved into transaction details during an audit
            type: "string"
          time:
            $ref: "#/components/schemas/ISODateTime"
    BalancesResponse:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: "#/components/schemas/Balance"
        meta:
          $ref: "#/components/schemas/Meta"
    ISODateTime:
      title: "ISODateTime"
      description: "All dates in the JSON payloads are represented in ISO 8601 date-time format. \nAll date-time fields in responses must include the timezone. An example is below:\n2017-04-05T10:43:07+00:00"
      type: "string"
      format: "date-time"
    OBPartyIdentityEvidenceAttachments:
      description: |
        Attachments
        [https://openid.net/specs/openid-connect-4-identity-assurance-1_0.html#name-attachments](https://openid.net/specs/openid-connect-4-identity-assurance-1_0.html#name-attachments)
      type: "array"
      items:
        type: "object"
        properties:
          desc:
            description: |
              Description of the document. This can be the filename or just an explanation of the content.
            type: "string"
          contentType:
            description: |
              Content (MIME) type of the document
            type: "string"
          content:
            description: |
              Base64 encoded representation of the document content
            type: "string"
          txn:
            description: |
              Identifier referring to the transaction
            type: "string"
    OBPartyCalendarType:
      description: |
        The type of calendar used for the date of issuance and date of expiry in the document evidence
        Allowable values:
        "Islamic Calendar"
        "Gregorian Calendar"
        Both calendars must follow YYYY-MM-DD
      type: "string"
      enum: [KSAOB.IslamicCalendar, KSAOB.GregorianCalendar]
    OBPartyIdentityAddressClaim:
      description: |
        Address object as per OpenID Connect Core 1.0 Address Claim
        [https://openid.net/specs/openid-connect-core-1_0.html#AddressClaim](https://openid.net/specs/openid-connect-core-1_0.html#AddressClaim)
      type: "object"
      properties:
        formatted:
          description: |
            The PSU 1 address number and street claim that has been verified by the PASP.
          type: "string"
        streetAddress:
          description: |
            The PSU 1 address street claim that has been verified by the PASP.
          type: "string"
        locality:
          description: |
            The PSU 1 address locality (village, town, city etc) claim that has been verified by the PASP.
          type: "string"
        region:
          description: |
            The PSU 1 address region claim that has been verified by the PASP.
          type: "string"
        postalCode:
          # The PSU 1 address postcode claim that has been verified by the PASP.
          $ref: "#/components/schemas/PostalCode"
        country:
          $ref: "#/components/schemas/CountryCode"
        addressType:
          description: |
            Specifies the nature of the Address.
          type: "string"
        shortAddress:
          description: |
            A short address consists of four letters: region code, branch code, division code, unique code and a four-digit number for the building.
          type: "string"
        unitNumber:
          description: |
            Identifies the unit or apartment number.
          type: "string"
        floorNumber:
          description: |
            Identifies the building floor number.
          type: "string"
        buildingNumber:
          description: |
            Identifies the building number.
          type: "string"
        streetName:
          description: |
            Identifies the street name or road.
          type: "string"
        secondaryNumber:
          description: |
            4 numbers representing the accurate location coordinates of the address.
          type: "string"
        district:
          description: |
            Identifies the district of a city.
          type: "string"
        poBox:
          description: |
            Identifies the POBox.
          type: "string"
        zipCode:
          description: |
            Identifies the ZIP code; a unique code assigned to a specific geographic area for efficient mail sorting and delivery purposes.
          type: "string"
        city:
          description: |
            Identifies the name of the city or town where the address is situated.
          type: "string"
    PostalCode:
      description: "Identifier consisting of a group of letters and/or numbers that is added to a postal address to assist the sorting of mail."
      type: "string"
      minLength: 5
      maxLength: 5
    CountryCode:
      description: "Nation with its own government, occupying a particular territory."
      type: "string"
      pattern: "^[A-Z]{2,2}$"
    BalanceResponse:
      type: object
      properties:
        data:
          $ref: "#/components/schemas/Balance"
        meta:
          $ref: "#/components/schemas/Meta"

    OBActiveCurrencyAndAmountSimpleType:
      title: "OBActiveCurrencyAndAmountSimpleType"
      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,13}\\.\\d{1,5}$"
    ActiveOrHistoricCurrencyCode:
      title: "ActiveOrHistoricCurrencyCode"
      description: |
        * /accounts/{AccountId} | /accounts resource
        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'.

        * /accounts/{AccountId}/balances | /accounts/{AccountId}/transactions resource
        A 3 character alphabetic 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'.
      type: "string"
      pattern: "^[A-Z]{3,3}$"
      example: "SAR"

    Balance:
      type: object
      properties:
        accountId:
          type: string
        creditDebitIndicator:
          description: |
            
          items:
            $ref: "#/components/schemas/BalanceCreditDebitEnum"
          type: string
        balanceType:
          type: string
          description: |

        timestamp:
          description: |
            
          type: string
          format: "date-time"
        amount:
          $ref: "#/components/schemas/Amount"
        creditLines:
          type: array
          items:
            $ref: "#/components/schemas/CreditLine"

      required:
        - accountId
        - balanceType
        - amount

    CreditLine:
      type: object
      properties:
        included:
          description: |
            
          type: boolean
        amount:
          $ref: "#/components/schemas/Amount"
        creditType:
          type: string
        creditLineType:
          type: string
          description: |
            
    #
    # Schemas related to Transactions
    #

    TransactionResponse:
      type: object
      properties:
        data:
          $ref: "#/components/schemas/GenericTransaction"
        meta:
          $ref: "#/components/schemas/Meta"

    TransactionsResponse:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: "#/components/schemas/Transaction"
        meta:
          $ref: "#/components/schemas/PaginatedMeta"

    Transaction:
      type: object
      oneOf:
        - $ref: "#/components/schemas/GenericTransaction"

    GenericTransaction:
      type: object
      properties:
        accountId:
          type: string
        transactionId:
          type: string
        transactionReference:
          type: string
        transactionDateTime:
          $ref: "#/components/schemas/TransactionDateTime"
        localTimeZone:
          $ref: "#/components/schemas/LocalTimeZone"
        terminalId:
          $ref: "#/components/schemas/TerminalId"
        paymentModes:
          $ref: "#/components/schemas/PaymentMode"
        billDetails:
          $ref: "#/components/schemas/BillDetails"

        transactionType:
          type: string
          description: |
            

        subTransactionType:
          $ref: "#/components/schemas/SubTransactionType"
        flags:
          type: "array"
          items:
            $ref: "#/components/schemas/Flags"
        statementReference:
          type: array
          items:
            type: string
        creditDebitIndicator:
          $ref: "#/components/schemas/CreditDebitEnum"
        status:
          type: string
          description: |
            
        transactionMutability:
          type: string
        bookingDateTime:
          description: |
            
          type: string
          format: date-time
        valueDateTime:
          type: string
          format: date-time
        transactionInformation:
          type: string
        merchantAddress:
          type: string
        amount:
          $ref: "#/components/schemas/Amount"
        chargeAmount:
          $ref: "#/components/schemas/OBActiveOrHistoricCurrencyAndAmount_6"
        currencyExchange:
          $ref: "#/components/schemas/CurrencyExchange"
        bankTransactionCode:
          $ref: "#/components/schemas/BankTransactionCode"
        proprietoryBankTransactionCode:
          $ref: "#/components/schemas/ProprietoryBankTransactionCode"
        chargeAmountVat:
          $ref: "#/components/schemas/OBActiveOrHistoricCurrencyAndAmount_6"
        balance:
          type: object
          description: |
            A descriptor for balance.
            This is a composite object that may be expanded in the future to support
          oneOf:
            - $ref: "#/components/schemas/TransactionBalance"

        merchantDetails:
          $ref: "#/components/schemas/MerchantDetails"
        creditorAgent:
          $ref: "#/components/schemas/Agent"
        creditorAccount:
          $ref: "#/components/schemas/AccountNumber"
        debtorAgent:
          $ref: "#/components/schemas/Agent"
        debtorAccount:
          $ref: "#/components/schemas/AccountNumber"
        cardInstrument:
          $ref: "#/components/schemas/CardInstrument"
        supplementaryData:
          type: object

      required:
        - accountId
        - status
        - amount

    CardInstrument:
      type: object
      properties:
        cardSchemeName:
          type: string
        instrumentType:
          type: string
        authorizationType:
          type: string
        name:
          type: string
        identification:
          type: string
      required:
        - cardSchemeName

    OBPaymentPurposeCode:
      title: "OBPaymentPurposeCode:"
      description: |
        A Category code, related to the type of services or goods that corresponds to the underlying purpose of the payment.
        The Purpose Codes can be based on either:
        * The SARIE IPS Message Implementation Guide - Section 21.4 - Category Purpose Codes
        * The ISO20022 External code sets

      type: "string"
      minLength: 1
      maxLength: 4
      pattern: "^[A-Z]{3,4}$"

    Agent:
      type: object
      properties:
        schemeName:
          description: |
            The scheme name used for identifying the agent.

            The value should be one of the enumerated values supported by the underlying standard.

          type: string
        identification:
          type: string
        name:
          type: string
        postalAddress:
          $ref: "#/components/schemas/PostalAddress"
        postalAddressList:
          description: "This is only for SAMA"
          items:
            $ref: "#/components/schemas/OBPartyIdentityAddressClaim"
          type: array

      required:
        - identification

    PostalAddress:
      type: object
      properties:
        addressType:
          type: string
          description: For Ksa Version 2 enums should be KSAOB.Business, KSAOB.Correspondence, KSAOB.Residential
        department:
          type: string
        subDepartment:
          type: string
        streetName:
          type: string
          description: Identifies the street name or road.
        buildingNumber:
          type: string
          description: Identifies the building number.
        postCode:
          type: string
          description: Identifies the postal code; a unique code assigned to a specific geographic area for efficient mail sorting and delivery purposes.
        townName:
          type: string
        countrySubDivision:
          type: string
        country:
          type: string
          description: Indicates the country code in which the address is located (References ISO 3166-1 alpha-2).
          pattern: ^[A-Z]{2,2}$
        addressLine:
          type: array
          items:
            type: string
            minItems: 0
            maxItems: 7
        shortAddress:
          type: string
          description: A short address consists of four letters region code, branch code, division code, unique code and a four-digit number for the building.
        unitNumber:
          type: string
          description: Identifies the unit or apartment number.
        floorNumber:
          type: string
          description: Identifies the building floor number.
        poBox:
          type: string
          description: Identifies the POBox.
        zipCode:
          type: string
          description: Identifies the ZIP code; a unique code assigned to a specific geographic area for efficient mail sorting and delivery purposes.
        region:
          type: string
          description: Identifies the region.
        secondaryNumber:
          type: string
          description: 4 numbers representing the accurate location coordinates of the address
        district:
          type: string
          description: Identifies the district of a city.

    MerchantDetails:
      type: object
      properties:
        merchantName:
          type: string
        merchantCategoryCode:
          type: string
        merchantId:
          type: string

    TransactionBalance:
      type: object
      properties:
        amount:
          $ref: "#/components/schemas/Amount"
        creditDebitIndicator:
          $ref: "#/components/schemas/CreditDebitEnum"
        balanceType:
          type: string
      required:
        - amount
        - creditDebitIndicator
        - balanceType

    ProprietoryBankTransactionCode:
      type: object
      properties:
        code:
          type: string
        issuer:
          type: string
      required:
        - code

    BankTransactionCode:
      type: object
      description: |
        
      properties:
        code:
          type: string
        subCode:
          type: string
        family:
          type: "string"
        familyCode:
          type: "string"
        subFamily:
          type: "string"
        subFamilyCode:
          type: "string"
      required:
        - code

    CurrencyExchange:
      type: object
      properties:
        sourceCurrency:
          $ref: "#/components/schemas/TCurrency"
        targetCurrency:
          $ref: "#/components/schemas/TCurrency"
        unitCurrency:
          $ref: "#/components/schemas/TCurrency"
        exchangeRate:
          type: string
        contractIdentification:
          type: string
        quotationDate:
          type: string
          format: date-time
        instructedAmount:
          $ref: "#/components/schemas/Amount"
      required:
        - sourceCurrency
        - exchangeRate

    OBActiveOrHistoricCurrencyAndAmount_6:
      type: "object"
      description: "Transaction charges to be paid by the charge bearer."
      properties:
        amount:
          $ref: "#/components/schemas/OBActiveCurrencyAndAmount_SimpleType"
        currency:
          $ref: "#/components/schemas/ActiveOrHistoricCurrencyCode_1"
        chargeIncluded:
          description: |
            If true then the value in the Amount has the ChargeAmount deducted from it
          type: boolean

    OBActiveOrHistoricCurrencyAndAmount_8:
      type: "object"
      required:
        - "Amount"
        - "Currency"
      description: " The VAT associated with the ChargeAmount"
      properties:
        Amount:
          $ref: "#/components/schemas/OBActiveCurrencyAndAmount_SimpleType"
        Currency:
          $ref: "#/components/schemas/ActiveOrHistoricCurrencyCode_1"
    ActiveOrHistoricCurrencyCode_1:
      description: "A 3 character alphabetic 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'."
      type: "string"
      pattern: "^[A-Z]{3,3}$"
      example: "SAR"
    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,13}\\.\\d{1,5}$"

    BankingTransactionDetail_allOf_extendedData:
      properties:
        payer:
          description: Label of the originating payer. Mandatory for inbound payment
          type: string
        payee:
          description: Label of the target PayID.  Mandatory for an outbound payment. The name assigned to the BSB/Account Number or PayID (by the owner of the PayID)
          type: string
        extensionUType:
          description: Optional extended data specific to transactions originated via NPP
          enum:
            - x2p101Payload
          type: string
        x2p101Payload:
          $ref: "#/components/schemas/BankingTransactionDetail_allOf_extendedData_x2p101Payload"
        service:
          description: "Identifier of the applicable overlay service. Valid values are: X2P1.01"
          enum:
            - X2P1.01
          type: string
      required:
        - service
      type: object
      x-conditional:
        - payer
        - payee
        - x2p101Payload

    BankingTransactionDetail_allOf_extendedData_x2p101Payload:
      properties:
        extendedDescription:
          description: An extended string description. Required if the extensionUType field is `x2p101Payload`
          type: string
        endToEndId:
          description: An end to end ID for the payment created at initiation
          type: string
        purposeCode:
          description: Purpose of the payment.  Format is defined by NPP standards for the x2p1.01 overlay service
          type: string
      type: object
      x-conditional:
        - extendedDescription

    #BG
    reportExchangeRateList:
      description: |
        Array of exchange rates.
      type: array
      items:
        $ref: "#/components/schemas/reportExchangeRate"

    reportExchangeRate:
      description: |
        Exchange Rate.
      type: object
      required:
        - sourceCurrency
        - exchangeRate
        - unitCurrency
        - targetCurrency
        - quotationDate
      properties:
        sourceCurrency:
          $ref: "#/components/schemas/currencyCode"
        exchangeRate:
          type: string
        unitCurrency:
          $ref: "#/components/schemas/currencyCode"
        targetCurrency:
          $ref: "#/components/schemas/currencyCode"
        quotationDate:
          type: string
          format: date
        contractIdentification:
          type: string
          maxLength: 35

    currencyCode:
      description: |
        ISO 4217 Alpha 3 currency code.
      type: string
      pattern: "[A-Z]{3}"
      example: "EUR"

    otherType:
      description: |
        In cases where the specifically defined criteria (IBAN, BBAN, MSISDN)
        are not provided to identify an instance of the respective account type (e.g. a savings account),
        the LFI shall include a proprietary ID of the respective account that uniquely identifies the account for this LFI.
      type: object
      required:
        - identification
      properties:
        identification:
          description: |
            Proprietary identification of the account.
          type: string
          maxLength: 35
        schemeNameCode:
          description: |
            An entry provided by an external ISO code list.
          type: string
          maxLength: 35
        schemeNameProprietary:
          description: |
            A scheme name defined in a proprietary way.
          type: string
          maxLength: 35
        issuer:
          description: |
            Issuer of the identification.
          type: string
          maxLength: 35

    cashAccountType:
      description: |
        ExternalCashAccountType1Code from ISO 20022.
      type: string

    remittanceInformationUnstructured:
      description: |
        Unstructured remittance information.
      type: string
      maxLength: 140
      example: "Ref Number Merchant"

    remittanceInformationUnstructuredArray:
      description: |
        Array of unstructured remittance information.
      type: array
      items:
        $ref: "#/components/schemas/remittanceInformationUnstructured"
      example: ["Ref Number Merchant", "Some Other Text"]

    remittanceInformationStructuredMax140:
      description: |
        Structured remittance information Max
      type: string
      maxLength: 140

    remittanceInformationStructuredArray:
      description: |
        Array of structured remittance information.
      type: array
      items:
        $ref: "#/components/schemas/remittanceInformationStructured"

    remittanceInformationStructured:
      description: |
        Structured remittance information.
      type: object
      required:
        - reference
      properties:
        reference:
          type: string
          maxLength: 35
        referenceType:
          type: string
          maxLength: 35
        referenceIssuer:
          type: string
          maxLength: 35

    creditorId:
      description: Identification of Creditors, e.g. a SEPA Creditor ID.
      type: string
      maxLength: 35
      example: "Creditor Id 5678"

    creditorName:
      description: Creditor name.
      type: string
      maxLength: 70
      example: "Creditor Name"

    iban:
      type: string
      description: IBAN of an account.
      pattern: "[A-Z]{2,2}[0-9]{2,2}[a-zA-Z0-9]{1,30}"
      example: "FR7612345987650123456789014"

    bban:
      description: |
        Basic Bank Account Number (BBAN) Identifier.

        This data element can be used in the body of the consent request.
          Message for retrieving account access consent from this account. This
          data elements is used for payment accounts which have no IBAN.
          ISO20022: Basic Bank Account Number (BBAN).

          Identifier used nationally by financial institutions, i.e., in individual countries,
          generally as part of a National Account Numbering Scheme(s),
          which uniquely identifies the account of a customer.
      type: string
      pattern: "[a-zA-Z0-9]{1,30}"
      example: "BARC12345612345678"

    bicfi:
      description: |
        BICFI
      type: string
      pattern: "[A-Z]{6,6}[A-Z2-9][A-NP-Z0-9]([A-Z0-9]{3,3}){0,1}"
      example: "AAAADEBBXXX"

    pan:
      description: |
        Primary Account Number according to ISO/IEC 7812.
      type: string
      maxLength: 35
      #According to ISO the following should be valid.
      #maxLength: 19
      #minLength: 8
      #pattern: "[0-9]{8,19}"
      example: "5409050000000000"

    maskedPan:
      description: |
        Masked Primary Account Number.
      type: string
      maxLength: 35
      example: "123456xxxxxx1234"

    msisdn:
      type: string
      maxLength: 35
      description: Mobile phone number.
      example: "+49 170 1234567"

    accountReference:
      description: |
        Reference to an account by either
          * IBAN, of a payment accounts, or
          * BBAN, for payment accounts if there is no IBAN, or
          * the Primary Account Number (PAN) of a card, can be tokenised by the LFI due to PCI DSS requirements, or
          * the Primary Account Number (PAN) of a card in a masked form, or
          * an alias to access a payment account via a registered mobile phone number (MSISDN), or
          * a proprietary ID of the  respective account that uniquely identifies the account for this LFI.
      type: object
      properties:
        iban:
          $ref: "#/components/schemas/iban"
        bban:
          $ref: "#/components/schemas/bban"
        pan:
          $ref: "#/components/schemas/pan"
        maskedPan:
          $ref: "#/components/schemas/maskedPan"
        msisdn:
          $ref: "#/components/schemas/msisdn"
        other:
          $ref: "#/components/schemas/otherType"
        currency:
          $ref: "#/components/schemas/currencyCode"
        cashAccountType:
          $ref: "#/components/schemas/cashAccountType"

    ultimateCreditor:
      description: Ultimate creditor.
      type: string
      maxLength: 70
      example: "Ultimate Creditor"

    debtorName:
      description: Debtor name.
      type: string
      maxLength: 70
      example: "Debtor Name"

    ultimateDebtor:
      description: Ultimate debtor.
      type: string
      maxLength: 70
      example: "Ultimate Debtor"

    purposeCode:
      description: |
        ExternalPurpose1Code from ISO 20022.

        Values from ISO 20022 External Code List ExternalCodeSets_1Q2018 June 2018.

      type: string

    EntryDetailsElement:
      type: object
      required:
        - transactionAmount
      properties:
        endToEndId:
          description: Unique end to end identity.
          type: string
          maxLength: 35
        mandateId:
          description: Identification of Mandates, e.g. a SEPA Mandate ID.
          type: string
          maxLength: 35
        checkId:
          description: Identification of a Cheque.
          type: string
          maxLength: 35
        creditorId:
          $ref: "#/components/schemas/creditorId"
        transactionAmount:
          $ref: "#/components/schemas/Amount"
        currencyExchange:
          $ref: "#/components/schemas/reportExchangeRateList"
        creditorName:
          $ref: "#/components/schemas/creditorName"
        creditorAccount:
          $ref: "#/components/schemas/accountReference"
        creditorAgent:
          $ref: "#/components/schemas/bicfi"
        ultimateCreditor:
          $ref: "#/components/schemas/ultimateCreditor"
        debtorName:
          $ref: "#/components/schemas/debtorName"
        debtorAccount:
          $ref: "#/components/schemas/accountReference"
        debtorAgent:
          $ref: "#/components/schemas/bicfi"
        ultimateDebtor:
          $ref: "#/components/schemas/ultimateDebtor"
        remittanceInformation:
          $ref: "#/components/schemas/remittanceInformation"

        purposeCode:
          $ref: "#/components/schemas/purposeCode"

    entryDetails:
      description: |
        Might be used by the LFI to transport details about transactions within a batch.
      type: array
      items:
        $ref: "#/components/schemas/EntryDetailsElement"

    remittanceInformation:
      type: object
      properties:
        remittanceInformationUnstructured:
          $ref: "#/components/schemas/remittanceInformationUnstructured"
        remittanceInformationUnstructuredArray:
          $ref: "#/components/schemas/remittanceInformationUnstructuredArray"
        remittanceInformationStructured:
          description: |
            Structured remittance information Max
          type: string
          maxLength: 140
        remittanceInformationStructuredArray:
          $ref: "#/components/schemas/remittanceInformationStructuredArray"

    balanceType:
      description: |
        The following balance types are defined:
          - "closingBooked":
            Balance of the account at the end of the pre-agreed account reporting period.
            It is the sum of the opening booked balance at the beginning of the period and all entries booked
            to the account during the pre-agreed account reporting period.

            For card-accounts, this is composed of

              - invoiced, but not yet paid entries

          - "expected":
            Balance composed of booked entries and pending items known at the time of calculation,
            which projects the end of day balance if everything is booked on the account and no other entry is posted.

            For card accounts, this is composed of:
              - invoiced, but not yet paid entries
              - not yet invoiced but already booked entries and
              - pending items (not yet booked)

            For card-accounts:

            "money to spend with the value of a pre-approved credit limit on the card account"

          - "openingBooked":
            Book balance of the account at the beginning of the account reporting period.
            It always equals the closing book balance from the previous report.
          - "interimAvailable":
            Available balance calculated in the course of the account ?servicer?s business day,
            at the time specified, and subject to further changes during the business day.
            The interim balance is calculated on the basis of booked credit and debit items during the calculation
            time/period specified.

            For card-accounts, this is composed of:
              - invoiced, but not yet paid entries
              - not yet invoiced but already booked entries
          - "interimBooked":
            Balance calculated in the course of the account servicer's business day, at the time specified,
            and subject to further changes during the business day.
            The interim balance is calculated on the basis of booked credit and debit items during the calculation time/period
            specified.
          - "forwardAvailable":
            Forward available balance of money that is at the disposal of the account owner on the date specified.
          - "nonInvoiced":
            Only for card accounts, to be checked yet.
            
      type: string
      enum:
        - "closingBooked"
        - "expected"
        - "openingBooked"
        - "interimAvailable"
        - "interimBooked"
        - "forwardAvailable"
        - "nonInvoiced"

    additionalInformationStructured:
      description: |
        Is used if and only if the bookingStatus entry equals "information".
        Every active standing order related to the dedicated payment account result into one entry.
      type: object
      required:
        - standingOrderDetails
      properties:
        standingOrderDetails:
          $ref: "#/components/schemas/standingOrderDetails"

    startDate:
      description: |
        The first applicable day of execution starting from this date is the first payment.
      type: string
      format: date

    endDate:
      description: |
        The last applicable day of execution.
        If not given, it is an infinite standing order.
      type: string
      format: date

    frequencyCode:
      description: |
        The following codes from the "EventFrequency7Code" of ISO 20022 are supported:
        - "Daily"
        - "Weekly"
        - "EveryTwoWeeks"
        - "Monthly"
        - "EveryTwoMonths"
        - "Quarterly"
        - "SemiAnnual"
        - "Annual"
        - "MonthlyVariable"
      type: string
      enum:
        - "Daily"
        - "Weekly"
        - "EveryTwoWeeks"
        - "Monthly"
        - "EveryTwoMonths"
        - "Quarterly"
        - "SemiAnnual"
        - "Annual"
        - "MonthlyVariable"

    executionRule:
      description: |
        "following" or "preceding" supported as values.
        This data attribute defines the behaviour when recurring payment dates falls on a weekend or bank holiday.
        The payment is then executed either the "preceding" or "following" working day.
        LFI might reject the request due to the communicated value, if rules in Online-Banking are not supporting
        this execution rule.
      type: string
      enum:
        - "following"
        - "preceding"

    monthsOfExecution:
      description: |
        The format is following the regular expression \d{1,2}.
        The array is restricted to 11 entries.
        The values contained in the array entries shall all be different and the maximum value of one entry is 12.
        This attribute is contained if and only if the frequency equals "MonthlyVariable".
        Example: An execution on January, April and October each year is addressed by ["1", "4", "10"].
      type: array
      maxItems: 11
      items:
        type: string
        maxLength: 2
        enum:
          - "1"
          - "2"
          - "3"
          - "4"
          - "5"
          - "6"
          - "7"
          - "8"
          - "9"
          - "10"
          - "11"
          - "12"

    dayOfExecution:
      description: |
        Day of execution as string.

        This string consists of up two characters.
        Leading zeroes are not allowed.

        31 is ultimo of the month.
      type: string
      maxLength: 2
      enum:
        - "1"
        - "2"
        - "3"
        - "4"
        - "5"
        - "6"
        - "7"
        - "8"
        - "9"
        - "10"
        - "11"
        - "12"
        - "13"
        - "14"
        - "15"
        - "16"
        - "17"
        - "18"
        - "19"
        - "20"
        - "21"
        - "22"
        - "23"
        - "24"
        - "25"
        - "26"
        - "27"
        - "28"
        - "29"
        - "30"
        - "31"

    standingOrderDetails:
      description: |
        Details of underlying standing orders.
      type: object
      required:
        - startDate
        - frequency
      properties:
        startDate:
          $ref: "#/components/schemas/startDate"
        frequency:
          $ref: "#/components/schemas/frequencyCode"
        endDate:
          $ref: "#/components/schemas/endDate"
        executionRule:
          $ref: "#/components/schemas/executionRule"
        withinAMonthFlag:
          description: |
            This element is only used in case of frequency equals "Monthly".

            If this element equals false it has no effect.
            If this element equals true, then the execution rule is overruled if the day of execution would fall into a different month using the execution rule.

            Example: executionRule equals "preceding", dayOfExecution equals "02" and the second of a month is a Sunday.
            In this case, the transaction date would be on the last day of the month before.
             This would be overruled if withinAMonthFlag equals true and the payment is processed on Monday the third of the Month.
            Remark: This attribute is rarely supported in the market.
          type: boolean

        monthsOfExecution:
          $ref: "#/components/schemas/monthsOfExecution"

        multiplicator:
          description: |
            This is multiplying the given frequency resulting the exact frequency,
            e.g. Frequency=weekly and multiplicator=3 means every 3 weeks.
            Remark: This attribute is rarely supported in the market.
          type: string

        dayOfExecution:
          $ref: "#/components/schemas/dayOfExecution"

        limitAmount:
          $ref: "#/components/schemas/Amount"

    address:
      type: object
      required:
        - country
      properties:
        streetName:
          type: string
          maxLength: 70
        buildingNumber:
          type: string
        townName:
          type: string
        postCode:
          type: string
        country:
          $ref: "#/components/schemas/countryCode"
      example:
        {
          streetName: "rue blue",
          buildingnNumber: "89",
          townName: "Paris",
          postCode: "75000",
          country: "FR",
        }

    countryCode:
      description: ISO 3166 ALPHA2 country code.
      type: string
      pattern: "[A-Z]{2}"
      example: "SE"

    cardAcceptorPhone:
      description: |
        Merchant phone number
        It consists of a "+" followed by the country code (from 1 to 3 characters) then a "-" and finally, any
        combination of numbers, "(", ")", "+" and "-" (up to 30 characters).
        pattern according to ISO20022 \+[0-9]{1,3}-[0-9()+\-]{1,30}
      type: string
      pattern: '\+[0-9]{1,3}\-[0-9()+\-]{1,30}'

    #
    # Schemas related to Direct Debits
    #

    DirectDebitsResponse:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: "#/components/schemas/DirectDebit"
        meta:
          $ref: "#/components/schemas/Meta"

    DirectDebit:
      type: object
      description: |
        A descriptor for direct debit.
        This is a composite object that may be expanded in the future to support
        additional direct debit types for new API standards and account types.
      oneOf:
        - $ref: "#/components/schemas/GenericDirectDebit"

    GenericDirectDebit:
      type: object
      properties:
        accountId:
          type: string
        directDebitId:
          type: string
        mandateIdentification:
          type: string
        name:
          type: string
        directDebitStatusCode:
          $ref: "#/components/schemas/DirectDebitStatusEnum"
        previousPaymentDateTime:
          type: string
          format: date-time
        previousPaymentAmount:
          $ref: "#/components/schemas/Amount"
        frequency:
          description: Use a frequency value supported by the underlying API standard

          type: string
      required:
        - accountId
        - mandateIdentification
        - name

    BankingAuthorisedEntity:
      properties:
        description:
          description: Description of the authorised entity derived from previously executed direct debits
          type: string
        financialInstitution:
          description: Name of the financial institution through which the direct debit will be executed. Is required unless the payment is made via a credit card scheme
          type: string
        abn:
          description: Australian Business Number for the authorised entity
          type: string
        acn:
          description: Australian Company Number for the authorised entity
          type: string
        arbn:
          description: Australian Registered Body Number for the authorised entity
          type: string
      type: object
      x-conditional:
        - financialInstitution

    DirectDebitStatusEnum:
      type: string
      enum:
        - Active
        - Inactive

    #
    # Schemas related to Scheduled Payments
    #

    ScheduledPaymentsResponse:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: "#/components/schemas/ScheduledPayment"
        meta:
          $ref: "#/components/schemas/Meta"

    ScheduledPayment:
      type: object
      description: |
        A descriptor for scheduled payments.
        This is a composite object that may be expanded in the future to support
        additional scheduled payment types for new API standards and account types.
      oneOf:
        - $ref: "#/components/schemas/GenericScheduledPayment"

    GenericScheduledPayment:
      type: object
      properties:
        accountId:
          type: string
        scheduledPaymentId:
          type: string
        scheduledPaymentDateTime:
          type: string
          format: date-time
        scheduledType:
          $ref: "#/components/schemas/ScheduledPaymentScheduleType"
        reference:
          type: string
        creditorReference:
          type: string
        debtorReference:
          type: string
        instructedAmount:
          $ref: "#/components/schemas/Amount"
        creditorAgent:
          $ref: "#/components/schemas/Agent"
        creditorAccount:
          $ref: "#/components/schemas/AccountNumber"
      required:
        - accountId
        - scheduledType
        - instructedAmount

    ScheduledPaymentScheduleType:
      type: string

    BankingScheduledPaymentFrom:
      description: Object containing details of the source of the payment. Currently only specifies an account ID but provided as an object to facilitate future extensibility and consistency with the to object
      properties:
        accountId:
          description: ID of the account that is the source of funds for the payment
          type: string
      required:
        - accountId
      type: object

    BankingScheduledPaymentSet:
      description: The set of payment amounts and destination accounts for this payment accommodating multi-part payments. A single entry indicates a simple payment with one destination account. Must have at least one entry
      properties:
        to:
          $ref: "#/components/schemas/BankingScheduledPaymentTo"
        isAmountCalculated:
          description: Flag indicating whether the amount of the payment is calculated based on the context of the event. For instance a payment to reduce the balance of a credit card to zero. If absent then false is assumed
          type: boolean
        amount:
          description: The amount of the next payment if known. Mandatory unless the isAmountCalculated field is set to true. Must be zero or positive if present
          type: string
        currency:
          description: The currency for the payment. AUD assumed if not present
          type: string
      required:
        - to
      type: object
      x-conditional:
        - amount
    BankingScheduledPaymentTo:
      description: Object containing details of the destination of the payment. Used to specify a variety of payment destination types
      properties:
        toUType:
          description: The type of object provided that specifies the destination of the funds for the payment.
          enum:
            - accountId
            - biller
            - domestic
            - international
            - payeeId
          type: string
        accountId:
          description: Present if toUType is set to accountId. Indicates that the payment is to another account that is accessible under the current consent
          type: string
        payeeId:
          description: Present if toUType is set to payeeId. Indicates that the payment is to registered payee that can be accessed using the payee end point. If the Bank Payees scope has not been consented to then a payeeId should not be provided and the full payee details should be provided instead
          type: string
        nickname:
          description: The short display name of the payee as provided by the customer unless toUType is set to payeeId. Where a customer has not provided a nickname, a display name derived by the bank for payee should be provided that is consistent with existing digital banking channels
          type: string
        payeeReference:
          description: The reference for the transaction, if applicable, that will be provided by the originating institution for the specific payment. If not empty, it overrides the value provided at the BankingScheduledPayment level.
          type: string
        domestic:
          $ref: "#/components/schemas/BankingDomesticPayee"
        biller:
          $ref: "#/components/schemas/BankingBillerPayee"
        international:
          $ref: "#/components/schemas/BankingInternationalPayee"
      required:
        - toUType
      type: object
      x-conditional:
        - accountId
        - payeeId
        - domestic
        - biller
        - international
        - nickname
        - payeeReference

    BankingBillerPayee:
      properties:
        billerCode:
          description: BPAY Biller Code of the Biller
          type: string
        crn:
          description: BPAY CRN of the Biller (if available).<br/>Where the CRN contains sensitive information, it should be masked in line with how the Data Holder currently displays account identifiers in their existing online banking channels. If the contents of the CRN match the format of a Credit Card PAN they should be masked according to the rules applicable for MaskedPANString. If the contents are are otherwise sensitive, then it should be masked using the rules applicable for the MaskedAccountString common type.
          type: string
        billerName:
          description: Name of the Biller
          type: string
      required:
        - billerCode
        - billerName
      type: object
      x-conditional:
        - crn

    BankingInternationalPayee:
      properties:
        beneficiaryDetails:
          $ref: "#/components/schemas/BankingInternationalPayee_beneficiaryDetails"
        bankDetails:
          $ref: "#/components/schemas/BankingInternationalPayee_bankDetails"
      required:
        - bankDetails
        - beneficiaryDetails
      type: object

    BankingDigitalWalletPayee:
      properties:
        name:
          description: The name assigned to the digital wallet by the owner of the wallet, else the display name provided by the digital wallet provider
          type: string
        identifier:
          description: The identifier of the digital wallet (dependent on type)
          type: string
        type:
          description: The type of the digital wallet identifier
          enum:
            - EMAIL
            - CONTACT_NAME
            - TELEPHONE
          type: string
        provider:
          description: The provider of the digital wallet
          enum:
            - PAYPAL_AU
            - OTHER
          type: string
      required:
        - identifier
        - name
        - provider
        - type
      type: object

    BankingDomesticPayee:
      properties:
        payeeAccountUType:
          description: "Type of account object included. Valid values are: **account** A standard Australian account defined by BSB/Account Number. **card** A credit or charge card to pay to (note that PANs are masked). **payId** A PayID recognised by NPP"
          enum:
            - account
            - card
            - payId
          type: string
        account:
          $ref: "#/components/schemas/BankingDomesticPayeeAccount"
        card:
          $ref: "#/components/schemas/BankingDomesticPayeeCard"
        payId:
          $ref: "#/components/schemas/BankingDomesticPayeePayId"
      required:
        - payeeAccountUType
      type: object
      x-conditional:
        - account
        - card
        -

    BankingDomesticPayeeAccount:
      properties:
        accountName:
          description: Name of the account to pay to
          type: string
        bsb:
          description: BSB of the account to pay to
          type: string
        accountNumber:
          description: Number of the account to pay to
          type: string
      required:
        - accountNumber
        - bsb
      type: object

    BankingDomesticPayeeCard:
      properties:
        cardNumber:
          description: Name of the account to pay to
          type: string
      required:
        - cardNumber
      type: object

    BankingDomesticPayeePayId:
      properties:
        name:
          description: The name assigned to the PayID by the owner of the PayID
          type: string
        identifier:
          description: The identifier of the PayID (dependent on type)
          type: string
        type:
          description: The type of the PayID
          enum:
            - ABN
            - EMAIL
            - ORG_IDENTIFIER
            - TELEPHONE
          type: string
      required:
        - identifier
        - type
      type: object

    BankingInternationalPayee_beneficiaryDetails:
      properties:
        name:
          description: Name of the beneficiary
          type: string
        country:
          description: Country where the beneficiary resides. A valid [ISO 3166 Alpha-3](https://www.iso.org/iso-3166-country-codes.html) country code
          type: string
        message:
          description: Response message for the payment
          type: string
      required:
        - country
      type: object

    BankingInternationalPayee_bankDetails:
      properties:
        country:
          description: Country of the recipient institution. A valid [ISO 3166 Alpha-3](https://www.iso.org/iso-3166-country-codes.html) country code
          type: string
        accountNumber:
          description: Account Targeted for payment
          type: string
        bankAddress:
          $ref: "#/components/schemas/BankingInternationalPayee_bankDetails_bankAddress"
        beneficiaryBankBIC:
          description: Swift bank code.  Aligns with standard [ISO 9362](https://www.iso.org/standard/60390.html)
          type: string
        fedWireNumber:
          description: Number for Fedwire payment (Federal Reserve Wire Network)
          type: string
        sortCode:
          description: Sort code used for account identification in some jurisdictions
          type: string
        chipNumber:
          description: Number for the Clearing House Interbank Payments System
          type: string
        routingNumber:
          description: International bank routing number
          type: string
        legalEntityIdentifier:
          description: The legal entity identifier (LEI) for the beneficiary.  Aligns with [ISO 17442](https://www.iso.org/standard/59771.html)
          type: string
      required:
        - accountNumber
        - country
      type: object

    BankingInternationalPayee_bankDetails_bankAddress:
      properties:
        name:
          description: Name of the recipient Bank
          type: string
        address:
          description: Address of the recipient Bank
          type: string
      required:
        - address
        - name
      type: object

    BankingScheduledPaymentRecurrence:
      description: Object containing the detail of the schedule for the payment
      properties:
        nextPaymentDate:
          description: The date of the next payment under the recurrence schedule
          type: string
        recurrenceUType:
          description: The type of recurrence used to define the schedule
          enum:
            - eventBased
            - intervalSchedule
            - lastWeekDay
            - onceOff
          type: string
        onceOff:
          $ref: "#/components/schemas/BankingScheduledPaymentRecurrenceOnceOff"
        intervalSchedule:
          $ref: "#/components/schemas/BankingScheduledPaymentRecurrenceIntervalSchedule"
        lastWeekDay:
          $ref: "#/components/schemas/BankingScheduledPaymentRecurrenceLastWeekday"
        eventBased:
          $ref: "#/components/schemas/BankingScheduledPaymentRecurrenceEventBased"
      required:
        - recurrenceUType
      type: object
      x-conditional:
        - onceOff
        - intervalSchedule
        - lastWeekDay
        - eventBased

    BankingScheduledPaymentRecurrenceOnceOff:
      description: Indicates that the payment is a once off payment on a specific future date. Mandatory if recurrenceUType is set to onceOff
      properties:
        paymentDate:
          description: The scheduled date for the once off payment
          type: string
      required:
        - paymentDate
      type: object

    BankingScheduledPaymentRecurrenceIntervalSchedule:
      description: Indicates that the schedule of payments is defined by a series of intervals. Mandatory if recurrenceUType is set to intervalSchedule
      properties:
        finalPaymentDate:
          description: The limit date after which no more payments should be made using this schedule. If both finalPaymentDate and paymentsRemaining are present then payments will stop according to the most constraining value. If neither field is present the payments will continue indefinitely
          type: string
        paymentsRemaining:
          description: Indicates the number of payments remaining in the schedule. If both finalPaymentDate and paymentsRemaining are present then payments will stop according to the most constraining value, If neither field is present the payments will continue indefinitely
          example: 1
          type: integer
        nonBusinessDayTreatment:
          default: "ON"
          description: Enumerated field giving the treatment where a scheduled payment date is not a business day. If absent assumed to be ON.<br/>**AFTER** - If a scheduled payment date is a non-business day the payment will be made on the first business day after the scheduled payment date.<br/>**BEFORE** - If a scheduled payment date is a non-business day the payment will be made on the first business day before the scheduled payment date.<br/>**ON** - If a scheduled payment date is a non-business day the payment will be made on that day regardless.<br/>**ONLY** - Payments only occur on business days. If a scheduled payment date is a non-business day the payment will be ignored
          enum:
            - AFTER
            - BEFORE
            - "ON"
            - ONLY
          type: string
        intervals:
          description: An array of interval objects defining the payment schedule.  Each entry in the array is additive, in that it adds payments to the overall payment schedule.  If multiple intervals result in a payment on the same day then only one payment will be made. Must have at least one entry
          items:
            $ref: "#/components/schemas/BankingScheduledPaymentInterval"
          type: array
      required:
        - intervals
      type: object

    BankingScheduledPaymentRecurrenceLastWeekday:
      description: Indicates that the schedule of payments is defined according to the last occurrence of a specific weekday in an interval. Mandatory if recurrenceUType is set to lastWeekDay
      properties:
        finalPaymentDate:
          description: The limit date after which no more payments should be made using this schedule. If both finalPaymentDate and paymentsRemaining are present then payments will stop according to the most constraining value. If neither field is present the payments will continue indefinitely
          type: string
        paymentsRemaining:
          description: Indicates the number of payments remaining in the schedule. If both finalPaymentDate and paymentsRemaining are present then payments will stop according to the most constraining value. If neither field is present the payments will continue indefinitely
          example: 1
          type: integer
        interval:
          description: The interval for the payment. Formatted according to [ISO 8601 Durations](https://en.wikipedia.org/wiki/ISO_8601#Durations) (excludes recurrence syntax) with components less than a day in length ignored. This duration defines the period between payments starting with nextPaymentDate
          type: string
        lastWeekDay:
          description: The weekDay specified. The payment will occur on the last occurrence of this weekday in the interval.
          enum:
            - FRI
            - MON
            - SAT
            - SUN
            - THU
            - TUE
            - WED
          type: string
        nonBusinessDayTreatment:
          default: "ON"
          description: Enumerated field giving the treatment where a scheduled payment date is not a business day. If absent assumed to be ON.<br/>**AFTER** - If a scheduled payment date is a non-business day the payment will be made on the first business day after the scheduled payment date.<br/>**BEFORE** - If a scheduled payment date is a non-business day the payment will be made on the first business day before the scheduled payment date.<br/>**ON** - If a scheduled payment date is a non-business day the payment will be made on that day regardless.<br/>**ONLY** - Payments only occur on business days. If a scheduled payment date is a non-business day the payment will be ignored
          enum:
            - AFTER
            - BEFORE
            - "ON"
            - ONLY
          type: string
      required:
        - interval
        - lastWeekDay
      type: object

    BankingScheduledPaymentRecurrenceEventBased:
      description: Indicates that the schedule of payments is defined according to an external event that cannot be predetermined. Mandatory if recurrenceUType is set to eventBased
      properties:
        description:
          description: Description of the event and conditions that will result in the payment. Expected to be formatted for display to a customer
          type: string
      required:
        - description
      type: object

    BankingScheduledPaymentInterval:
      properties:
        interval:
          description: An interval for the payment. Formatted according to [ISO 8601 Durations](https://en.wikipedia.org/wiki/ISO_8601#Durations)  (excludes recurrence syntax) with components less than a day in length ignored. This duration defines the period between payments starting with nextPaymentDate
          type: string
        dayInInterval:
          description: Uses an interval to define the ordinal day within the interval defined by the interval field on which the payment occurs. If the resulting duration is 0 days in length or larger than the number of days in the interval then the payment will occur on the last day of the interval. A duration of 1 day indicates the first day of the interval. If absent the assumed value is P1D. Formatted according to [ISO 8601 Durations](https://en.wikipedia.org/wiki/ISO_8601#Durations) (excludes recurrence syntax) with components less than a day in length ignored. The first day of a week is considered to be Monday.
          type: string
      required:
        - interval
      type: object

    #
    # Schemas related to Standing Orders
    #

    StandingOrdersResponse:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: "#/components/schemas/StandingOrder"
        meta:
          $ref: "#/components/schemas/Meta"

    StandingOrder:
      type: object
      properties:
        accountId:
          type: string
        standingOrderId:
          type: string
        frequency:
          type: string
        reference:
          type: string
        firstPaymentDateTime:
          type: string
          format: date-time
        nextPaymentDateTime:
          type: string
          format: date-time
        lastPaymentDateTime:
          type: string
          format: date-time
        finalPaymentDateTime:
          type: string
          format: date-time
        numberOfPayments:
          type: string
        standingOrderStatusCode:
          $ref: "#/components/schemas/StandingOrderStatusCodeEnum"
        firstPaymentAmount:
          $ref: "#/components/schemas/Amount"
        nextPaymentAmount:
          $ref: "#/components/schemas/Amount"
        lastPaymentAmount:
          $ref: "#/components/schemas/Amount"
        finalPaymentAmount:
          $ref: "#/components/schemas/Amount"
        creditorAgent:
          $ref: "#/components/schemas/Agent"
        creditorAccount:
          $ref: "#/components/schemas/AccountNumber"
        supplementaryData:
          type: object
        standingOrderType:
          $ref: "#/components/schemas/StandingOrderType"
        paymentPurposeCode:
          $ref: "#/components/schemas/OBPaymentPurposeCode"
        creditorReference:
          type: string
        purpose:
          $ref: "#/components/schemas/PurposeSO"
      required:
        - accountId
        - frequency

    StandingOrderStatusCodeEnum:
      type: string
      enum:
        - Active
        - Inactive
        - KSAOB.Active
        - KSAOB.Inactive

    #
    # Schemas related to Offers
    #
    OffersResponse:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: "#/components/schemas/Offer"
        meta:
          $ref: "#/components/schemas/Meta"

    Offer:
      type: object
      properties:
        accountId:
          type: string
        amount:
          $ref: "#/components/schemas/Amount"
        description:
          type: string
        endDateTime:
          type: string
          format: date-time
        fee:
          $ref: "#/components/schemas/Amount"
        offerid:
          type: string
        offerType:
          type: string
        rate:
          type: string
        startDateTime:
          type: string
          format: date-time
        term:
          type: string
        url:
          type: string
        value:
          type: string
      required:
        - accountId

    #
    # Schemas related to Products
    #
    ProductsResponse:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: "#/components/schemas/Product"
        meta:
          $ref: "#/components/schemas/Meta"

    Product:
      type: object
      description: |
        A descriptor for an product.
        This is a composite object that may be expanded in the future to support
        additional account types for new API standards and product types.

      oneOf:
        - $ref: "#/components/schemas/ObieProduct"

    ObieProduct:
      type: object
      description: |
        A descriptor for an product.
        This is a composite object that may be expanded in the future to support
        additional account types for new API standards and product types.
      properties:
        Type:
          type: string
          enum:
            - ObieProduct
        ProductName:
          description: The name of the Product used for marketing purposes from a customer perspective. I.e. what the customer would recognise.
          type: string
          minLength: 1
          maxLength: 350
        ProductId:
          description: The unique ID that has been internally assigned by the financial institution to each of the current account banking products they market to their retail and/or small to medium enterprise (SME) customers.
          type: string
          minLength: 1
          maxLength: 40
        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
        SecondaryProductId:
          description: Any secondary Identification which  supports Product Identifier to uniquely identify the current account banking products.
          type: string
          minLength: 1
          maxLength: 70
        ProductType:
          description: "Product type : Personal Current Account, Business Current Account"
          type: string
          enum:
            - BusinessCurrentAccount
            - CommercialCreditCard
            - Other
            - PersonalCurrentAccount
            - SMELoan
        MarketingStateId:
          description: Unique and unambiguous identification of a  Product Marketing State.
          type: string
          minLength: 1
          maxLength: 35
        OtherProductType:
          type: object
        BCA:
          type: object
        PCA:
          type: object
      additionalProperties: true

    #
    # Schemas related to Accounts
    #
    BankingProductCategory:
      description: The category to which a product or account belongs. See [here](#product-categories) for more details
      enum:
        - BUSINESS_LOANS
        - CRED_AND_CHRG_CARDS
        - LEASES
        - MARGIN_LOANS
        - OVERDRAFTS
        - PERS_LOANS
        - REGULATED_TRUST_ACCOUNTS
        - RESIDENTIAL_MORTGAGES
        - TERM_DEPOSITS
        - TRADE_FINANCE
        - TRANS_AND_SAVINGS_ACCOUNTS
        - TRAVEL_CARDS
      type: string

    BankingCreditCardAccount:
      properties:
        minPaymentAmount:
          description: The minimum payment amount due for the next card payment
          type: string
        paymentDueAmount:
          description: The amount due for the next card payment
          type: string
        paymentCurrency:
          description: If absent assumes AUD
          type: string
        paymentDueDate:
          description: Date that the next payment for the card is due
          type: string
      required:
        - minPaymentAmount
        - paymentDueAmount
        - paymentDueDate
      type: object

    BankingTermDepositAccount:
      properties:
        lodgementDate:
          description: The lodgement date of the original deposit
          type: string
        maturityDate:
          description: Maturity date for the term deposit
          type: string
        maturityAmount:
          description: Amount to be paid upon maturity. If absent it implies the amount to paid is variable and cannot currently be calculated
          type: string
        maturityCurrency:
          description: If absent assumes AUD
          type: string
        maturityInstructions:
          description: Current instructions on action to be taken at maturity. This includes default actions that may be specified in the terms and conditions for the product e.g. roll-over to the same term and frequency of interest payments
          enum:
            - HOLD_ON_MATURITY
            - PAID_OUT_AT_MATURITY
            - ROLLED_OVER
          type: string
      required:
        - lodgementDate
        - maturityDate
        - maturityInstructions
      type: object

    BankingLoanAccountV2:
      properties:
        originalStartDate:
          description: Optional original start date for the loan
          type: string
        originalLoanAmount:
          description: Optional original loan value
          type: string
        originalLoanCurrency:
          description: If absent assumes AUD
          type: string
        loanEndDate:
          description: Date that the loan is due to be repaid in full
          type: string
        nextInstalmentDate:
          description: Next date that an instalment is required
          type: string
        minInstalmentAmount:
          description: Minimum amount of next instalment
          type: string
        minInstalmentCurrency:
          description: If absent assumes AUD
          type: string
        maxRedraw:
          description: Maximum amount of funds that can be redrawn. If not present redraw is not available even if the feature exists for the account
          type: string
        maxRedrawCurrency:
          description: If absent assumes AUD
          type: string
        minRedraw:
          description: Minimum redraw amount
          type: string
        minRedrawCurrency:
          description: If absent assumes AUD
          type: string
        offsetAccountEnabled:
          description: Set to true if one or more offset accounts are configured for this loan account
          type: boolean
        offsetAccountIds:
          description: The accountIDs of the configured offset accounts attached to this loan. Only offset accounts that can be accessed under the current authorisation should be included. It is expected behaviour that offsetAccountEnabled is set to true but the offsetAccountIds field is absent or empty. This represents a situation where an offset account exists but details can not be accessed under the current authorisation
          items:
            type: string
          type: array
        repaymentType:
          default: PRINCIPAL_AND_INTEREST
          description: Options in place for repayments. If absent defaults to PRINCIPAL_AND_INTEREST
          enum:
            - INTEREST_ONLY
            - PRINCIPAL_AND_INTEREST
          type: string
        repaymentFrequency:
          description: The expected or required repayment frequency. Formatted according to [ISO 8601 Durations](https://en.wikipedia.org/wiki/ISO_8601#Durations) (excludes recurrence syntax)
          type: string
      type: object

    BankingProductDepositRate:
      properties:
        depositRateType:
          description: The type of rate (base, bonus, etc). See the next section for an overview of valid values and their meaning
          enum:
            - BONUS
            - BUNDLE_BONUS
            - FIXED
            - FLOATING
            - INTRODUCTORY
            - MARKET_LINKED
            - VARIABLE
          type: string
        rate:
          description: The rate to be applied
          type: string
        calculationFrequency:
          description: The period after which the rate is applied to the balance to calculate the amount due for the period. Calculation of the amount is often daily (as balances may change) but accumulated until the total amount is 'applied' to the account (see applicationFrequency). Formatted according to [ISO 8601 Durations](https://en.wikipedia.org/wiki/ISO_8601#Durations) (excludes recurrence syntax)
          type: string
        applicationFrequency:
          description: The period after which the calculated amount(s) (see calculationFrequency) are 'applied' (i.e. debited or credited) to the account. Formatted according to [ISO 8601 Durations](https://en.wikipedia.org/wiki/ISO_8601#Durations) (excludes recurrence syntax)
          type: string
        tiers:
          description: Rate tiers applicable for this rate
          items:
            $ref: "#/components/schemas/BankingProductRateTierV3"
          type: array
        additionalValue:
          description: Generic field containing additional information relevant to the [depositRateType](#tocSproductdepositratetypedoc) specified. Whether mandatory or not is dependent on the value of [depositRateType](#tocSproductdepositratetypedoc)
          type: string
        additionalInfo:
          description: Display text providing more information on the rate
          type: string
        additionalInfoUri:
          description: Link to a web page with more information on this rate
          type: string
      required:
        - depositRateType
        - rate
      type: object
      x-conditional:
        - additionalValue

    BankingProductRateTierV3:
      description: Defines the criteria and conditions for which a rate applies
      properties:
        name:
          description: A display name for the tier
          type: string
        unitOfMeasure:
          description: The unit of measure that applies to the tierValueMinimum and tierValueMaximum values e.g. a **DOLLAR** amount. **PERCENT** (in the case of loan-to-value ratio or LVR). Tier term period representing a discrete number of **MONTH**'s or **DAY**'s (in the case of term deposit tiers)
          enum:
            - DAY
            - DOLLAR
            - MONTH
            - PERCENT
          type: string
        minimumValue:
          description: The number of tierUnitOfMeasure units that form the lower bound of the tier. The tier should be inclusive of this value
          type: number
        maximumValue:
          description: "The number of tierUnitOfMeasure units that form the upper bound of the tier or band. For a tier with a discrete value (as opposed to a range of values e.g. 1 month) this must be the same as tierValueMinimum. Where this is the same as the tierValueMinimum value of the next-higher tier the referenced tier should be exclusive of this value. For example a term deposit of 2 months falls into the upper tier of the following tiers: (1 – 2 months, 2 – 3 months). If absent the tier's range has no upper bound."
          type: number
        rateApplicationMethod:
          description: The method used to calculate the amount to be applied using one or more tiers. A single rate may be applied to the entire balance or each applicable tier rate is applied to the portion of the balance that falls into that tier (referred to as 'bands' or 'steps')
          enum:
            - PER_TIER
            - WHOLE_BALANCE
          type: string
        applicabilityConditions:
          $ref: "#/components/schemas/BankingProductRateCondition"
        additionalInfo:
          description: Display text providing more information on the rate tier.
          type: string
        additionalInfoUri:
          description: Link to a web page with more information on this rate tier
          type: string
      required:
        - minimumValue
        - name
        - unitOfMeasure
      type: object

    BankingProductRateCondition:
      description: Defines a condition for the applicability of a tiered rate
      properties:
        additionalInfo:
          description: Display text providing more information on the condition
          type: string
        additionalInfoUri:
          description: Link to a web page with more information on this condition
          type: string
      type: object

    BankingProductLendingRateV2:
      properties:
        lendingRateType:
          description: The type of rate (fixed, variable, etc). See the next section for an overview of valid values and their meaning
          enum:
            - BUNDLE_DISCOUNT_FIXED
            - BUNDLE_DISCOUNT_VARIABLE
            - CASH_ADVANCE
            - DISCOUNT
            - FIXED
            - FLOATING
            - INTRODUCTORY
            - MARKET_LINKED
            - PENALTY
            - PURCHASE
            - VARIABLE
          type: string
        rate:
          description: The rate to be applied
          type: string
        comparisonRate:
          description: A comparison rate equivalent for this rate
          type: string
        calculationFrequency:
          description: The period after which the rate is applied to the balance to calculate the amount due for the period. Calculation of the amount is often daily (as balances may change) but accumulated until the total amount is 'applied' to the account (see applicationFrequency). Formatted according to [ISO 8601 Durations](https://en.wikipedia.org/wiki/ISO_8601#Durations) (excludes recurrence syntax)
          type: string
        applicationFrequency:
          description: The period after which the calculated amount(s) (see calculationFrequency) are 'applied' (i.e. debited or credited) to the account. Formatted according to [ISO 8601 Durations](https://en.wikipedia.org/wiki/ISO_8601#Durations) (excludes recurrence syntax)
          type: string
        interestPaymentDue:
          description: When loan payments are due to be paid within each period. The investment benefit of earlier payments affect the rate that can be offered
          enum:
            - IN_ADVANCE
            - IN_ARREARS
          type: string
        repaymentType:
          description: Options in place for repayments. If absent, the lending rate is applicable to all repayment types
          enum:
            - INTEREST_ONLY
            - PRINCIPAL_AND_INTEREST
          type: string
        loanPurpose:
          description: The reason for taking out the loan. If absent, the lending rate is applicable to all loan purposes
          enum:
            - INVESTMENT
            - OWNER_OCCUPIED
          type: string
        tiers:
          description: Rate tiers applicable for this rate
          items:
            $ref: "#/components/schemas/BankingProductRateTierV3"
          type: array
        additionalValue:
          description: Generic field containing additional information relevant to the [lendingRateType](#tocSproductlendingratetypedoc) specified. Whether mandatory or not is dependent on the value of [lendingRateType](#tocSproductlendingratetypedoc)
          type: string
        additionalInfo:
          description: Display text providing more information on the rate.
          type: string
        additionalInfoUri:
          description: Link to a web page with more information on this rate
          type: string
      required:
        - lendingRateType
        - rate
      type: object
      x-conditional:
        - additionalValue

    BankingProductFeatureV2:
      properties:
        featureType:
          description: The type of feature described
          enum:
            - ADDITIONAL_CARDS
            - BALANCE_TRANSFERS
            - BILL_PAYMENT
            - BONUS_REWARDS
            - CARD_ACCESS
            - CASHBACK_OFFER
            - COMPLEMENTARY_PRODUCT_DISCOUNTS
            - DIGITAL_BANKING
            - DIGITAL_WALLET
            - DONATE_INTEREST
            - EXTRA_REPAYMENTS
            - FRAUD_PROTECTION
            - FREE_TXNS
            - FREE_TXNS_ALLOWANCE
            - GUARANTOR
            - INSURANCE
            - INSTALMENT_PLAN
            - INTEREST_FREE
            - INTEREST_FREE_TRANSFERS
            - LOYALTY_PROGRAM
            - NOTIFICATIONS
            - NPP_ENABLED
            - NPP_PAYID
            - OFFSET
            - OTHER
            - OVERDRAFT
            - REDRAW
            - RELATIONSHIP_MANAGEMENT
            - UNLIMITED_TXNS
          type: string
        additionalValue:
          description: Generic field containing additional information relevant to the [featureType](#tocSproductfeaturetypedoc) specified. Whether mandatory or not is dependent on the value of the [featureType.](#tocSproductfeaturetypedoc)
          type: string
        additionalInfo:
          description: Display text providing more information on the feature. Mandatory if the [feature type](#tocSproductfeaturetypedoc) is set to OTHER
          type: string
        additionalInfoUri:
          description: Link to a web page with more information on this feature
          type: string
      required:
        - featureType
      type: object
      x-conditional:
        - additionalValue
        - additionalInfo

    BankingProductFee:
      properties:
        name:
          description: Name of the fee
          type: string
        feeType:
          description: The type of fee
          enum:
            - DEPOSIT
            - EVENT
            - EXIT
            - PAYMENT
            - PERIODIC
            - PURCHASE
            - TRANSACTION
            - UPFRONT
            - VARIABLE
            - WITHDRAWAL
          type: string
        amount:
          description: The amount charged for the fee. One of amount, balanceRate, transactionRate and accruedRate is mandatory unless the *feeType* "VARIABLE" is supplied
          type: string
        balanceRate:
          description: A fee rate calculated based on a proportion of the balance. One of amount, balanceRate, transactionRate and accruedRate is mandatory unless the *feeType* "VARIABLE" is supplied.
          type: string
        transactionRate:
          description: A fee rate calculated based on a proportion of a transaction. One of amount, balanceRate, transactionRate and accruedRate is mandatory unless the *feeType* "VARIABLE" is supplied
          type: string
        accruedRate:
          description: A fee rate calculated based on a proportion of the calculated interest accrued on the account. One of amount, balanceRate, transactionRate and accruedRate is mandatory unless the *feeType* "VARIABLE" is supplied
          type: string
        accrualFrequency:
          description: The indicative frequency with which the fee is calculated on the account. Only applies if balanceRate or accruedRate is also present. Formatted according to [ISO 8601 Durations](https://en.wikipedia.org/wiki/ISO_8601#Durations) (excludes recurrence syntax)
          type: string
        currency:
          description: The currency the fee will be charged in. Assumes AUD if absent
          type: string
        additionalValue:
          description: Generic field containing additional information relevant to the [feeType](#tocSproductfeetypedoc) specified. Whether mandatory or not is dependent on the value of [feeType](#tocSproductfeetypedoc)
          type: string
        additionalInfo:
          description: Display text providing more information on the fee
          type: string
        additionalInfoUri:
          description: Link to a web page with more information on this fee
          type: string
        discounts:
          description: An optional list of discounts to this fee that may be available
          items:
            $ref: "#/components/schemas/BankingProductDiscount"
          type: array
      required:
        - feeType
        - name
      type: object
      x-conditional:
        - additionalValue
        - amount
        - balanceRate
        - transactionRate
        -

    BankingProductDiscount:
      properties:
        description:
          description: Description of the discount
          type: string
        discountType:
          description: The type of discount. See the next section for an overview of valid values and their meaning
          enum:
            - BALANCE
            - DEPOSITS
            - ELIGIBILITY_ONLY
            - FEE_CAP
            - PAYMENTS
          type: string
        amount:
          description: Dollar value of the discount. One of amount, balanceRate, transactionRate, accruedRate and feeRate is mandatory.
          type: string
        balanceRate:
          description: A discount rate calculated based on a proportion of the balance. Note that the currency of the fee discount is expected to be the same as the currency of the fee itself. One of amount, balanceRate, transactionRate, accruedRate and feeRate is mandatory. Unless noted in additionalInfo, assumes the application and calculation frequency are the same as the corresponding fee
          type: string
        transactionRate:
          description: A discount rate calculated based on a proportion of a transaction. Note that the currency of the fee discount is expected to be the same as the currency of the fee itself. One of amount, balanceRate, transactionRate, accruedRate and feeRate is mandatory
          type: string
        accruedRate:
          description: A discount rate calculated based on a proportion of the calculated interest accrued on the account. Note that the currency of the fee discount is expected to be the same as the currency of the fee itself. One of amount, balanceRate, transactionRate, accruedRate and feeRate is mandatory. Unless noted in additionalInfo, assumes the application and calculation frequency are the same as the corresponding fee
          type: string
        feeRate:
          description: A discount rate calculated based on a proportion of the fee to which this discount is attached. Note that the currency of the fee discount is expected to be the same as the currency of the fee itself. One of amount, balanceRate, transactionRate, accruedRate and feeRate is mandatory. Unless noted in additionalInfo, assumes the application and calculation frequency are the same as the corresponding fee
          type: string
        additionalValue:
          description: Generic field containing additional information relevant to the [discountType](#tocSproductdiscounttypedoc) specified. Whether mandatory or not is dependent on the value of [discountType](#tocSproductdiscounttypedoc)
          type: string
        additionalInfo:
          description: Display text providing more information on the discount
          type: string
        additionalInfoUri:
          description: Link to a web page with more information on this discount
          type: string
        eligibility:
          description: Eligibility constraints that apply to this discount. Mandatory if ``discountType`` is ``ELIGIBILITY_ONLY``.
          items:
            $ref: "#/components/schemas/BankingProductDiscountEligibility"
          type: array
      required:
        - description
        - discountType
      type: object
      x-conditional:
        - accruedRate
        - additionalValue
        - amount
        - balanceRate
        - eligibility
        - feeRate
        - transactionRate

    BankingProductDiscountEligibility:
      properties:
        discountEligibilityType:
          description: The type of the specific eligibility constraint for a discount
          enum:
            - BUSINESS
            - EMPLOYMENT_STATUS
            - INTRODUCTORY
            - MAX_AGE
            - MIN_AGE
            - MIN_INCOME
            - MIN_TURNOVER
            - NATURAL_PERSON
            - OTHER
            - PENSION_RECIPIENT
            - RESIDENCY_STATUS
            - STAFF
            - STUDENT
          type: string
        additionalValue:
          description: Generic field containing additional information relevant to the [discountEligibilityType](#tocSproductdiscounteligibilitydoc) specified. Whether mandatory or not is dependent on the value of [discountEligibilityType](#tocSproductdiscounteligibilitydoc)
          type: string
        additionalInfo:
          description: Display text providing more information on this eligibility constraint. Whether mandatory or not is dependent on the value of [discountEligibilityType](#tocSproductdiscounteligibilitydoc)
          type: string
        additionalInfoUri:
          description: Link to a web page with more information on this eligibility constraint
          type: string
      required:
        - discountEligibilityType
      type: object
      x-conditional:
        - additionalInfo
        - additionalValue

    CommonSimpleAddress:
      properties:
        mailingName:
          description: Name of the individual or business formatted for inclusion in an address used for physical mail
          type: string
        addressLine1:
          description: First line of the standard address object
          type: string
        addressLine2:
          description: Second line of the standard address object
          type: string
        addressLine3:
          description: Third line of the standard address object
          type: string
        postcode:
          description: Mandatory for Australian addresses
          type: string
        city:
          description: Name of the city or locality
          type: string
        state:
          description: Free text if the country is not Australia. If country is Australia then must be one of the values defined by the [State Type Abbreviation](https://auspost.com.au/content/dam/auspost_corp/media/documents/australia-post-data-guide.pdf) in the PAF file format. NSW, QLD, VIC, NT, WA, SA, TAS, ACT, AAT
          type: string
        country:
          default: AUS
          description: A valid [ISO 3166 Alpha-3](https://www.iso.org/iso-3166-country-codes.html) country code. Australia (AUS) is assumed if country is not present.
          type: string
      required:
        - addressLine1
        - city
        - state
      type: object
      x-conditional:
        - postcode
    CommonPAFAddress:
      description: Australian address formatted according to the file format defined by the [PAF file format](https://auspost.com.au/content/dam/auspost_corp/media/documents/australia-post-data-guide.pdf)
      properties:
        dpid:
          description: Unique identifier for an address as defined by Australia Post.  Also known as Delivery Point Identifier
          type: string
        thoroughfareNumber1:
          description: Thoroughfare number for a property (first number in a property ranged address)
          type: integer
        thoroughfareNumber1Suffix:
          description: Suffix for the thoroughfare number. Only relevant is thoroughfareNumber1 is populated
          type: string
        thoroughfareNumber2:
          description: Second thoroughfare number (only used if the property has a ranged address eg 23-25)
          type: integer
        thoroughfareNumber2Suffix:
          description: Suffix for the second thoroughfare number. Only relevant is thoroughfareNumber2 is populated
          type: string
        flatUnitType:
          description: Type of flat or unit for the address
          type: string
        flatUnitNumber:
          description: Unit number (including suffix, if applicable)
          type: string
        floorLevelType:
          description: Type of floor or level for the address
          type: string
        floorLevelNumber:
          description: Floor or level number (including alpha characters)
          type: string
        lotNumber:
          description: Allotment number for the address
          type: string
        buildingName1:
          description: Building/Property name 1
          type: string
        buildingName2:
          description: Building/Property name 2
          type: string
        streetName:
          description: The name of the street
          type: string
        streetType:
          description: The street type. Valid enumeration defined by Australia Post PAF code file
          type: string
        streetSuffix:
          description: The street type suffix. Valid enumeration defined by Australia Post PAF code file
          type: string
        postalDeliveryType:
          description: Postal delivery type. (eg. PO BOX). Valid enumeration defined by Australia Post PAF code file
          type: string
        postalDeliveryNumber:
          description: Postal delivery number if the address is a postal delivery type
          type: integer
        postalDeliveryNumberPrefix:
          description: Postal delivery number prefix related to the postal delivery number
          type: string
        postalDeliveryNumberSuffix:
          description: Postal delivery number suffix related to the postal delivery number
          type: string
        localityName:
          description: Full name of locality
          type: string
        postcode:
          description: Postcode for the locality
          type: string
        state:
          description: State in which the address belongs. Valid enumeration defined by Australia Post PAF code file [State Type Abbreviation](https://auspost.com.au/content/dam/auspost_corp/media/documents/australia-post-data-guide.pdf). NSW, QLD, VIC, NT, WA, SA, TAS, ACT, AAT
          type: string
      required:
        - localityName
        - postcode
        - state
      type: object
    # Schemas related to Statements
    #
    StatementResponse:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: "#/components/schemas/Statement"
        meta:
          $ref: "#/components/schemas/Meta"

    Statement:
      type: object
      properties:
        accountId:
          type: string
        statementId:
          type: string
        statementReference:
          type: string
        statementType:
          type: string
        startDateTime:
          type: string
          format: date-time
        endDateTime:
          type: string
          format: date-time
        creationDateTime:
          type: string
          format: date-time
        statementDescription:
          type: array
          items:
            type: string
        statementBenefit:
          type: array
          items:
            $ref: "#/components/schemas/StatementBenefit"
        statementFee:
          type: array
          items:
            $ref: "#/components/schemas/StatementFeeIntereset"
        statementInterest:
          type: array
          items:
            $ref: "#/components/schemas/StatementFeeIntereset"
        statementAmount:
          type: array
          items:
            $ref: "#/components/schemas/StatementAmount"
        statementDateTime:
          type: array
          items:
            $ref: "#/components/schemas/StatementDateTime"
        statementRate:
          type: array
          items:
            $ref: "#/components/schemas/StatementRate"
        statementValue:
          type: array
          items:
            $ref: "#/components/schemas/StatementValue"
        totalValue:
          $ref: "#/components/schemas/Amount"

      required:
        - accountId
        - creationDateTime
        - statementType
        - startDateTime
        - endDateTime

    StatementBenefit:
      type: object
      properties:
        amount:
          $ref: "#/components/schemas/Amount"
        benefitType:
          type: string
      required:
        - benefitType
        - amount

    StatementFeeIntereset:
      type: object
      properties:
        amount:
          $ref: "#/components/schemas/Amount"
        creditDebitIndicator:
          $ref: "#/components/schemas/CreditDebitEnum"
        description:
          type: string
        frequency:
          type: string
        rate:
          type: string
        rateType:
          type: string
        type:
          type: string
      required:
        - creditDebitIndicator
        - type
        - amount

    StatementAmount:
      type: object
      properties:
        amount:
          $ref: "#/components/schemas/Amount"
        localAmount:
          $ref: "#/components/schemas/Amount"
        creditDebitIndicator:
          $ref: "#/components/schemas/CreditDebitEnum"
        type:
          type: string
      required:
        - creditDebitIndicator
        - type
        - amount

    StatementDateTime:
      type: object
      properties:
        dateTime:
          type: string
          format: date-time
        type:
          type: string
      required:
        - dateTime
        - type

    StatementValue:
      type: object
      properties:
        type:
          type: string
        value:
          type: string
      required:
        - value
        - type

    StatementRate:
      type: object
      properties:
        type:
          type: string
        rate:
          type: string
      required:
        - rate
        - type

    TransactionByStatementId:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: "#/components/schemas/GenericTransaction"
        meta:
          $ref: "#/components/schemas/Meta"

    #
    # Common types
    #

    BeneficiariesResponse:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: "#/components/schemas/Beneficiary"
        meta:
          $ref: "#/components/schemas/Meta"

    BeneficiaryResponse:
      type: object
      properties:
        data:
          $ref: "#/components/schemas/Beneficiary"
        meta:
          $ref: "#/components/schemas/Meta"

    Beneficiary:
      type: object
      properties:
        accountId:
          type: string
        beneficiaryType:
          type: string
          description: |

        beneficiaryId:
          type: string
        creditorAccount:
          type: object
          properties:
            schemeName:
              type: string
            identification:
              type: string
            name:
              type: string
          required:
            - schemeName
            - identification
        reference:
          type: string
        servicer:
          type: object
          properties:
            schemeName:
              type: string
            identification:
              type: string
            name:
              type: string
            postalAddress:
              $ref: "#/components/schemas/PostalAddress"
            postalAddressList:
              description: "This is only for SAMA"
              items:
                $ref: "#/components/schemas/OBPartyIdentityAddressClaim"
              type: array
        supplementaryData:
          type: object

    TCurrency:
      type: string
      pattern: "^[A-Z]{3,3}$"

    AccountNumber:
      type: object
      properties:
        name:
          type: string
        schemeName:
          type: string
          description: |
            
        identification:
          type: string
        secondaryIdentification:
          type: string
        other:
          $ref: "#/components/schemas/otherType"
        currency:
          $ref: "#/components/schemas/currencyCode"
        cashAccountType:
          $ref: "#/components/schemas/cashAccountType"
      required:
        - schemeName
        - identification

    AccountHolderName:
      type: "string"
      description: |
        The Account Holder Name is the name or names of the Beneficiary account owner(s) represented at the account level, as displayed by the Creditor Agent's online channels and as provided by the Beneficiary to the PSU 1 when adding the Beneficiary in the Beneficiary list.
        Note, the Account Holder Name is not the product name or the nickname of the account.

        Only used for KSA SAMA standard

    AccountHolderShortName:
      type: "string"
      description: |
        The Beneficiary account holder nick name

        Only used for KSA SAMA standard

    CreditDebitEnum:
      type: string
      description: |
        "Credit" if it is incoming transaction / adding money to account
        "Debit" if it is outgoing transaction / paying someone else
      enum:
        - Credit
        - Debit
        - KSAOB.Credit
        - KSAOB.Debit
    TransactionDateTime:
      title: "TransactionDateTime"
      description: |
        The Date Time of when the transaction occurred.
        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"
    LocalTimeZone:
      title: "LocalTimeZone"
      description: |
        The UTC offset of the local date and time of where the transaction occurred
        E.g. UTC+03:00
      type: "string"
      format: "date-time"
    Flags:
      title: "Flags"
      description: "The flag of a transaction"
      type: "string"
      enum:
        - "KSAOB.Cashback"
        - "KSAOB.Payroll"
        - "KSAOB.DirectDebit"
        - "KSAOB.StandingOrder"
        - "KSAOB.Loan"
        - "KSAOB.Dividend"
    TerminalId:
      description: "ID of the Terminal if the transaction was initiated from a retail POS"
      type: "string"
      minLength: 8
      maxLength: 20
    BillDetails:
      description: "Bill Details"
      type: "object"
      properties:
        BillerID:
          description: "This should be 'BillerCode' as per SP-SADAD specifications. It is a unique biller identifier within SADAD that could be used by the end-user to refer to a specific SADAD biller (e.g. STC biller code is 001, water services biller code is 015, etc.)"
          type: "number"
        BillNumber:
          description: "Unique bill identifier within the account."
          type: "string"
        BillPaymentType:
          description: |
            Indicates whether the bill could be a One-off payment, Recurring payment, Postpaid, Pre-paid, etc. Example values:
            - "KSAOB.Post-Paid"
            - "KSAOB.AdvancePaymentForRoaming"
            - "KSAOB.Recharge"
            - "KSAOB.Renewal"
            - "KSAOB.RoamingDeposit"
            - "KSAOB.One-Off"
            - "KSAOB.RecurringPayment"
          type: "string"
          x-namespaced-enum:
            - "KSAOB.Post-Paid"
            - "KSAOB.AdvancePaymentForRoaming"
            - "KSAOB.Recharge"
            - "KSAOB.Renewal"
            - "KSAOB.RoamingDeposit"
            - "KSAOB.One-Off"
            - "KSAOB.RecurringPayment"
        BillerName:
          description: Name of the BPAY biller for the transaction (if available)
          type: string
    PaymentMode:
      title: "PaymentModes"
      description: "The mode of payment. This is only used in SAMA"
      type: "string"
      enum:
        - "KSAOB.Online"
        - "KSAOB.Offline"
        - "KSAOB.Batch"
    SubTransactionType:
      title: "SubTransactionType"
      description: "The sub-type of a transaction.  This is only used in SAMA"
      type: "string"
      enum:
        - "KSAOB.Purchase"
        - "KSAOB.Reversal"
        - "KSAOB.Refund"
        - "KSAOB.Withdrawal"
        - "KSAOB.WithdrawalReversal"
        - "KSAOB.Deposit"
        - "KSAOB.DepositReversal"
        - "KSAOB.MoneyTransfer"
        - "KSAOB.NotApplicable"

    BalanceCreditDebitEnum:
      type: string
      description: |
        Indicates whether the balance is a credit or a debit balance.
        Usage: A zero balance is considered to be a credit balance.

        For SAMA KSA, use `KSAOB.Credit` and `KSAOB.Debit` instead of `Credit` and `Debit`

      enum:
        - Credit
        - Debit
        - KSAOB.Credit
        - KSAOB.Debit

    Amount:
      type: object
      description: |
        
      properties:
        amount:
          type: string
          pattern: '^\d{1,13}$|^\d{1,13}.\d{1,5}$'
        currency:
          $ref: "#/components/schemas/TCurrency"
        chargeIncluded:
          type: "boolean"

      required:
        - amount
        - currency

    Amount_2:
      type: object
      properties:
        amount:
          type: string
          pattern: '^\d{1,13}$|^\d{1,13}.\d{1,5}$'
        currency:
          description: |
            
          items:
            $ref: "#/components/schemas/TCurrency"
          type: string
        chargeIncluded:
          type: "boolean"

      required:
        - amount

    CreditLimitAmount:
      type: object
      properties:
        amount:
          type: string
          pattern: '^\d{1,13}$|^\d{1,13}.\d{1,5}$'
        currency:
          $ref: "#/components/schemas/TCurrency"

      required:
        - amount
        - currency

    StandingOrderType:
      description: "The type of Standing Order."
      type: "string"
      enum:
        - "KSAOB.BetweenMyAccounts"
        - "KSAOB.SameBankTransfer"
        - "KSAOB.LocalBankTransfer"
        - "KSAOB.InternationalTransfer"
        - "KSAOB.Charity"

    PurposeSO:
      description: |
        The purpose of the Standing Order payment.
        A free format string in the form of transaction categorisation.
        Example: "Bills and expenses", "Government payment", "Personal Expenses".
      type: "string"
      minLength: 1
      maxLength: 50

    Meta:
      type: object
      properties:
        totalPages:
          type: number
          description: |
            The number of expected pages for the query. 

        totalRecords:
          type: number
          description: |
            The total number of records in the full set.

    PaginatedMeta:
      type: object
      properties:
        paginated:
          type: boolean
          description: |
            `true` if the response is paginated.

            `false` if the response returns all matching data elements.

            If not specified, a non-paginated response is assumed.

        totalPages:
          type: number
          description: |
            The number of expected pages for the query.

        totalRecords:
          type: number
          description: |
            The total number of records in the full set.

    Error:
      type: object
      properties:
        errorCode:
          type: string
          description: Error code identifying the problem occured
        errorMessage:
          type: string
          description: Message describing what problem has occured

  parameters:
    aspspId:
      name: o3-aspsp-id
      in: header
      schema:
        type: string
      required: true
      description: Identifier for the LFI that the request is targetted to

    callerOrgId:
      name: o3-caller-org-id
      in: header
      schema:
        type: string
      description: An identifier for the organization calling the API

    callerClientId:
      name: o3-caller-client-id
      in: header
      schema:
        type: string
      description: An identifier for the OIDC clientId calling the API

    callerSoftwareStatementId:
      name: o3-caller-software-statement-id
      in: header
      schema:
        type: string
      description: An identifier for the software statement calling the API

    apiUri:
      name: o3-api-uri
      in: header
      schema:
        type: string
      required: true
      description: The parameterised URL of the API being called by the caller

    apiOperation:
      name: o3-api-operation
      in: header
      schema:
        type: string
      required: true
      description: The API operation carried out by the caller (e.g. GET, POST, PUT, DELETE, PATCH)

    consentId:
      name: o3-consent-id
      in: header
      schema:
        type: string
      description: The consentId for which this call is being made

    callerInteractionId:
      name: o3-caller-interaction-id
      in: header
      schema:
        type: string
      description: The interaction ID passed in by the caller, if any

    ozoneInteractionId:
      name: o3-ozone-interaction-id
      in: header
      schema:
        type: string
      required: true
      description: An interaction ID generated by Ozone if the caller did not send in one. If the callerInteractionId is specified, this takes the same value.

    psuIdentifier:
      name: o3-psu-identifier
      in: header
      schema:
        type: string
      required: true
      description: A Base64 encoded representation of the psuIdentifier JSON object.

    pageNumber:
      name: page
      in: query
      schema:
        type: string
      description: Page number to be returned

    transaction-status:
      name: status
      in: query
      description: |
        If specified, the API should only return transactions that match the specified `status`.

        If this parameter is not specified, then all transactions irrespective of the status should be returned.

        ### Optionality
        This parameter is optional to support.

        If not supported by the LFI and the parameter is provided, LFIs must return an error.

      schema:
        type: string

    transaction-fromBookingDateTime:
      name: fromBookingDateTime
      in: query
      description: |
        If specified, the API should only return transactions which have a `bookingDateTime` that occours on or after the specified date-time.
      schema:
        type: string
        format: date

    transaction-toBookingDateTime:
      name: toBookingDateTime
      in: query
      description: |
        If specified, the API should only return transactions which have a `bookingDateTime` that occours on or before the specified date-time.
      schema:
        type: string
        format: date

    transaction-creditDebitIndicator:
      name: creditDebitIndicator
      in: query
      description: |
        If specified, the API should only return transactions that match the specified `creditDebitIndicator`.

        If this parameter is not specified, then all transactions irrespective of the status should be returned.

        This functionality is only required for Berlin Group & OBIE APIs.

        This query parameter can be used in the following ways:
         - If Credit or Debit has to be passed:
            - `creditDebitIndicator=Credit` or `creditDebitIndicator=Debit`

         - If both Credit and Debit have to be passed, it can be done in 2 ways:
             - `creditDebitIndicator=Credit&creditDebitIndicator=Debit` or
             - `creditDebitIndicator=Credit,Debit`

        ### Optionality
        This parameter is required for Berlin Group & OBIE APIs.

        If not supported by the LFI and the parameter is provided, LFIs must return an error.
      schema:
        $ref: "#/components/schemas/CreditDebitEnum"

    pagination-page:
      name: page
      in: query
      description: |
        The page of results to be returned.

        If the `page` parameter is not specified, the LFI may return either:
        - a complete set of unpaginated data. The `paginated` flag is set to `false`.
        - the first page of paginated data. The `paginated` flag is set to `true`. Optionally,
          number of pages are indicated in the `totalPages` attribute.

        ### Optionality
        This parameter is optional to support.

        If not supported by the LFI and the parameter is provided, LFIs must return an error.

      schema:
        type: number

    pagination-size:
      name: pageSize
      in: query
      description: |
        The number of results to be returned per page.

        ### Optionality
        This parameter is optional to support.

        If not supported by the LFI and the parameter is provided, LFIs must return an error.

      schema:
        type: number

  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

2. Attachments

View file
nameozone-connect-api-spec-ais-2024.07.0.yaml