title: Stored Value Configuration Input
type: object
x-tags:
  - Models
description: Configuration supplied when creating or editing a stored-value loyalty program. Every monetary
  value must use the merchant's currency.
properties:
  minimum_redemption_per_order:
    oneOf:
      - type: 'null'
      - $ref: ./PositiveMoney.yaml
  top_up_validity_period_in_days:
    description: |-
      Validity in days for top-ups and membership-tier gifts from credit processing time. Credits never shorten
      an existing positive wallet's validity: keep the later expiry, and keep an existing no-expiry wallet unlimited.
      Null validity removes a finite expiry. Empty or expired wallets use the configured validity for the new credit.
    type:
      - integer
      - 'null'
    minimum: 1
    maximum: 3650
  custom_top_up_amounts:
    oneOf:
      - type: 'null'
      - type: object
        properties:
          minimum_amount:
            oneOf:
              - type: 'null'
              - $ref: ./PositiveMoney.yaml
          maximum_amount:
            oneOf:
              - type: 'null'
              - $ref: ./PositiveMoney.yaml
        anyOf:
          - required:
              - minimum_amount
            properties:
              minimum_amount:
                $ref: ./PositiveMoney.yaml
          - required:
              - maximum_amount
            properties:
              maximum_amount:
                $ref: ./PositiveMoney.yaml
  preset_top_up_amounts:
    type: array
    maxItems: 50
    items:
      $ref: ./PositiveMoney.yaml
  top_up_bonuses:
    type: array
    maxItems: 50
    items:
      type: object
      required:
        - customer_pays
        - bonus_value
      properties:
        customer_pays:
          $ref: ./PositiveMoney.yaml
        bonus_value:
          $ref: ./PositiveMoney.yaml
        eligible_tiers:
          type: array
          uniqueItems: true
          maxItems: 100
          items:
            type: string
            format: uuid
minProperties: 1
