{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/doorloop/json-schema/doorloop-account-schema.json",
  "title": "Account",
  "description": "Represents an account from the Chart of Accounts",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/doorloop-accounts-api-openapi.yml#/components/schemas/account",
  "x-stoplight": {
    "id": "ivofyr6xu6xk4"
  },
  "type": "object",
  "properties": {
    "id": {
      "$ref": "#/$defs/mongoId"
    },
    "name": {
      "type": "string",
      "maxLength": 1000
    },
    "active": {
      "type": "boolean"
    },
    "type": {
      "type": "string",
      "enum": [
        "ASSET_ACCOUNTS_RECEIVABLE",
        "ASSET_OTHER_CURRENT_ASSETS",
        "ASSET_BANK",
        "ASSET_FIXED_ASSETS",
        "ASSET_OTHER_ASSETS",
        "LIABILITY_ACCOUNTS_PAYABLE",
        "LIABILITY_CREDIT_CARD",
        "LIABILITY_OTHER_CURRENT_LIABILIY",
        "LIABILITY_LONG_TERM_LIABILITY",
        "EQUITY_EQUITY",
        "REVENUE_INCOME",
        "REVENUE_OTHER_INCOME",
        "EXPENSE_EXPENSE",
        "EXPENSE_OTHER_EXPENSE",
        "EXPENSE_COGS"
      ]
    },
    "description": {
      "type": "string"
    }
  },
  "required": [
    "name",
    "active",
    "type"
  ],
  "$defs": {
    "mongoId": {
      "type": "string",
      "title": "mongoId",
      "x-stoplight": {
        "id": "40j7qlmpihfdj"
      },
      "pattern": "/^[a-f\\d]{24}$/i"
    }
  }
}