{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/recurly/json-schema/recurly-coupon-update-schema.json",
  "title": "CouponUpdate",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/recurly-coupon-api-openapi.yml#/components/schemas/CouponUpdate",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "title": "Name",
      "description": "The internal name for the coupon."
    },
    "max_redemptions": {
      "type": "integer",
      "title": "Max redemptions",
      "description": "A maximum number of redemptions for the coupon. The coupon will expire when it hits its maximum redemptions."
    },
    "max_redemptions_per_account": {
      "type": "integer",
      "title": "Max redemptions per account",
      "description": "Redemptions per account is the number of times a specific account can redeem the coupon. Set redemptions per account to `1` if you want to keep customers from gaming the system and getting more than one discount from the coupon campaign."
    },
    "hosted_description": {
      "type": "string",
      "title": "Hosted Payment Pages description",
      "description": "This description will show up when a customer redeems a coupon on your Hosted Payment Pages, or if you choose to show the description on your own checkout page."
    },
    "invoice_description": {
      "type": "string",
      "title": "Invoice description",
      "description": "Description of the coupon on the invoice.",
      "maxLength": 255
    },
    "redeem_by_date": {
      "type": "string",
      "title": "Redeem by",
      "description": "The date and time the coupon will expire and can no longer be redeemed. Time is always 11:59:59, the end-of-day Pacific time. Mutually exclusive with redeem_by_interval_unit/redeem_by_interval_amount."
    },
    "redeem_by_interval_unit": {
      "title": "Redeem by interval unit",
      "description": "Unit of the relative redemption window. Must be paired with redeem_by_interval_amount. Mutually exclusive with redeem_by_date. Bulk coupons only.",
      "$ref": "#/$defs/CouponRedeemByIntervalUnitEnum"
    },
    "redeem_by_interval_amount": {
      "type": "integer",
      "title": "Redeem by interval amount",
      "description": "Quantity of redeem_by_interval_unit. Must be paired with redeem_by_interval_unit.",
      "minimum": 1
    }
  },
  "$defs": {
    "CouponRedeemByIntervalUnitEnum": {
      "type": "string",
      "title": "Redeem by interval unit",
      "description": "Unit of the relative redemption window. Bulk coupons only.",
      "enum": [
        "day",
        "week",
        "month",
        "year"
      ]
    }
  }
}