{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/affise/main/json-schema/affise-offer-payment-structure-schema.json",
  "title": "offer_payment_structure",
  "description": "Payment 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_payment_structure",
  "type": "object",
  "properties": {
    "id": {
      "type": "integer",
      "description": "Payment id"
    },
    "title": {
      "type": "string",
      "description": "Payment title"
    },
    "countries": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "An array of countries in ISO format (or put empty string to clear existing items)"
    },
    "country_exclude": {
      "type": "integer",
      "enum": [
        0,
        1
      ],
      "description": "Exclude these countries. Available:0,1"
    },
    "cities": {
      "type": "array",
      "items": {
        "type": "integer"
      },
      "description": "An array of id cities (or put empty string to clear existing items)"
    },
    "devices": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "mediahub",
          "mobile",
          "ereader",
          "console",
          "tv",
          "tablet",
          "desktop",
          "smartwatch"
        ]
      },
      "description": "The array of devices. (or put empty string to clear existing items)"
    },
    "os": {
      "type": "string",
      "description": "Possible values can be found in oses-list"
    },
    "goal": {
      "type": "string",
      "description": "Value targets"
    },
    "total": {
      "type": "number",
      "description": "The amount of payment"
    },
    "revenue": {
      "type": "number",
      "description": "Payment webmaster"
    },
    "currency": {
      "type": "string",
      "description": "Currency (Code in ECB format)"
    },
    "type": {
      "type": "string",
      "enum": [
        "fixed",
        "percent",
        "mixed",
        "cpc",
        "cpm",
        "first_cpa",
        "first_cps",
        "baseline_onetime",
        "baseline_accumulating"
      ],
      "description": "Type of payment."
    },
    "sub1": {
      "type": "string",
      "description": "Comma-separated sub values for sub1"
    },
    "sub2": {
      "type": "string",
      "description": "Comma-separated sub values for sub2"
    },
    "sub3": {
      "type": "string",
      "description": "Comma-separated sub values for sub3"
    },
    "sub4": {
      "type": "string",
      "description": "Comma-separated sub values for sub4"
    },
    "sub5": {
      "type": "string",
      "description": "Comma-separated sub values for sub5"
    },
    "sub6": {
      "type": "string",
      "description": "Comma-separated sub values for sub6"
    },
    "sub7": {
      "type": "string",
      "description": "Comma-separated sub values for sub7"
    },
    "sub8": {
      "type": "string",
      "description": "Comma-separated sub values for sub8"
    },
    "custom_field1": {
      "type": "string"
    },
    "custom_field2": {
      "type": "string"
    },
    "custom_field3": {
      "type": "string"
    },
    "custom_field4": {
      "type": "string"
    },
    "custom_field5": {
      "type": "string"
    },
    "custom_field6": {
      "type": "string"
    },
    "custom_field7": {
      "type": "string"
    },
    "custom_field8": {
      "type": "string"
    },
    "custom_field9": {
      "type": "string"
    },
    "custom_field10": {
      "type": "string"
    },
    "custom_field11": {
      "type": "string"
    },
    "custom_field12": {
      "type": "string"
    },
    "custom_field13": {
      "type": "string"
    },
    "custom_field14": {
      "type": "string"
    },
    "custom_field15": {
      "type": "string"
    },
    "baseline_value": {
      "type": "number",
      "description": "Baseline value for the payment with the type 'baseline_onetime' and 'baseline_accumulating'."
    }
  },
  "required": [
    "currency",
    "type"
  ]
}