{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/affiliatebase-io/json-schema/affiliatebase-io-campaign-write-schema.json",
  "title": "CampaignWrite",
  "x-generated": "2026-11-01",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/affiliatebase-io-openapi.yml#/components/schemas/CampaignWrite",
  "type": "object",
  "properties": {
    "name": {
      "type": "string"
    },
    "slug": {
      "type": "string"
    },
    "url": {
      "type": "string"
    },
    "attribution_model": {
      "type": "string",
      "enum": [
        "last_click",
        "first_click"
      ],
      "default": "last_click"
    },
    "private": {
      "type": "boolean"
    },
    "private_tokens": {
      "type": "string"
    },
    "reward_type": {
      "type": "string"
    },
    "commission_percent": {
      "type": "number"
    },
    "commission_amount_cents": {
      "type": "integer"
    },
    "commission_amount_currency": {
      "type": "string"
    },
    "minimum_payout_cents": {
      "type": "integer"
    },
    "minimum_payout_currency": {
      "type": "string"
    },
    "max_commission_period_months": {
      "type": "integer"
    },
    "reward_conditions": {
      "type": "array",
      "description": "Ordered reward conditions. Currently one subscription-duration condition pays an introductory commission percent for the first N months of each referred customer.",
      "items": {
        "type": "object",
        "properties": {
          "attribute": {
            "type": "string",
            "enum": [
              "subscription_duration_months"
            ]
          },
          "operator": {
            "type": "string",
            "enum": [
              "lt"
            ]
          },
          "value": {
            "type": "integer"
          },
          "commission_percent": {
            "type": "string"
          }
        }
      }
    },
    "introductory_commission_percent": {
      "type": "number",
      "description": "Write-only input. Introductory percent for the first introductory_commission_months months."
    },
    "introductory_commission_months": {
      "type": "integer",
      "description": "Write-only input. Length of the introductory period in months."
    },
    "max_commissions": {
      "type": "integer"
    },
    "days_before_referrals_expire": {
      "type": "integer"
    },
    "days_until_commissions_are_due": {
      "type": "integer"
    },
    "affiliate_dashboard_text": {
      "type": "string"
    },
    "custom_reward_description": {
      "type": "string"
    },
    "welcome_text": {
      "type": "string"
    },
    "customers_visible_to_affiliates": {
      "type": "boolean"
    },
    "sale_description_visible_to_affiliates": {
      "type": "boolean"
    },
    "parameter_type": {
      "type": "string"
    },
    "stripe_coupon_id": {
      "type": "string"
    },
    "promo_code_provisioning": {
      "type": "string",
      "enum": [
        "automatic",
        "individual"
      ],
      "description": "Controls future automatic code generation. Defaults to automatic; individual uses explicitly created or imported codes. Existing codes are not renamed or retired."
    },
    "default": {
      "type": "boolean"
    }
  }
}