type: object
description: |
  A bank account connected to the organisation. The `accountIdentifierScheme` field determines which
  identifier fields are populated, see description of particular fields.
properties:
  id:
    type: string
    format: uuid
    description: Unique identifier of the bank account.
    example: "1e3b42ec-587d-4fe5-8807-22c0235ee825"
  organisationId:
    type: string
    format: uuid
    description: Unique identifier of the organisation the bank account belongs to.
    example: "47aa12f6-acf9-455f-9f3b-400e5c7a4862"
  accountIdentifierScheme:
    $ref: '../../openapi.yaml#/components/schemas/BankAccountIdentifierScheme'
  iban:
    type: [string, "null"]
    description: International Bank Account Number. Populated when `accountIdentifierScheme` is `IBAN`.
    example: "DE89370400440532013000"
  accountNumber:
    type: [string, "null"]
    description: >-
      Account number (UK account number, US account number, etc.).
      Populated when `accountIdentifierScheme` is `UK_SORT_CODE`, `US_ACH`, `CH_BCN`,
      `SE_CLEARING`, `NO_BANK_ACCOUNT`, or `DK_REG_ACCOUNT`.
  sortCode:
    type: [string, "null"]
    description: Sort code. Populated when `accountIdentifierScheme` is `UK_SORT_CODE`.
    example: "200000"
  routingNumber:
    type: [string, "null"]
    description: Routing number. Populated when `accountIdentifierScheme` is `US_ACH`.
    example: "021000021"
  clearingNumber:
    type: [string, "null"]
    description: >-
      Clearing number.
      Populated when `accountIdentifierScheme` is `CH_BCN` or `SE_CLEARING`.
  registrationNumber:
    type: [string, "null"]
    description: Registration number. Populated when `accountIdentifierScheme` is `DK_REG_ACCOUNT`.
  accountId:
    type: [string, "null"]
    description: >-
      Account identifier.
      Populated when `accountIdentifierScheme` is `AMEX`, `PAYPAL`, or `MOSS`.
  name:
    type: string
    description: Display name of the bank account.
  currency:
    type: [string, "null"]
    description: ISO 4217 currency code for the currency of the bank account.
    example: "EUR"
  status:
    $ref: '../../openapi.yaml#/components/schemas/BankAccountV2Status'
  createTime:
    type: string
    format: date-time
    description: Timestamp when the bank account was created.
    example: "2021-01-30T12:01:02.345678Z"
  updateTime:
    type: string
    format: date-time
    description: Timestamp when the bank account was last updated.
    example: "2021-01-30T12:01:02.345678Z"
required:
  - id
  - organisationId
  - accountIdentifierScheme
  - name
  - status
  - createTime
  - updateTime
