{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/moneyhub/main/json-schema/moneyhub-account-patch-schema.json",
  "title": "AccountPatch",
  "x-generated": "2026-10-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/moneyhub-accounts-api-openapi.yml#/components/schemas/AccountPatch",
  "properties": {
    "accountName": {
      "description": "The name of the account",
      "type": "string"
    },
    "providerName": {
      "description": "The name of the provider of the account.",
      "type": "string"
    },
    "details": {
      "additionalProperties": false,
      "type": "object",
      "properties": {
        "AER": {
          "description": "For cash and savings accounts. Interest rate expressed as a percentage 'Annual Equivalent Rate'.",
          "type": "number",
          "minimum": 0,
          "maximum": 100
        },
        "APR": {
          "description": "For credit cards, mortgages and loans. Interest rate expressed as a percentage 'Annual Percentage Rate'.",
          "type": "number",
          "minimum": 0,
          "maximum": 100
        },
        "creditLimit": {
          "description": "For credit cards. The agreed overdraft limit of the account in minor units of the currency.",
          "minimum": 0,
          "type": "integer"
        },
        "endDate": {
          "description": "For Mortgages and loans. The date at which the loan/mortgage will finish.",
          "format": "date",
          "type": "string"
        },
        "fixedDate": {
          "description": "For Mortgages. The date at which the current fixed rate ends",
          "format": "date",
          "type": "string"
        },
        "interestFreePeriod": {
          "type": "integer",
          "description": "For loans. The length in months of the interest free period",
          "minimum": 0
        },
        "interestType": {
          "description": "For mortgages. The interest type",
          "enum": [
            "fixed",
            "variable"
          ],
          "type": "string"
        },
        "linkedProperty": {
          "type": "string",
          "description": "For Mortgages. The id of an associated property account"
        },
        "monthlyRepayment": {
          "type": "integer",
          "description": "For mortgages and loans. The monthly amount due to the mortgage provider in minor units of the currency.",
          "minimum": 0
        },
        "overdraftLimit": {
          "description": "For cash accounts. The agreed overdraft limit of the account in minor units of the currency.",
          "type": "integer",
          "minimum": 0
        },
        "postcode": {
          "description": "For properties. The postcode of the property",
          "type": "string"
        },
        "runningCost": {
          "description": "For assets. The running cost in minor units of the currency.",
          "type": "integer",
          "minimum": 0
        },
        "runningCostPeriod": {
          "type": "string",
          "description": "For assets. The running cost period",
          "enum": [
            "month",
            "year"
          ]
        },
        "term": {
          "type": "integer",
          "description": "For mortgages. The term of the mortgage in months.",
          "minimum": 0
        },
        "yearlyAppreciation": {
          "type": "number",
          "description": "For assets. The rate of appreciation as a percentage, negative values indicate that the asset will depreciate"
        }
      }
    }
  },
  "required": [
    "accountName",
    "providerName"
  ],
  "type": "object"
}