{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/swoogo/json-schema/swoogo-discount-update-request-schema.json",
  "title": "discountUpdateRequest",
  "description": "All fields are optional on update. `event_id` cannot be changed — discounts are bound to their\noriginal event. To create an alternate code under an existing discount, pass `parent_id` to the create endpoint. The clone endpoint always creates a new primary code.\n",
  "x-generated": "2026-11-24",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/swoogo-openapi.yml#/components/schemas/discountUpdateRequest",
  "type": "object",
  "properties": {
    "code": {
      "type": "string",
      "maxLength": 255,
      "description": "Unique code for the discount within the event. May not contain `<`, `>`, `\\`, or `\"`."
    },
    "type": {
      "type": "string",
      "enum": [
        "percentage",
        "absolute",
        "specific"
      ],
      "description": "The type of discount being applied."
    },
    "percentage_discount": {
      "type": "number",
      "format": "float",
      "minimum": 0,
      "maximum": 100
    },
    "absolute_discount": {
      "type": "number",
      "format": "float"
    },
    "apply_to_all": {
      "type": "boolean"
    },
    "capacity": {
      "type": "integer"
    },
    "min_group_size": {
      "type": "integer",
      "minimum": 2
    },
    "registrants_per_use": {
      "type": "integer",
      "minimum": 2
    },
    "all_registrants_in_group": {
      "type": "boolean"
    },
    "applicable_line_items": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "custom_fees_update": {
      "type": "object",
      "description": "New entries to merge into the stored `custom_fees`. See `discountCreateRequest` for shape.",
      "additionalProperties": {
        "type": "object",
        "additionalProperties": {
          "type": "string"
        }
      }
    },
    "autopopulate_attributes": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "attribute": {
            "type": "string"
          },
          "value": {}
        }
      }
    },
    "notes": {
      "type": "string"
    },
    "sold_out_message": {
      "type": "string",
      "maxLength": 255
    }
  }
}