openapi: 3.0.0
info:
  description: >
    This is the specification of the bLink 'account-information-service' module
    API. (as implemented by providers (e.g. financial institutions) and used by
    SIX) 
  version: 4.0.0.4-fi
  title: bLink API - account-information-service module
  contact:
    name: SIX BBS AG
    url: https://www.six-group.com/en/products-services/banking-services/blink.html
servers:
  - url: >-
      https://api.six-group.com/api/bankingservices/b-link-consent-2/account-information-service/v4
tags:
  - name: accounts
    description: >-
      Third party access to bank account service considering account information
      and transaction data operations (JSON).
  - name: iso20022
    description: >-
      Third party access to bank account service considering camt.053 operations
      (XML).
paths:
  /accounts:
    get:
      tags:
        - accounts
      summary: Retrieve list of authorized accounts
      description: Return the list of all accounts accessible for the logged in user.
      operationId: requestAccountList
      parameters:
        - $ref: '#/components/parameters/authorization_in_header'
        - $ref: '#/components/parameters/clientid_in_header'
        - $ref: '#/components/parameters/correlation_in_header'
        - $ref: '#/components/parameters/agent_in_header'
        - $ref: '#/components/parameters/optional_targetid_in_header'
        - $ref: '#/components/parameters/optional_psu_ip_in_header'
        - $ref: '#/components/parameters/optional_psu_user_agent_in_header'
      responses:
        '200':
          description: Returns a list of authorized accounts.
          headers:
            X-Correlation-ID:
              $ref: '#/components/headers/X-Correlation-ID'
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/accountItem'
        '400':
          $ref: '#/components/responses/standard400'
        '401':
          $ref: '#/components/responses/standard401'
        '403':
          $ref: '#/components/responses/standard403'
        '404':
          $ref: '#/components/responses/standard404'
        '405':
          $ref: '#/components/responses/standard405'
        '500':
          $ref: '#/components/responses/standard500'
        '501':
          $ref: '#/components/responses/standard501'
        '502':
          $ref: '#/components/responses/standard502'
        '503':
          $ref: '#/components/responses/standard503'
        '504':
          $ref: '#/components/responses/standard504'
  /accounts/{accountId}:
    get:
      tags:
        - accounts
      summary: Retrieve information about a single specific account
      description: Returns the accounts details of the specified account.
      operationId: requestAccountDetails
      parameters:
        - $ref: '#/components/parameters/path_accountId'
        - $ref: '#/components/parameters/authorization_in_header'
        - $ref: '#/components/parameters/clientid_in_header'
        - $ref: '#/components/parameters/correlation_in_header'
        - $ref: '#/components/parameters/agent_in_header'
        - $ref: '#/components/parameters/optional_targetid_in_header'
        - $ref: '#/components/parameters/optional_psu_ip_in_header'
        - $ref: '#/components/parameters/optional_psu_user_agent_in_header'
      responses:
        '200':
          description: Account details of the specified account.
          headers:
            X-Correlation-ID:
              $ref: '#/components/headers/X-Correlation-ID'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/accountItem'
        '400':
          $ref: '#/components/responses/standard400'
        '401':
          $ref: '#/components/responses/standard401'
        '403':
          $ref: '#/components/responses/standard403'
        '404':
          $ref: '#/components/responses/standard404'
        '405':
          $ref: '#/components/responses/standard405'
        '500':
          $ref: '#/components/responses/standard500'
        '501':
          $ref: '#/components/responses/standard501'
        '502':
          $ref: '#/components/responses/standard502'
        '503':
          $ref: '#/components/responses/standard503'
        '504':
          $ref: '#/components/responses/standard504'
  /accounts/{accountId}/balance:
    get:
      tags:
        - accounts
      summary: Retrieve account balance information
      operationId: requestAccountBalance
      description: >
        Returns account balance information of the specified account.

        * Returns the intraday booked balance (ITBD) for the current day, if
        called without a date.

        * Returns the closing booked balance (CLBD) for a specific day, if
        called for a past date (i.e. the closing booked balance (CLBD) of that
        day). In case the specified day has not yet been finalized, the response
        code will be 202.
      parameters:
        - $ref: '#/components/parameters/authorization_in_header'
        - $ref: '#/components/parameters/path_accountId'
        - $ref: '#/components/parameters/query_date'
        - $ref: '#/components/parameters/clientid_in_header'
        - $ref: '#/components/parameters/correlation_in_header'
        - $ref: '#/components/parameters/agent_in_header'
        - $ref: '#/components/parameters/optional_targetid_in_header'
        - $ref: '#/components/parameters/optional_psu_ip_in_header'
        - $ref: '#/components/parameters/optional_psu_user_agent_in_header'
      responses:
        '200':
          description: Account balance information of the specified account.
          headers:
            X-Correlation-ID:
              $ref: '#/components/headers/X-Correlation-ID'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/accountBalanceItem'
        '202':
          $ref: '#/components/responses/standard202'
        '204':
          $ref: '#/components/responses/standard204'
        '400':
          $ref: '#/components/responses/standard400'
        '401':
          $ref: '#/components/responses/standard401'
        '403':
          $ref: '#/components/responses/standard403'
        '404':
          $ref: '#/components/responses/standard404'
        '405':
          $ref: '#/components/responses/standard405'
        '500':
          $ref: '#/components/responses/standard500'
        '501':
          $ref: '#/components/responses/standard501'
        '502':
          $ref: '#/components/responses/standard502'
        '503':
          $ref: '#/components/responses/standard503'
        '504':
          $ref: '#/components/responses/standard504'
  /accounts/{accountId}/transactions:
    get:
      tags:
        - accounts
      summary: Retrieve transactions of a specific account
      operationId: requestAccountTransactions
      description: >
        Returns the transaction list of the specified account. Only postings
        with status booked will be returned.

        * Returns the transaction list of the current day, if called without a
        date.

        * Returns the transaction list for a specific day, if called for a past
        date (i.e. all transactions from that day). In case the specified day is
        not yet finalized, the response code will be 202.
      parameters:
        - $ref: '#/components/parameters/authorization_in_header'
        - $ref: '#/components/parameters/path_accountId'
        - $ref: '#/components/parameters/query_date'
        - $ref: '#/components/parameters/clientid_in_header'
        - $ref: '#/components/parameters/correlation_in_header'
        - $ref: '#/components/parameters/agent_in_header'
        - $ref: '#/components/parameters/optional_targetid_in_header'
        - $ref: '#/components/parameters/optional_psu_ip_in_header'
        - $ref: '#/components/parameters/optional_psu_user_agent_in_header'
      responses:
        '200':
          description: Returns transactions of an account.
          headers:
            X-Correlation-ID:
              $ref: '#/components/headers/X-Correlation-ID'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/accountTransactionReport'
        '202':
          $ref: '#/components/responses/standard202'
        '204':
          $ref: '#/components/responses/standard204'
        '400':
          $ref: '#/components/responses/standard400'
        '401':
          $ref: '#/components/responses/standard401'
        '403':
          $ref: '#/components/responses/standard403'
        '404':
          $ref: '#/components/responses/standard404'
        '405':
          $ref: '#/components/responses/standard405'
        '500':
          $ref: '#/components/responses/standard500'
        '501':
          $ref: '#/components/responses/standard501'
        '502':
          $ref: '#/components/responses/standard502'
        '503':
          $ref: '#/components/responses/standard503'
        '504':
          $ref: '#/components/responses/standard504'
  /iso20022/statements:
    get:
      tags:
        - iso20022
      summary: Retrieve a list of resource links to account statements (CAMT.053)
      description: >
        Get the resources links to available account statements (camt.053). The
        returned account statements must be conform to the XML schema and
        implementation guidelines defined by Swiss Payment Standards.
          * bLink supports account statements only in XML-Schema «camt.053.001.08»
      operationId: retrieveIso20022AccountStatementIds
      parameters:
        - $ref: '#/components/parameters/authorization_in_header'
        - $ref: '#/components/parameters/clientid_in_header'
        - $ref: '#/components/parameters/correlation_in_header'
        - $ref: '#/components/parameters/agent_in_header'
        - $ref: '#/components/parameters/optional_targetid_in_header'
        - $ref: '#/components/parameters/optional_psu_ip_in_header'
        - $ref: '#/components/parameters/optional_psu_user_agent_in_header'
      responses:
        '200':
          description: Returns a list of resource links to ISO20022 XML camt.053 messages.
          headers:
            X-Correlation-ID:
              $ref: '#/components/headers/X-Correlation-ID'
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/iso20022ReportReference'
        '400':
          $ref: '#/components/responses/standard400'
        '401':
          $ref: '#/components/responses/standard401'
        '403':
          $ref: '#/components/responses/standard403'
        '404':
          $ref: '#/components/responses/standard404'
        '405':
          $ref: '#/components/responses/standard405'
        '500':
          $ref: '#/components/responses/standard500'
        '501':
          $ref: '#/components/responses/standard501'
        '502':
          $ref: '#/components/responses/standard502'
        '503':
          $ref: '#/components/responses/standard503'
        '504':
          $ref: '#/components/responses/standard504'
  /iso20022/statements/{reportId}:
    get:
      tags:
        - iso20022
      summary: Retrieves the designated ISO20022 XML CAMT document.
      operationId: retrieveIso20022AccountStatement
      parameters:
        - $ref: '#/components/parameters/path_reportId'
        - $ref: '#/components/parameters/authorization_in_header'
        - $ref: '#/components/parameters/clientid_in_header'
        - $ref: '#/components/parameters/correlation_in_header'
        - $ref: '#/components/parameters/agent_in_header'
        - $ref: '#/components/parameters/optional_targetid_in_header'
        - $ref: '#/components/parameters/optional_psu_ip_in_header'
        - $ref: '#/components/parameters/optional_psu_user_agent_in_header'
      responses:
        '200':
          description: >
            Returns the requested ISO20022 XML camt.053 message.

            * bLink supports account statements only in XML-Schema
            «camt.053.001.08». 

            Invalid schemas will result in an error to the client.
          headers:
            X-Correlation-ID:
              $ref: '#/components/headers/X-Correlation-ID'
          content:
            application/xml:
              schema:
                type: string
                format: binary
        '400':
          $ref: '#/components/responses/standard400'
        '401':
          $ref: '#/components/responses/standard401'
        '403':
          $ref: '#/components/responses/standard403'
        '404':
          $ref: '#/components/responses/standard404'
        '405':
          $ref: '#/components/responses/standard405'
        '500':
          $ref: '#/components/responses/standard500'
        '501':
          $ref: '#/components/responses/standard501'
        '502':
          $ref: '#/components/responses/standard502'
        '503':
          $ref: '#/components/responses/standard503'
        '504':
          $ref: '#/components/responses/standard504'
  /consents:
    get:
      tags:
        - consents
      summary: Retrieve a list of consents
      description: >
        The consents endpoint allows the client (e.g., a third party provider)
        to query the consents for a given corporate user. The provider (e.g., a
        financial institution) must return the consents linked with the access
        token supplied with the request.
      operationId: retrieveConsents
      parameters:
        - $ref: '#/components/parameters/authorization_in_header'
        - $ref: '#/components/parameters/clientid_in_header'
        - $ref: '#/components/parameters/correlation_in_header'
        - $ref: '#/components/parameters/agent_in_header'
        - $ref: '#/components/parameters/optional_targetid_in_header'
        - $ref: '#/components/parameters/optional_psu_ip_in_header'
        - $ref: '#/components/parameters/optional_psu_user_agent_in_header'
      responses:
        '200':
          description: List of consents
          headers:
            X-Correlation-ID:
              $ref: '#/components/headers/X-Correlation-ID'
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/consentAccountItem'
        '400':
          $ref: '#/components/responses/standard400'
        '401':
          $ref: '#/components/responses/standard401'
        '403':
          $ref: '#/components/responses/standard403'
        '404':
          $ref: '#/components/responses/standard404'
        '405':
          $ref: '#/components/responses/standard405'
        '500':
          $ref: '#/components/responses/standard500'
        '501':
          $ref: '#/components/responses/standard501'
        '502':
          $ref: '#/components/responses/standard502'
        '503':
          $ref: '#/components/responses/standard503'
        '504':
          $ref: '#/components/responses/standard504'
  /healthcheck:
    get:
      tags:
        - diagnostics
      summary: >-
        Returns all specified request headers and additional diagnostic
        information
      operationId: healthCheckGet
      parameters:
        - $ref: '#/components/parameters/optional_correlation_in_header'
        - $ref: '#/components/parameters/optional_authorization_in_header'
        - $ref: '#/components/parameters/optional_agent_in_header'
        - $ref: '#/components/parameters/optional_targetid_in_header'
        - $ref: '#/components/parameters/clientid_in_header'
        - $ref: '#/components/parameters/optional_psu_ip_in_header'
        - $ref: '#/components/parameters/optional_psu_user_agent_in_header'
      responses:
        '200':
          description: Health Check Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/healthCheckResponse'
