{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/agentaos-ai/json-schema/agentaos-ai-bank-account-schema.json",
  "title": "BankAccount",
  "description": "A bank account as we keep it: a thin reference. The account number itself stays with our bank partner.",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/agentaos-ai-bank-accounts-api-openapi.yml#/components/schemas/BankAccount",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "currency": {
      "type": "string",
      "description": "Upper-case, `EUR` or `USD`."
    },
    "account_type": {
      "type": "string",
      "description": "The corridor: `iban`, `sort_code`, `aba`."
    },
    "account_identifier_last4": {
      "type": "string",
      "description": "The last four characters of the account number."
    },
    "account_holder_name": {
      "type": "string"
    },
    "legal_type": {
      "type": "string",
      "enum": [
        "PRIVATE",
        "BUSINESS"
      ]
    },
    "name_match_status": {
      "type": "string",
      "enum": [
        "success",
        "partial",
        "failed",
        "unknown"
      ],
      "description": "How the holder name compared with the name the bank holds, where the bank offers that check (not for every currency). `failed` is never paid; `partial` and `unknown` are paid."
    },
    "active": {
      "type": "boolean"
    },
    "payable": {
      "type": "boolean",
      "description": "Can the next payout go to this account right now: active, and the name check did not fail."
    },
    "payableReason": {
      "type": [
        "string",
        "null"
      ],
      "description": "When `payable` is false: why, in a sentence for the merchant."
    }
  },
  "required": [
    "id",
    "currency",
    "account_type",
    "account_identifier_last4",
    "account_holder_name",
    "legal_type",
    "name_match_status",
    "active",
    "payable",
    "payableReason"
  ]
}