title: Voucher Configuration
x-tags:
  - Models
description: Voucher benefits, validity settings and issuance limits. Benefit and validity edits apply to new
  issuance. The current minimum eligible spend and stackability apply to all vouchers, including existing batches.
oneOf:
  - required:
      - calculation
      - minimum_eligible_spend
      - fixed_usable_from
      - fixed_expires_at
      - validity_period_in_days
      - is_stackable
      - total_issuance_limit
      - customer_issuance_limit
    properties:
      calculation: &a1
        $ref: ./Calculation.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
      - minimum_eligible_spend
      - fixed_usable_from
      - fixed_expires_at
      - validity_period_in_days
      - is_stackable
      - total_issuance_limit
      - customer_issuance_limit
    properties:
      calculation: *a1
      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
