{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/marsello/main/json-schema/marsello-reward-model-schema.json",
  "title": "RewardModel",
  "description": "Represents a reward available at a store",
  "x-generated": "2026-10-27",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/marsello-loyalty-api-v1.json#/components/schemas/RewardModel",
  "type": "object",
  "properties": {
    "id": {
      "type": [
        "string",
        "null"
      ],
      "description": "Id of this reward"
    },
    "name": {
      "type": [
        "string",
        "null"
      ],
      "description": "Name of the reward"
    },
    "points": {
      "type": "integer",
      "description": "Number of points required to claim this reward",
      "format": "int32"
    },
    "description": {
      "type": [
        "string",
        "null"
      ],
      "description": "Description of the reward"
    },
    "expires": {
      "type": [
        "string",
        "null"
      ],
      "description": "Expiry",
      "format": "date-time"
    },
    "redeemCode": {
      "type": [
        "string",
        "null"
      ],
      "description": "Code used to redeem this reward on the external system"
    },
    "fixedValue": {
      "type": [
        "number",
        "null"
      ],
      "description": "Dollar or Percent-Off value of the discount to be applied",
      "format": "double"
    },
    "minimumSpend": {
      "type": [
        "number",
        "null"
      ],
      "description": "The minimum dollar value required to allow this reward to be redeemed",
      "format": "double"
    },
    "discountType": {
      "type": [
        "string",
        "null"
      ],
      "description": "Discount type of the reward, dollar-off or percent-off"
    },
    "eligibleProducts": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "string"
      },
      "description": "The products that this discount can be applied to"
    },
    "eligibleCategories": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "string"
      },
      "description": "The categories this discount can be applied to"
    },
    "tierName": {
      "type": [
        "string",
        "null"
      ],
      "description": "The name of the associated tier"
    },
    "terms": {
      "type": [
        "string",
        "null"
      ],
      "description": "The terms of the reward"
    },
    "customRewardRedeemedFulfillmentMessage": {
      "type": [
        "string",
        "null"
      ],
      "description": "The fulfullment message if the reward is Custom"
    },
    "type": {
      "$ref": "#/$defs/ApiRewardType"
    }
  },
  "additionalProperties": false,
  "$defs": {
    "ApiRewardType": {
      "enum": [
        "Reward",
        "Coupon"
      ],
      "type": "string"
    }
  }
}