{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/adobe/json-schema/adobe-criteria-cart-schema.json",
  "title": "CriteriaCart",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/adobe-target-recommendations-openapi.yml#/components/schemas/CriteriaCart",
  "allOf": [
    {
      "$ref": "#/$defs/CriteriaMin"
    },
    {
      "type": "object",
      "properties": {
        "criteriaGroup": {
          "type": "string",
          "enum": [
            "CART"
          ],
          "readOnly": true
        },
        "backupDisabled": {
          "type": "boolean",
          "default": false,
          "description": "Whether backup recommendations are disabled when criteria does not generate enough recommendations."
        },
        "backupInclusionFilteringEnabled": {
          "type": "boolean",
          "default": true,
          "description": "Whether inclusion rules on the criteria should be applied to backup recommendations."
        },
        "configuration": {
          "$ref": "#/$defs/CriteriaCartConfiguration"
        },
        "daysCount": {
          "type": "string",
          "enum": [
            "ONE_DAY",
            "TWO_DAYS",
            "ONE_WEEK",
            "TWO_WEEKS",
            "ONE_MONTH",
            "TWO_MONTHS"
          ],
          "description": "Time range of historical visitor behavioral data to consider for generating recommendations."
        },
        "excludePurchases": {
          "type": "boolean",
          "default": false,
          "description": "Whether items that were previously purchased by the visitor should be excluded in recommendations."
        },
        "minInventory": {
          "type": "integer",
          "format": "int32",
          "minimum": 0,
          "description": "Minimum number of pieces needed in stock for an item to be considered for recommendaton."
        },
        "partialDesignAllowed": {
          "type": "boolean",
          "default": false,
          "description": "Whether design be shown when the number of recommendations are less than item slots in the design."
        },
        "modelActionSettings": {
          "type": "object",
          "properties": {
            "actionOnKeyItems": {
              "type": "string",
              "enum": [
                "PURCHASE",
                "VIEW"
              ],
              "description": "Which visitor behavior event to take into considerations for key items."
            },
            "actionOnRecommendedItems": {
              "type": "string",
              "enum": [
                "PURCHASE",
                "VIEW"
              ],
              "description": "Which visitor behavior event to take into considerations for recommended items.\n`VIEW` is invalid if actionOnKeyItems is `PURCHASE`.\n"
            },
            "basisForCoOccurrence": {
              "type": "string",
              "enum": [
                "SESSION",
                "USER"
              ],
              "description": "Coocurrence Basis. Values:\n\n- `SESSION`: each individual session will be consumed separately.\n- `USER`: all user sessions will be aggregated at user level.\n"
            }
          }
        }
      },
      "required": [
        "daysCount"
      ]
    }
  ],
  "$defs": {
    "CriteriaCartConfiguration": {
      "type": "object",
      "properties": {
        "inclusionRules": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/InclusionMatcher"
          },
          "maxItems": 1000,
          "description": "Filtering rules to narrow the items to be displayed as recommendations. Inclusion rules are conjunctive and all rules\nmust be met to include an item in a recommendation. [More info](https://marketing.adobe.com/resources/help/en_US/target/recs/t_create_new_algorithm.html).\n"
        },
        "inclusionRulesKey": {
          "type": "string",
          "enum": [
            "CURRENT",
            "LAST_VIEWED",
            "LAST_PURCHASED",
            "MOST_VIEWED",
            "^(profile\\.|user\\.).+"
          ],
          "description": "Used for dynamic inclusion rules. Depending on the value either entity attribute matching or profile attribute matching is configured.\n[More info](https://docs.adobe.com/content/help/en/target/using/recommendations/criteria/use-dynamic-and-static-inclusion-rules.html#dynamic-filtering)].\n"
        },
        "priceRange": {
          "$ref": "#/$defs/CriteriaPriceRange"
        },
        "datasource": {
          "type": "string",
          "default": "mboxes",
          "description": "Behavioral data source can either be `mboxes` or a valid Analytics report report suite. A report suite can not be used when type is `SIMILARITY`.\n"
        }
      }
    },
    "CriteriaMin": {
      "type": "object",
      "properties": {
        "criteriaGroup": {
          "type": "string",
          "readOnly": true
        },
        "criteriaTitle": {
          "type": "string",
          "maxLength": 250,
          "description": "Displayed in the design using variable `$criteria.title`."
        },
        "id": {
          "type": "integer",
          "format": "int64",
          "readOnly": true
        },
        "name": {
          "type": "string",
          "maxLength": 250,
          "description": "Unique name of the criteria."
        },
        "description": {
          "type": "string",
          "maxLength": 1000
        },
        "lastModifiersName": {
          "type": "string",
          "readOnly": true
        },
        "lastModifiersEmail": {
          "type": "string",
          "readOnly": true
        },
        "lastModified": {
          "type": "string",
          "readOnly": true,
          "format": "date-time",
          "description": "The time in UTC when the criteria was last modified."
        }
      },
      "required": [
        "name"
      ]
    },
    "CriteriaPriceRange": {
      "type": "object",
      "properties": {
        "max": {
          "type": "number",
          "format": "double"
        },
        "min": {
          "type": "number",
          "format": "double"
        }
      },
      "description": "Price rule filter for items to be considered in recommendations."
    },
    "InclusionMatcher": {
      "type": "object",
      "properties": {
        "attribute": {
          "type": "string",
          "maxLength": 100
        },
        "highRange": {
          "type": "string"
        },
        "lowRange": {
          "type": "string"
        },
        "operation": {
          "type": "string"
        },
        "source": {
          "$ref": "#/$defs/SourceAttribute"
        },
        "values": {
          "type": "array",
          "items": {
            "type": "string",
            "maxLength": 250
          },
          "minItems": 1,
          "maxItems": 1000
        }
      },
      "required": [
        "attribute",
        "operation"
      ]
    },
    "SourceAttribute": {
      "type": "object",
      "properties": {
        "defaultValue": {
          "type": "string"
        },
        "excludeAllWhenEmpty": {
          "type": "boolean"
        },
        "name": {
          "type": "string"
        },
        "type": {
          "type": "string"
        }
      },
      "required": [
        "name",
        "type"
      ]
    }
  }
}