title: iglooX Voucher Balance
type: object
description: A customer-owned voucher balance available at the associated iglooX outlet, including voucher quantities, validity and redemption terms.
required:
  - uuid
  - name
  - balance
  - available_balance
  - state
  - is_usable
  - usable_from
  - expires_at
  - terms
properties:
  uuid:
    type: string
    format: uuid
    description: The customer voucher-balance UUID. Redeeming this balance consumes one voucher.
  name:
    type: string
    minLength: 1
    maxLength: 255
    description: The current program display name.
  balance:
    type: integer
    minimum: 0
    description: The number of vouchers held in this balance.
  available_balance:
    type: integer
    minimum: 0
    description: The number of vouchers currently available for redemption.
  state:
    type: string
    enum:
      - available
      - insufficient_balance
      - expired
      - not_yet_usable
      - archived
  is_usable:
    type: boolean
    description: Whether the balance is currently usable. Eligibility and savings for a particular order are checked separately.
  usable_from:
    type: string
    format: date-time
  expires_at:
    type: string
    format: date-time
  terms:
    type: object
    required:
      - calculation
      - minimum_eligible_spend
      - is_stackable
    properties:
      calculation:
        description: The fixed or percentage benefit saved when the voucher was issued. Later program edits do not replace this benefit.
        allOf:
          - $ref: ./Calculation.yaml
          - type: object
            required:
              - type
              - fixed_value
              - percentage
              - percentage_cap
              - price_override
            properties:
              type:
                type: string
                enum:
                  - fixed
                  - percentage
              price_override:
                type: 'null'
      minimum_eligible_spend:
        oneOf:
          - type: 'null'
          - $ref: ./Money.yaml
        description: The minimum remaining discounted eligible sale amount currently required immediately before redeeming one voucher.
      is_stackable:
        type: boolean
        description: The current program stacking rule. Each successful payment records the rule that applied to that redemption.
x-tags:
  - iglooX Integration
