{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/affiliaterail-com/json-schema/affiliaterail-com-click-create-schema.json",
  "title": "ClickCreate",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/affiliaterail-com-clicks-api-openapi.yml#/components/schemas/ClickCreate",
  "type": "object",
  "properties": {
    "program_id": {
      "type": "string",
      "pattern": "^(sample_)?prg_",
      "description": "Prefixed id (`prg_…`)"
    },
    "value": {
      "type": "string",
      "minLength": 1,
      "description": "The partner handle or link value the visitor arrived with"
    },
    "param": {
      "type": "string",
      "default": "ref"
    },
    "landing_url": {
      "type": "string",
      "format": "uri"
    },
    "visitor_token": {
      "type": "string",
      "minLength": 8,
      "maxLength": 128,
      "description": "Your stable identifier for this visitor; the same token across clicks makes one referral"
    },
    "referrer": {
      "type": "string"
    },
    "ip": {
      "type": "string",
      "description": "Hashed on write, never stored"
    },
    "user_agent": {
      "type": "string"
    },
    "country": {
      "type": "string",
      "minLength": 2,
      "maxLength": 2
    },
    "device": {
      "type": "string"
    }
  },
  "required": [
    "program_id",
    "value",
    "landing_url",
    "visitor_token"
  ]
}