components:
  schemas:
    accountItem:
      title: Account Information Item
      type: object
      required:
        - accountOwner
        - id
        - account
        - currency
      properties:
        id:
          $ref: '#/components/schemas/commonAccountId'
        account:
          $ref: '#/components/schemas/paymentIbanAccount'
        accountOwner:
          maxLength: 140
          type: string
          example: Account Owner XYZ
        currency:
          type: string
          minLength: 3
          maxLength: 3
          example: CHF
        allowedCurrencies:
          type: array
          items:
            type: string
            example: CHF
        designation:
          type: string
          maxLength: 140
          description: >-
            This element shall always be populated with the account alias, if
            defined, otherwise with specific bank account name (e.g. bank saving
            account).
          example: Firmenkonto
        accountTypeCode:
          type: string
          description: >
            Contains the account type code according to the ISO external cash
            account type code list. It is strongly recommended to use only the 5
            codes below as follows:

            LOAN: Account used for loans (loan and mortgage accounts) - DE:
            Darlehenskonto, Kreditkonto, Baukreditkonto, Hypothekarkonto

            LLSV: Account used for savings with special interest and withdrawal
            terms (pension provision and vested benefits accounts) - DE:
            Vorsorge- und Freizügigkeitskonten

            SVGS: Account used for savings (all types of saving accounts)

            TRAN: Account used for transactions (all types of personal, current
            and payment accounts) - DE: Privat-, Kontokorent- und
            Zahlungsverkehrskonten

            OTHR: Account not otherwise specified (gathering pool for all other
            accounts)
          example: TRAN
          enum:
            - CACC
            - CARD
            - CASH
            - CHAR
            - CISH
            - COMM
            - CPAC
            - LLSV
            - LOAN
            - MGLD
            - MOMA
            - NFCA
            - NREX
            - ODFT
            - ONDP
            - OTHR
            - SACC
            - SLRY
            - SVGS
            - TAXE
            - TRAN
            - TRAS
            - VACC
        _links:
          type: object
          description: >-
            Contains the paths to additional resources for specific account
            (e.g. path to transactions resource)
          properties:
            self:
              type: string
              example: /accounts/550e8400-e29b-11d4-a716-446655440000
            balance:
              type: string
              example: /accounts/550e8400-e29b-11d4-a716-446655440000/balance
            transactions:
              type: string
              example: /accounts/550e8400-e29b-11d4-a716-446655440000/transactions
    commonAccountId:
      type: string
      pattern: '[A-Za-z0-9](([A-Za-z0-9._]|-){0,254}[A-Za-z0-9]){0,1}'
      maxLength: 256
      example: abc123_abcxyz.123789.abcxyz.abcxyz_abcxyz_abcxyz_abcxyz_ccccc_123abc
    accountBalanceItem:
      title: Account Balance Item
      type: object
      required:
        - date
        - balanceType
        - balance
      properties:
        date:
          $ref: '#/components/schemas/date'
        balanceType:
          type: string
          enum:
            - ITBD
            - CLBD
          example: CLBD
        balance:
          $ref: '#/components/schemas/balanceCurrencyAmount'
        _links:
          type: object
          description: >-
            contains the paths to additional resources for specific account
            (e.g. path to transactions resource)
          properties:
            self:
              type: string
              example: /accounts/550e8400-e29b-11d4-a716-446655440000/balance
            account:
              type: string
              example: /accounts/550e8400-e29b-11d4-a716-446655440000
            transactions:
              type: string
              example: /accounts/550e8400-e29b-11d4-a716-446655440000/transactions
    accountTransactionReport:
      title: Account Transaction Report
      type: object
      required:
        - iban
        - entries
      properties:
        iban:
          type: string
          maxLength: 34
          pattern: '[A-Z]{2,2}[0-9]{2,2}[a-zA-Z0-9]{1,30}'
          example: CH5481230000001998736
        designation:
          type: string
          maxLength: 140
          example: Checking Account
        entries:
          type: array
          items:
            $ref: '#/components/schemas/accountTransactionEntry'
        _links:
          type: object
          properties:
            self:
              type: string
              example: /accounts/550e8400e29b11d4a716446655440000/statements
            account:
              type: string
              example: /accounts/550e8400e29b11d4a716446655440000
            balance:
              type: string
              example: /accounts/550e8400e29b11d4a716446655440000/balance
    accountTransactionEntry:
      title: Account Transaction Entry
      type: object
      required:
        - entryId
        - transactionType
        - bookingDate
        - valueDate
        - amount
        - bankTransactionCode
        - additionalEntryInformation
      properties:
        entryId:
          type: string
          example: ENTRY123456789
        transactionType:
          $ref: '#/components/schemas/accountTransactionTransactionType'
        entryReference:
          type: string
          example: '010001628'
          maxLength: 35
        entryReferenceInternalId:
          type: string
          maxLength: 35
          example: '010001628'
        reversalIndicator:
          type: boolean
        bookingDate:
          $ref: '#/components/schemas/date'
        valueDate:
          $ref: '#/components/schemas/date'
        amount:
          $ref: '#/components/schemas/paymentCurrencyAmount'
        instructedAmount:
          $ref: '#/components/schemas/accountTransactionInstructedAmount'
        totalChargesAmount:
          $ref: '#/components/schemas/accountTransactionItemCharges'
        bankTransactionCode:
          $ref: '#/components/schemas/accountTransactionBankTransactionCode'
        additionalEntryInformation:
          type: string
        transactions:
          type: array
          items:
            $ref: '#/components/schemas/accountTransactionItem'
    accountTransactionItem:
      title: Account Transaction Item
      type: object
      required:
        - transactionId
        - transactionType
        - amount
      properties:
        transactionId:
          type: string
          maxLength: 35
          example: TX12345A987
        transactionType:
          $ref: '#/components/schemas/accountTransactionTransactionType'
        endToEndId:
          type: string
          maxLength: 35
          example: ENDTOENDID-01
        bankTransactionCode:
          $ref: '#/components/schemas/accountTransactionBankTransactionCode'
        amount:
          $ref: '#/components/schemas/paymentCurrencyAmount'
        instructedAmount:
          $ref: '#/components/schemas/accountTransactionInstructedAmount'
        totalChargesAmount:
          $ref: '#/components/schemas/accountTransactionItemCharges'
        counterparty:
          $ref: '#/components/schemas/accountTransactionCounterparty'
        remittanceInformation:
          $ref: '#/components/schemas/paymentRemittanceInformation'
        remittanceReference:
          $ref: '#/components/schemas/accountTransactionRemittanceReference'
        additionalTransactionInformation:
          type: string
          maxLength: 140
    accountTransactionItemCharges:
      title: Account Transaction Item Charges
      type: object
      required:
        - amount
        - currency
      properties:
        amount:
          type: string
          pattern: '[0-9]{1,12}([.][0-9]{1,5})?'
          maxLength: 18
          example: '10.25'
        currency:
          type: string
          maxLength: 3
          minLength: 3
          example: CHF
        chargeRecords:
          type: array
          items:
            $ref: '#/components/schemas/accountTransactionItemChargesRecord'
    accountTransactionItemChargesRecord:
      title: Account Transaction Item Charges Record
      type: object
      properties:
        amount:
          type: string
          pattern: '[0-9]{1,12}([.][0-9]{1,5})?'
          maxLength: 18
          example: '10.25'
        currency:
          type: string
          minLength: 3
          maxLength: 3
          example: CHF
        type:
          type: string
          maxLength: 35
          example: Some type of charge
        chargesIncludedIndicator:
          type: boolean
    accountTransactionCounterparty:
      title: Account Transaction Counterparty
      type: object
      properties:
        name:
          type: string
          maxLength: 140
          example: Hans Muster
        postalAddress:
          $ref: >-
            #/components/schemas/accountTransactionStructuredOrUnstructuredAddress
        account:
          $ref: '#/components/schemas/accountTransactionCounterpartyAccount'
        agent:
          $ref: '#/components/schemas/accountTransactionCounterpartyAgent'
    accountTransactionCounterpartyAgent:
      title: Account Transaction Counterparty Agent
      type: object
      properties:
        bic:
          type: string
          maxLength: 11
        clearingSystemMemberIdentification:
          $ref: '#/components/schemas/commonClearingSystemMemberIdentification'
    accountTransactionInstructedAmount:
      title: Account Transaction Instructed Amount
      type: object
      required:
        - amount
        - sourceCurrency
        - targetCurrency
      properties:
        amount:
          type: string
          pattern: '[0-9]{1,12}([.][0-9]{1,5})?'
          maxLength: 18
          example: '10.25'
        sourceCurrency:
          type: string
          minLength: 3
          maxLength: 3
          example: CHF
        targetCurrency:
          type: string
          minLength: 3
          maxLength: 3
          example: USD
        exchangeRate:
          type: string
          example: '0.957'
          pattern: ^\d{1,11}$|^(?=\d+[.]\d+$).{3,12}$
          maxLength: 12
        exchangeIndicator:
          type: string
          maxLength: 4
          example: MULT
    accountTransactionBankTransactionCode:
      title: Account Transaction Bank Transaction Code
      type: object
      required:
        - domainCode
        - familyCode
        - subFamilyCode
      properties:
        domainCode:
          type: string
          maxLength: 4
          example: PMNT
        familyCode:
          type: string
          maxLength: 4
          example: RCDT
        subFamilyCode:
          type: string
          maxLength: 4
          example: DMCT
    accountTransactionTransactionType:
      title: Account Transaction Transaction Type
      type: string
      enum:
        - CRDT
        - DBIT
      example: CRDT
    accountTransactionCounterpartyAccount:
      title: Account Transaction Counterparty Account
      type: object
      required:
        - type
        - identification
      properties:
        type:
          type: string
          enum:
            - IBAN
            - OTHER
        identification:
          type: string
          maxLength: 35
          example: CH9300762011623852957
    accountTransactionRemittanceReference:
      title: Account Transaction Remittance Reference
      type: object
      properties:
        type:
          type: string
          enum:
            - SCOR
            - ISR
            - QRR
        reference:
          type: string
          maxLength: 35
          example: '210000000003139471430009017'
    accountTransactionStructuredAddress:
      title: Structured Postal Address for Transactions
      type: object
      required:
        - streetName
        - postCode
        - townName
      properties:
        streetName:
          type: string
          maxLength: 70
          example: Rue de la gare
        buildingNumber:
          type: string
          maxLength: 16
          example: '24'
        postCode:
          type: string
          maxLength: 16
          example: '2501'
        townName:
          type: string
          maxLength: 35
          example: Biel
        country:
          type: string
          maxLength: 2
          example: CH
    accountTransactionUnstructuredAddress:
      title: Unstructured Address for Transactions
      type: object
      required:
        - addressLines
      properties:
        addressLines:
          type: array
          description: max 4 lines of 70 characters
          maxItems: 4
          example:
            - Robert Schneider SA
            - Rue de la gare 24
          items:
            type: string
            maxLength: 70
        country:
          type: string
          maxLength: 2
          example: CH
    accountTransactionStructuredOrUnstructuredAddress:
      title: Common Structured or Unstructured Address
      type: object
      properties:
        structured:
          $ref: '#/components/schemas/accountTransactionStructuredAddress'
        unstructured:
          $ref: '#/components/schemas/accountTransactionUnstructuredAddress'
    balanceCurrencyAmount:
      title: Balance Currency-Amount
      type: object
      required:
        - currency
        - amount
      properties:
        currency:
          type: string
          minLength: 3
          maxLength: 3
          example: CHF
        amount:
          type: string
          pattern: '-?[0-9]{1,12}([.][0-9]{1,5})?'
          maxLength: 18
          example: '10.25'
    iso20022ReportReference:
      title: ISO 20022 Report Reference
      type: object
      properties:
        name:
          type: string
        description:
          type: string
        type:
          type: string
          enum:
            - CAMT53
        schemaVersion:
          type: string
          example: camt.053.001.08
          description: Indicates the delivered camt.053 schema version.
          pattern: camt\.053\.[0-9]{3}\.[0-9]{2}
        id:
          type: string
        account:
          $ref: '#/components/schemas/paymentIbanAccount'
        dateFrom:
          $ref: '#/components/schemas/date'
        dateTo:
          $ref: '#/components/schemas/date'
    paymentIbanAccount:
      title: Payment IBAN Account
      type: object
      required:
        - type
        - identification
      properties:
        type:
          type: string
          description: >-
            The allowed account identification type for the creditor account
            depends on the payment type. The debtor account must always be an
            IBAN.
          enum:
            - IBAN
        identification:
          type: string
          maxLength: 34
          pattern: '[A-Z]{2,2}[0-9]{2,2}[a-zA-Z0-9]{1,30}'
          example: CH9300762011623852957
    paymentCurrencyAmount:
      title: Payment Currency-Amount
      type: object
      required:
        - currency
        - amount
      properties:
        currency:
          type: string
          maxLength: 3
          minLength: 3
          example: CHF
        amount:
          type: string
          pattern: '[0-9]{1,12}([.][0-9]{1,5})?'
          maxLength: 18
          example: '10.25'
    paymentRemittanceInformation:
      title: Payment Remittance Information
      description: Either remittanceReference or remittanceInformation must be set
      type: string
      maxLength: 140
      example: Rechnung Nr. 408
    commonClearingSystemMemberIdentification:
      title: Common Clearing System Member Identification
      type: object
      required:
        - code
        - memberId
      properties:
        code:
          type: string
          maxLength: 5
          example: CHBCC
        memberId:
          type: string
          maxLength: 35
          example: '00230'
    date:
      type: string
      format: date
      example: '2018-04-13'
    dateTime:
      type: string
      format: date-time
      example: '2018-04-13T11:11:11Z'
    consentAccountItem:
      title: Consent Account Item
      required:
        - accountId
        - currency
        - iban
        - accountOwner
      type: object
      properties:
        accountId:
          type: string
          example: '13579'
        iban:
          maxLength: 34
          pattern: '[A-Z]{2,2}[0-9]{2,2}[a-zA-Z0-9]{1,30}'
          type: string
          example: CH9300762011623852957
        currency:
          maxLength: 3
          minLength: 3
          type: string
          example: CHF
        accountOwner:
          maxLength: 140
          type: string
          example: Account Owner XYZ
        designation:
          type: string
          example: Savings ABC
        allowedCurrencies:
          type: array
          items:
            type: string
            example: CHF
    healthCheckResponse:
      title: Health Check Response
      type: object
      properties:
        requestDateTime:
          title: Request Time
          type: string
          format: date-time
          example: '2018-04-13T11:11:11Z'
        receivedHeaders:
          title: Received Headers
          type: array
          items:
            type: object
            properties:
              headerName:
                type: string
                example: X-Correlation-ID
              headerValue:
                type: string
                description: As received
        receivedPayload:
          title: Received Payload
          type: string
          example: ... as received ...
    commonErrorResponse:
      title: Common Error Response
      type: object
      properties:
        type:
          $ref: '#/components/schemas/commonErrorType'
        title:
          type: string
          example: This is the general problem description
        detail:
          type: string
          example: >-
            Detailed problem description with respect to the current request,
            e.g., invalid account number format
        instance:
          type: string
          example: path/to/corresponding/resource
    commonErrorType:
      title: Common Error Type
      type: string
      description: >-
        Error Types for commonErrorResponse. See Appendix for detailed
        information.
      example: /problems/TECHNICAL_ERROR
      enum:
        - /problems/INVALID_PAYLOAD
        - /problems/MALFORMED_PAYLOAD
        - /problems/INVALID_TOKEN
        - /problems/EXPIRED_TOKEN
        - /problems/INSUFFICIENT_PRIVILEGES
        - /problems/NO_ACCESS_TO_RESOURCE
        - /problems/RESOURCE_DOES_NOT_EXIST
        - /problems/RESOURCE_NOT_READY
        - /problems/RESOURCE_TOO_LARGE
        - /problems/WRONG_METHOD
        - /problems/OPERATION_NOT_ALLOWED
        - /problems/TECHNICAL_ERROR
        - /problems/NOT_IMPLEMENTED
  parameters:
    path_accountId:
      name: accountId
      in: path
      description: id of account
      required: true
      schema:
        maxLength: 256
        pattern: '[A-Za-z0-9](([A-Za-z0-9._]|-){0,254}[A-Za-z0-9]){0,1}'
        type: string
    path_reportId:
      name: reportId
      in: path
      description: id of report
      required: true
      schema:
        maxLength: 35
        type: string
    query_date:
      name: date
      in: query
      description: 'The date to query, formatted as yyyy-mm-dd. Default value: current date'
      schema:
        type: string
        format: date
    clientid_in_header:
      name: X-CorAPI-Client-ID
      in: header
      description: 'ID of the client forwarded to the provider. (SCOPE: FI)'
      required: true
      schema:
        type: string
    authorization_in_header:
      name: Authorization
      in: header
      description: Bearer followed by a base64 encoded OAuth access token
      required: true
      schema:
        type: string
    correlation_in_header:
      name: X-Correlation-ID
      in: header
      description: >-
        Unique ID (defined by the caller) which will be reflected back in the
        response.
      required: true
      schema:
        type: string
        maxLength: 64
    agent_in_header:
      name: User-Agent
      in: header
      description: Name and version of the of the Client software
      required: true
      schema:
        type: string
    optional_authorization_in_header:
      name: Authorization
      in: header
      description: Bearer followed by a base64 encoded OAuth access token
      required: false
      schema:
        type: string
    optional_agent_in_header:
      name: User-Agent
      in: header
      description: Name and version of the of the client software
      required: false
      schema:
        type: string
    optional_targetid_in_header:
      name: X-CorAPI-Target-ID
      in: header
      description: 'ID of the target, e.g., a financial institution. (SCOPE: FI - optional)'
      required: false
      schema:
        type: string
    optional_correlation_in_header:
      name: X-Correlation-ID
      in: header
      description: >-
        Unique ID (defined by the caller) which will be reflected back in the
        response.
      required: false
      schema:
        type: string
        maxLength: 64
    optional_psu_ip_in_header:
      name: X-PSU-IP-Address
      in: header
      description: 'IP address of the user initiating the operation (SCOPE: FI - optional)'
      required: false
      schema:
        type: string
    optional_psu_user_agent_in_header:
      name: X-PSU-User-Agent
      in: header
      description: 'User of the client software (SCOPE: FI - optional)'
      required: false
      schema:
        type: string
  headers:
    Content-Language:
      description: always en
      schema:
        type: string
    X-Correlation-ID:
      description: >-
        Client defined ID from request to correlate HTTP requests between a
        client and a server
      schema:
        type: string
        maxLength: 64
        example: f058ebd6-02f7-4d3f-942e-904344e8cde5
    X-CorAPI-Source:
      description: >
        Indicates whether the response was created by the bLink platform or by
        the provider.
      schema:
        type: string
        enum:
          - PLATFORM
          - PROVIDER
    WWW-Authenticate:
      description: i.e. "Bearer error='invalid_token'" according to RFC6750 section-3
      schema:
        type: string
  responses:
    standard202:
      headers:
        Content-Language:
          $ref: '#/components/headers/Content-Language'
        X-Correlation-ID:
          $ref: '#/components/headers/X-Correlation-ID'
      description: >
        Accepted - Valid request, requested data not available yet. The request
        may be attempted at a later time.
      content:
        application/json:
          schema:
            type: object
    standard204:
      headers:
        X-Correlation-ID:
          $ref: '#/components/headers/X-Correlation-ID'
      description: >
        No content - The server has successfully fulfilled the request. There is
        no content to return and never will be.
    standard400:
      headers:
        Content-Language:
          $ref: '#/components/headers/Content-Language'
        WWW-Authenticate:
          $ref: '#/components/headers/WWW-Authenticate'
        X-Correlation-ID:
          $ref: '#/components/headers/X-Correlation-ID'
      description: |
        Bad Request - The format of the request was invalid.

        Examples: 
        - InvalidPayload:  
        type: /problems/INVALID_PAYLOAD  
        title: Payload does not comply with API specification  
        detail: Malformed JSON  
        instance: path/to/corresponding/resource

        - MissingId:  
        type: /problems/INVALID_PAYLOAD  
        title: The payload was not valid  
        detail: ID is missing  
        instance: path/to/corresponding/resource

        - InvalidParameter:  
        type: /problems/MALFORMED_PAYLOAD  
        title: Invalid parameter values have been detected  
        detail: Data for date in the future cannot be requested  
        instance: path/to/corresponding/resource

        - NoFutureDateSupported:
        type: /problems/MALFORMED_PAYLOAD
        title: Invalid parameter values have been detected
        detail: Data for date in the future cannot be requested
        instance: path/to/corresponding/resource
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/commonErrorResponse'
    standard401:
      headers:
        Content-Language:
          $ref: '#/components/headers/Content-Language'
        WWW-Authenticate:
          $ref: '#/components/headers/WWW-Authenticate'
        X-Correlation-ID:
          $ref: '#/components/headers/X-Correlation-ID'
      description: >-
        Unauthorized - Either no token or an invalid (e.g., token expired) token
        was received.
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/commonErrorResponse'
    standard403:
      headers:
        Content-Language:
          $ref: '#/components/headers/Content-Language'
        WWW-Authenticate:
          $ref: '#/components/headers/WWW-Authenticate'
        X-Correlation-ID:
          $ref: '#/components/headers/X-Correlation-ID'
      description: >
        Forbidden - A valid OAuth Token was received, but access was denied.
        (Depending on the security requirements, providers can return 404
        instead)


        Examples:

        - InsufficientPrivileges:  

        type: /problems/INSUFFICIENT_PRIVILEGES  

        title: No privileges for the requested operation  

        detail: Insufficient privileges for the requested operation  

        instance: path/to/corresponding/resource  


        - ExpiredToken:  

        type: /problems/EXPIRED_TOKEN  

        title: The OAuth Token is expired  

        detail: The token is no longer valid  

        instance: path/to/corresponding/resource
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/commonErrorResponse'
    standard404:
      headers:
        Content-Language:
          $ref: '#/components/headers/Content-Language'
        X-Correlation-ID:
          $ref: '#/components/headers/X-Correlation-ID'
      description: >
        Not Found - Either the endpoint does not exist or a requested resource
        is not yet available (e.g., account statements)


        Examples:

        - InvalidAccounts:  

        type: /problems/INSUFFICIENT_PRIVILEGES  

        title: Insufficient privileges to access resource  

        detail: The provided token does not grant access to the requested
        account  

        instance: path/to/corresponding/resource  


        - InvalidToken:  

        type: /problems/INSUFFICIENT_PRIVILEGES  

        title: Insufficient privileges to access resource  

        detail: The provided token is not valid  

        instance: path/to/corresponding/resource  


        - WrongEndpointUrl:  

        type: /problems/TECHNICAL_ERROR  

        title: URL not found  

        detail: The requested endpoint does not exist  

        instance: path/to/corresponding/resource  


        - NoIntradayDataSupported:  

        type: /problems/NOT_IMPLEMENTED  

        title: Feature is not implemented  

        detail: This interface does not support intraday data

        instance: path/to/corresponding/resource
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/commonErrorResponse'
    standard405:
      headers:
        Content-Language:
          $ref: '#/components/headers/Content-Language'
        X-Correlation-ID:
          $ref: '#/components/headers/X-Correlation-ID'
      description: >
        Method Not Allowed - The method received in the request-line is known by
        the origin server but not supported by the target resource.


        Examples:

        - NotSupportedOperation:  

        type: /problems/WRONG_METHOD  

        title: This HTTP operation is not allowed on this endpoint  

        detail: Only GET operations are allowed  

        instance: path/to/corresponding/resource
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/commonErrorResponse'
    standard500:
      headers:
        Content-Language:
          $ref: '#/components/headers/Content-Language'
        X-Correlation-ID:
          $ref: '#/components/headers/X-Correlation-ID'
      description: >
        Internal Server Error - The server encountered an unexpected condition
        that prevented it from fulfilling the request.


        Examples:

        - TechnicalServerError:  

        type: /problems/TECHNICAL_ERROR  

        title: Technical error on server side  

        detail: Processing yielded a technical error  

        instance: path/to/corresponding/resource  


        - ResourceTooLarge:  

        type: /problems/RESOURCE_TOO_LARGE  

        title: Generated resource was too large  

        detail: The generated resource exceeded the size limit  

        instance: path/to/corresponding/resource
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/commonErrorResponse'
    standard501:
      headers:
        Content-Language:
          $ref: '#/components/headers/Content-Language'
        X-Correlation-ID:
          $ref: '#/components/headers/X-Correlation-ID'
      description: >
        Not Implemented - The server does not support the functionality required
        to fulfill the request.


        Examples:  

        - EndpointNotImplemented:  

        type: /problems/NOT_IMPLEMENTED  

        title: Target endpoint is not implemented  

        detail: This endpoint is not implemented  

        instance: path/to/corresponding/resource
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/commonErrorResponse'
    standard502:
      headers:
        Content-Language:
          $ref: '#/components/headers/Content-Language'
        X-Correlation-ID:
          $ref: '#/components/headers/X-Correlation-ID'
      description: >-
        Bad Gateway - The server received an invalid response from the upstream
        server.
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/commonErrorResponse'
    standard503:
      headers:
        Content-Language:
          $ref: '#/components/headers/Content-Language'
        X-Correlation-ID:
          $ref: '#/components/headers/X-Correlation-ID'
      description: >-
        Service Unavailable - The server is currently unable to handle the
        request due to a temporary overload or scheduled maintenance.
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/commonErrorResponse'
    standard504:
      headers:
        Content-Language:
          $ref: '#/components/headers/Content-Language'
        X-Correlation-ID:
          $ref: '#/components/headers/X-Correlation-ID'
      description: >-
        Gateway Timeout - The server did not get a response in time that it
        needed in order to complete the request.
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/commonErrorResponse'
