{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/ranla-ai/json-schema/ranla-ai-update-affiliate-request-schema.json",
  "title": "UpdateAffiliateRequest",
  "x-generated": "2026-11-22",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/ranla-ai-openapi.yml#/components/schemas/UpdateAffiliateRequest",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "first_name": {
      "type": [
        "string",
        "null"
      ]
    },
    "last_name": {
      "type": [
        "string",
        "null"
      ]
    },
    "company": {
      "type": [
        "string",
        "null"
      ]
    },
    "website": {
      "type": [
        "string",
        "null"
      ]
    },
    "country": {
      "type": [
        "string",
        "null"
      ]
    },
    "notes": {
      "type": [
        "string",
        "null"
      ]
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "campaign_id": {
      "type": "string",
      "description": "Move to another campaign; new commissions use its rates"
    },
    "parent_affiliate_id": {
      "type": [
        "string",
        "null"
      ]
    },
    "postback_url": {
      "type": [
        "string",
        "null"
      ],
      "format": "uri",
      "description": "Receives this partner's `referral.*` and `commission.*` events as JSON POSTs"
    },
    "email_opt_out": {
      "type": "boolean"
    },
    "commission_override": {
      "type": [
        "object",
        "null"
      ],
      "description": "A rate for this partner only, replacing the campaign's. `null` clears it.",
      "required": [
        "commission_type"
      ],
      "properties": {
        "commission_type": {
          "type": "string",
          "enum": [
            "percent",
            "flat"
          ]
        },
        "commission_bps": {
          "type": "integer",
          "minimum": 0,
          "maximum": 10000
        },
        "commission_flat_cents": {
          "type": "integer",
          "minimum": 1
        }
      }
    },
    "token": {
      "type": "string",
      "description": "Rename the primary link token"
    }
  }
}