{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/affise/main/json-schema/affise-offer-caps-structure-schema.json",
  "title": "offer_caps_structure",
  "description": "Cap item structure",
  "x-generated": "2026-10-27",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/affise-admin-offers-api-openapi.yml#/components/schemas/offer_caps_structure",
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "enum": [
        "hour",
        "day",
        "month",
        "all"
      ],
      "description": "Possible values: hour (if enabled), day, month, all"
    },
    "type": {
      "type": "string",
      "enum": [
        "budget",
        "conversions",
        "clicks",
        "impressions"
      ],
      "description": "Possible values: budget, conversions, clicks, impressions"
    },
    "value": {
      "type": "number",
      "description": "The integer value for the type of conversion and the float value for the budget type."
    },
    "goals": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Array[string]. Either specifies goal value or is empty. Empty field requires 'goal_type' values of 'all'/'each'."
    },
    "goal_type": {
      "type": "string",
      "enum": [
        "all",
        "each",
        "exact"
      ],
      "description": "[string]. Values: 'all' , 'each', 'exact'. 'goals' field is mandatory to be specified for 'exact' value."
    },
    "affiliates": {
      "type": "array",
      "items": {
        "type": "integer"
      },
      "description": "Array[integer]. Either specifies affiliate ID or is empty filed. Empty field requires 'affiliate_type' values of 'all'/'each'."
    },
    "affiliate_type": {
      "type": "string",
      "enum": [
        "all",
        "each",
        "exact"
      ],
      "description": "[string]. Values: 'all' , 'each', 'exact'. 'affiliates' field is mandatory to be specified for 'exact' value."
    },
    "country": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Array[string]. Values: Country codes."
    },
    "country_type": {
      "type": "string",
      "enum": [
        "all",
        "each",
        "exact"
      ],
      "description": "[string]. Values: 'all' , 'each', 'exact'. 'country' field is mandatory to be specified for 'exact' value."
    },
    "sub_number": {
      "type": "integer",
      "description": "[integer]. Possible values: 2.",
      "enum": [
        2
      ]
    },
    "sub_value": {
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  }
}