title: Loyalty Balance Search Filters
type: object
x-tags:
  - Models
description: A balance must match every filter you supply. Within an array filter, matching any selected value
  is enough. Voucher results use their issued benefit and validity together with current program conditions. Later
  availability or customer-tier changes do not filter out issued vouchers or valid quantity balances. Quantity states
  describe balance availability independently of option affordability and destination voucher conditions.
required: []
properties:
  query:
    type:
      - string
      - "null"
    minLength: 1
    maxLength: 255
    description: Searches the current program name for stored-value wallets, voucher batches and quantity pools.
  include_archived:
    type: boolean
    default: true
    description: Set to false to exclude balances belonging to archived programs, regardless of their state.
  loyalty_program_uuids:
    type:
      - array
      - "null"
    minItems: 1
    maxItems: 100
    uniqueItems: true
    items:
      type: string
      format: uuid
  outlet_uuids:
    type:
      - array
      - "null"
    minItems: 1
    maxItems: 100
    uniqueItems: true
    items:
      type: string
      format: uuid
    description: Matches a balance when its current program permits any selected outlet. An unrestricted program
      matches all current and future outlets belonging to the merchant.
  types:
    type:
      - array
      - "null"
    minItems: 1
    uniqueItems: true
    items:
      $ref: ./LoyaltyProgramType.yaml
  states:
    type:
      - array
      - "null"
    minItems: 1
    uniqueItems: true
    items:
      $ref: ./LoyaltyBalanceState.yaml
  has_positive_balance:
    type: boolean
    description: Set to true for recorded funds, voucher quantities or units greater than zero, or false for zero or
      negative balances. Omit to include both. This does not imply that the balance can currently be redeemed.
  expires_at:
    type:
      - object
      - "null"
    description: Filters the expiry shown on the balance. A supplied bound excludes balances without expiry.
      Omit either bound to leave that end open. Equal bounds return no balances.
    properties:
      from:
        type:
          - string
          - "null"
        format: date-time
        pattern: '^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z$'
        description: Includes balances expiring at or after this timestamp.
      to:
        type:
          - string
          - "null"
        format: date-time
        pattern: '^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z$'
        description: Includes balances expiring before this timestamp. It cannot precede `from`.
