{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/envestnet/json-schema/envestnet-transaction-categorization-rule-schema.json",
  "title": "TransactionCategorizationRule",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/envestnet-transactions-api-openapi.yml#/components/schemas/TransactionCategorizationRule",
  "type": "object",
  "properties": {
    "ruleClauses": {
      "type": "array",
      "description": "Details of rules. <br><br><b>Applicable containers</b>: creditCard, investment, insurance, loan<br>",
      "readOnly": true,
      "items": {
        "$ref": "#/$defs/RuleClause"
      }
    },
    "userDefinedRuleId": {
      "type": "integer",
      "description": "Unique identifier generated for every rule the user creates.<br><br><b>Applicable containers</b>: creditCard, investment, insurance, loan<br>",
      "format": "int64",
      "readOnly": true
    },
    "categoryLevelId": {
      "type": "integer",
      "description": "The level of the category for which the rule is created.<br><br><b>Applicable containers</b>: creditCard, insurance, loan<br>",
      "format": "int32",
      "readOnly": true
    },
    "transactionCategorisationId": {
      "type": "integer",
      "description": "Category id that is assigned to the transaction when the transaction matches the rule clause. This is the id field of the transaction category resource.<br><br><b>Applicable containers</b>: creditCard, investment, insurance, loan<br>",
      "format": "int64",
      "readOnly": true
    },
    "memId": {
      "type": "integer",
      "description": "Unique identifier of the user.<br><br><b>Applicable containers</b>: creditCard, investment, insurance, loan<br>",
      "format": "int64",
      "readOnly": true
    },
    "rulePriority": {
      "type": "integer",
      "description": "The order in which the rules get executed on transactions.<br><br><b>Applicable containers</b>: creditCard, investment, insurance, loan<br>",
      "format": "int32",
      "readOnly": true
    }
  },
  "$defs": {
    "RuleClause": {
      "title": "RuleClause",
      "type": "object",
      "properties": {
        "field": {
          "type": "string",
          "description": "Field for which the clause is created.<br><br><br><b>Valid Values</b>:amount,description<b>Applicable containers</b>: creditCard, investment, insurance, loan<br>",
          "readOnly": true,
          "enum": [
            "amount",
            "description"
          ]
        },
        "userDefinedRuleId": {
          "type": "integer",
          "description": "Unique identifier generated for every rule the user creates.<br><br><b>Applicable containers</b>: creditCard, investment, insurance, loan<br>",
          "format": "int64",
          "readOnly": true
        },
        "fieldValue": {
          "type": "string",
          "description": "The value would be the amount value in case of amount based rule clause or the string value in case of description based rule clause.<br><br><b>Applicable containers</b>: creditCard, investment, insurance, loan<br>",
          "readOnly": true
        },
        "operation": {
          "type": "string",
          "description": "Operation for which the clause is created.<br><br><b>Applicable containers</b>: creditCard, investment, insurance, loan<br>",
          "readOnly": true,
          "enum": [
            "numberEquals",
            "numberLessThan",
            "numberLessThanEquals",
            "numberGreaterThan",
            "numberGreaterThanEquals",
            "stringEquals",
            "stringContains"
          ]
        },
        "ruleClauseId": {
          "type": "integer",
          "description": "Unique identifier generated for the rule clause.<br><br><b>Applicable containers</b>: creditCard, investment, insurance, loan<br>",
          "format": "int64",
          "readOnly": true
        }
      }
    }
  }
}