{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/altoviz-com/json-schema/altoviz-com-bank-account-schema.json",
  "title": "BankAccount",
  "description": "Bank account",
  "x-generated": "2026-11-01",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/altoviz-com-openapi.json#/components/schemas/BankAccount",
  "type": "object",
  "properties": {
    "accountNumber": {
      "type": [
        "string",
        "null"
      ],
      "description": "Accounting account number",
      "readOnly": true
    },
    "balance": {
      "type": "number",
      "description": "Current balance, derived from the initial balance and every transaction since",
      "format": "double",
      "readOnly": true
    },
    "bankName": {
      "type": [
        "string",
        "null"
      ],
      "description": "Bank name"
    },
    "bic": {
      "type": [
        "string",
        "null"
      ],
      "description": "BIC"
    },
    "connected": {
      "type": "boolean",
      "description": "Whether this account is synchronized from a provider, which is exactly whether\nAltoviz.Api.Models.BankAccount.Provider is set.\n\nA connected account is read-only: `PUT` and `DELETE` on it are refused. Disconnect\nit in the Altoviz application first if you mean to take it over by hand.",
      "readOnly": true
    },
    "currency": {
      "type": [
        "string",
        "null"
      ],
      "description": "ISO currency code. Defaults to EUR."
    },
    "defaultPaymentMethod": {
      "$ref": "#/$defs/PaymentMethod"
    },
    "iban": {
      "type": [
        "string",
        "null"
      ],
      "description": "IBAN"
    },
    "id": {
      "type": "integer",
      "description": "Bank account ID",
      "format": "int32",
      "readOnly": true
    },
    "initialBalance": {
      "type": "number",
      "description": "Balance the account held before the first transaction Altoviz knows about. The running\n`balance` is derived from it, so changing it moves every balance after it.",
      "format": "double"
    },
    "isMain": {
      "type": "boolean",
      "description": "Whether this is the company's main account",
      "readOnly": true
    },
    "journalCode": {
      "type": [
        "string",
        "null"
      ],
      "description": "Accounting journal code",
      "readOnly": true
    },
    "lastUpdatedAt": {
      "type": [
        "string",
        "null"
      ],
      "description": "When the account was last synchronized with its provider",
      "format": "date-time",
      "readOnly": true
    },
    "logoUri": {
      "type": [
        "string",
        "null"
      ],
      "description": "Bank logo URL",
      "readOnly": true
    },
    "metadata": {
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": {
        "type": [
          "string",
          "null"
        ]
      },
      "description": "Metadata: free-form key/value pairs carried with the bank account, for an integration to keep\nits own identifiers and flags against it.\n\nSent as a PATCH, not a replacement: keys you send are added or updated, keys you leave out\nkeep whatever they held, and a key is removed only when you send it as `null`. Omitting\nthe property entirely leaves the whole bag untouched, and `\"\"` stores an empty value\nrather than removing the key."
    },
    "name": {
      "type": [
        "string",
        "null"
      ],
      "description": "Name"
    },
    "pendingTransactions": {
      "type": "integer",
      "description": "Transactions not yet reconciled with a document",
      "format": "int32",
      "readOnly": true
    },
    "pendingTransactionsTotal": {
      "type": "number",
      "description": "Total value of the transactions not yet reconciled",
      "format": "double",
      "readOnly": true
    },
    "provider": {
      "$ref": "#/$defs/BankAccountProvider"
    },
    "synchronizing": {
      "type": "boolean",
      "description": "Whether a synchronization is running",
      "readOnly": true
    }
  },
  "additionalProperties": false,
  "$defs": {
    "BankAccountProvider": {
      "type": "object",
      "properties": {
        "accountId": {
          "type": [
            "string",
            "null"
          ],
          "description": "The account's identifier at the provider",
          "readOnly": true
        },
        "accountStatus": {
          "type": [
            "string",
            "null"
          ],
          "description": "The connection's status as the provider last reported it",
          "readOnly": true
        },
        "bankName": {
          "type": [
            "string",
            "null"
          ],
          "description": "The bank name the provider reports, which may differ from the account's own",
          "readOnly": true
        },
        "type": {
          "$ref": "#/$defs/BankAccountType"
        }
      },
      "additionalProperties": false,
      "description": "The provider a bank account is synchronized from. Read-only throughout: a connection is\nestablished in the Altoviz application, never through this API."
    },
    "BankAccountType": {
      "enum": [
        "Standard",
        "Stripe",
        "GoCardless",
        "Paypal",
        "SumUp",
        "Linxo",
        "Other"
      ],
      "type": "string"
    },
    "PaymentMethod": {
      "enum": [
        "Transfer",
        "Order",
        "Check",
        "Cash",
        "Card",
        "Bill",
        "Usec",
        "Other"
      ],
      "type": "string"
    }
  }
}