{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://ledger.abivia.com/api/json/account.schema.json",
  "title": "Account Request",
  "description": "A Ledger Account request",
  "type": "object",
  "properties": {
    "category": {
      "description": "Set if this is a category account that can have sub-accounts.",
      "type": "boolean"
    },
    "closed": {
      "description": "Set when this account is closed to transactions..",
      "type": "boolean"
    },
    "code": {
      "description": "A unique code that identifies the account.",
      "type": "string"
    },
    "credit": {
      "description": "Set when this account is reported as a credit.",
      "type": "boolean"
    },
    "debit": {
      "description": "Set when this account is reported as a debit.",
      "type": "boolean"
    },
    "extra": {
      "description": "Arbitrary data for use by the application.",
      "type": "string"
    },
    "name": {
      "description": "The ledger name, language is assumed to be the current system locale.",
      "type": "string"
    },
    "names": {
      "type": "array",
      "minItems": 1
    },
    "parent": {
      "description": "A reference to the parent account.",
      "type": "object",
      "$ref": "https://ledger.abivia.com/api/json/entityref.schema.json"
    },
    "revision": {
      "description": "A revision hash code, required for update operations.",
      "type": "string"
    },
    "taxCode": {
      "description": "An account code for tax purposes.",
      "type": "string"
    },
    "toCode": {
      "description": "A new account code. Only useful on update.",
      "type": "string"
    }
  },
  "required": ["code"]
}
