{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cavuno-com/json-schema/cavuno-com-create-coupon-body-schema.json",
  "title": "CreateCouponBody",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cavuno-com-coupons-api-openapi.yml#/components/schemas/CreateCouponBody",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 40
    },
    "percentOff": {
      "type": [
        "number",
        "null"
      ],
      "minimum": 0,
      "maximum": 100
    },
    "amountOff": {
      "type": [
        "number",
        "null"
      ],
      "description": "Fixed discount in the currency major unit (e.g. 10 for $10, 1000 for ¥1000). Required with `currency` when there is no percentOff.",
      "exclusiveMinimum": 0
    },
    "currency": {
      "type": [
        "string",
        "null"
      ],
      "minLength": 1
    },
    "duration": {
      "type": "string",
      "enum": [
        "once",
        "forever",
        "repeating"
      ]
    },
    "durationInMonths": {
      "type": "integer",
      "exclusiveMinimum": 0
    },
    "maxRedemptions": {
      "type": "integer",
      "exclusiveMinimum": 0
    },
    "redeemBy": {
      "type": "integer",
      "description": "Unix ms deadline after which the coupon cannot be redeemed."
    },
    "appliesToPlanIds": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1
      }
    }
  },
  "required": [
    "name",
    "duration"
  ],
  "additionalProperties": false
}