title: Voucher Configuration Input
x-tags:
  - Models
description: Voucher benefits, validity and redemption conditions. Choose either a fixed expiry date or a validity
  period, using the program currency for monetary amounts. Changes to minimum eligible spend and stackability
  also apply to vouchers already issued. The redemption mode is fixed when the program is created.
oneOf:
  - required:
      - calculation
      - redemption_mode
      - fixed_expires_at
    properties:
      calculation: &a1
        $ref: ./CalculationInput.yaml
      redemption_mode: &redemptionMode
        $ref: ./LoyaltyRedemptionMode.yaml
      minimum_eligible_spend: &a8
        description: The minimum remaining eligible spend for redeeming any voucher from this program, including
          vouchers issued before this setting changed. Null means no minimum.
        oneOf:
          - type: "null"
          - $ref: ./PositiveMoney.yaml
      fixed_usable_from: &a9
        type:
          - string
          - "null"
        format: date-time
        pattern: ^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z$
        description: When the vouchers become usable. If this is null or already past when they are issued, they can
          be used immediately. This is separate from program availability.
        example: 2026-10-27T00:00:00Z
      fixed_expires_at:
        type: string
        format: date-time
        pattern: ^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z$
        example: 2026-11-26T00:00:00Z
      validity_period_in_days:
        type: "null"
      is_stackable: &a10
        type: boolean
        default: false
        description: Whether vouchers from this program can be combined on an order, including vouchers already
          issued. The client enforces the current setting.
      total_issuance_limit: &a11
        type:
          - integer
          - "null"
        minimum: 1
        maximum: 2147483647
        description: The total number of vouchers the program can ever issue. Null means no limit. Redeeming, revoking
          or expiring vouchers does not free up this allowance.
      customer_issuance_limit: &a12
        type:
          - integer
          - "null"
        minimum: 1
        maximum: 2147483647
        description: The total number of vouchers each customer can receive from this program. Null means no limit.
    title: Fixed expiry
    type: object
  - required:
      - calculation
      - redemption_mode
      - validity_period_in_days
    properties:
      calculation: *a1
      redemption_mode: *redemptionMode
      minimum_eligible_spend: *a8
      fixed_usable_from: *a9
      fixed_expires_at:
        type: "null"
      validity_period_in_days:
        type: integer
        minimum: 1
        maximum: 3650
      is_stackable: *a10
      total_issuance_limit: *a11
      customer_issuance_limit: *a12
    title: Rolling validity
    type: object
