{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/scrip-dev/json-schema/scrip-dev-reward-response-schema.json",
  "title": "RewardResponse",
  "description": "A reward with its pricing, inventory, availability, and metadata",
  "x-generated": "2026-11-24",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/scrip-dev-openapi.json#/components/schemas/RewardResponse",
  "properties": {
    "asset_id": {
      "description": "Asset used to price this reward",
      "format": "uuid",
      "type": "string"
    },
    "auto_managed": {
      "description": "Whether the catalog sync manages this item's lifecycle automatically",
      "type": "boolean"
    },
    "available_from": {
      "description": "Start of the availability window (RFC 3339, null if always available)",
      "format": "date-time",
      "type": "string"
    },
    "available_until": {
      "description": "End of the availability window (RFC 3339, null if no end date)",
      "format": "date-time",
      "type": "string"
    },
    "category": {
      "description": "Grouping label for organizing rewards in the catalog",
      "type": "string"
    },
    "committed_units": {
      "description": "UNIT_BASED units currently consuming inventory. Includes delivered and pending units. Null for AMOUNT_BASED rewards.",
      "type": [
        "integer",
        "null"
      ]
    },
    "cost": {
      "description": "Monetary cost of one unit of a custom reward (null when unset or for managed rewards).",
      "oneOf": [
        {
          "$ref": "#/$defs/Money"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "description": "When this reward was created (RFC 3339)",
      "format": "date-time",
      "type": "string"
    },
    "delivered_units": {
      "description": "UNIT_BASED units whose redemption has been completed. Null for AMOUNT_BASED rewards.",
      "type": [
        "integer",
        "null"
      ]
    },
    "description": {
      "description": "Details about the reward",
      "type": "string"
    },
    "display": {
      "$ref": "#/$defs/ProductDisplay",
      "description": "Product content for displaying the reward. Present for managed rewards (kind PROVIDER)."
    },
    "face_currency": {
      "description": "ISO 4217 currency of the face value (PROVIDER items only)",
      "type": "string"
    },
    "face_value": {
      "$ref": "#/$defs/Money",
      "description": "Pinned face value (fixed-denomination PROVIDER items only)"
    },
    "fulfillment": {
      "$ref": "#/$defs/RewardFulfillment",
      "description": "Supported values, currencies, delivery, and pricing. Present for managed rewards (kind PROVIDER)."
    },
    "fulfillment_mode": {
      "description": "What a redemption of this reward does when the request omits `capture`. `INSTANT` completes the redemption at once. `ASYNC` leaves it pending with the points held. `null` completes it at once, except a gift card Scrip orders, which always holds the points.",
      "enum": [
        "INSTANT",
        "ASYNC",
        null
      ],
      "type": [
        "string",
        "null"
      ]
    },
    "fulfillment_product_id": {
      "description": "Product ordered when this reward is redeemed. Present for managed rewards (kind PROVIDER).",
      "format": "uuid",
      "type": "string"
    },
    "id": {
      "description": "Unique identifier for this reward",
      "format": "uuid",
      "type": "string"
    },
    "kind": {
      "description": "Whether you created the reward directly (CUSTOM) or Scrip manages it through a reward source (PROVIDER)",
      "type": "string"
    },
    "max_per_participant": {
      "description": "Per-participant redemption limit (UNIT_BASED only, null = unlimited)",
      "type": [
        "integer",
        "null"
      ]
    },
    "max_total": {
      "description": "Global inventory limit (UNIT_BASED only, null = unlimited)",
      "type": [
        "integer",
        "null"
      ]
    },
    "metadata": {
      "description": "Custom key-value data attached to this reward",
      "type": "object"
    },
    "name": {
      "description": "The name people see for the reward in the catalog.",
      "type": "string"
    },
    "pending_units": {
      "description": "UNIT_BASED units awaiting fulfillment. Null for AMOUNT_BASED rewards.",
      "type": [
        "integer",
        "null"
      ]
    },
    "program_id": {
      "description": "Program this reward belongs to",
      "format": "uuid",
      "type": "string"
    },
    "redemption_type": {
      "description": "Whether the reward is redeemed in discrete units or in variable amounts.",
      "enum": [
        "UNIT_BASED",
        "AMOUNT_BASED"
      ],
      "type": "string"
    },
    "reward_source_id": {
      "description": "Reward source that supplies this reward. Present for managed rewards (kind PROVIDER).",
      "format": "uuid",
      "type": "string"
    },
    "status": {
      "description": "The reward's lifecycle state.",
      "enum": [
        "DRAFT",
        "ACTIVE",
        "OUT_OF_STOCK",
        "ARCHIVED"
      ],
      "type": "string"
    },
    "unit_cost": {
      "description": "Fixed price per unit (or use `fulfillment.rate` for variable-value managed rewards).",
      "type": "string"
    },
    "updated_at": {
      "description": "When this reward was last modified (RFC 3339)",
      "format": "date-time",
      "type": "string"
    },
    "values_per_unit": {
      "description": "What one point is worth for this reward, one per currency. Present for custom variable-amount rewards (`redemption_type` `AMOUNT_BASED`) that set them. A redemption of this reward with a `face_value` in one of these currencies converts it to points with this value instead of the asset's `value_per_unit`.",
      "items": {
        "$ref": "#/$defs/DecimalMoney"
      },
      "type": "array"
    }
  },
  "type": "object",
  "$defs": {
    "DecimalMoney": {
      "description": "A fiat amount as a decimal string in major units, such as `0.01` for one US cent, with the ISO 4217 currency code. Unlike Money, the amount can be a fraction of a minor unit.",
      "properties": {
        "amount": {
          "description": "Amount in major units of the currency, as a decimal string",
          "type": "string"
        },
        "currency": {
          "description": "ISO 4217 currency code",
          "type": "string"
        }
      },
      "type": "object"
    },
    "Money": {
      "description": "A fiat amount: an integer count of the currency's minor units, such as cents, and the ISO 4217 currency code.",
      "properties": {
        "amount_minor": {
          "description": "Amount in the currency's minor units, such as cents for USD",
          "type": "integer"
        },
        "currency": {
          "description": "ISO 4217 currency code",
          "type": "string"
        }
      },
      "required": [
        "amount_minor",
        "currency"
      ],
      "type": "object"
    },
    "ProductDisplay": {
      "description": "Descriptive content a provider supplies for a product. The HTML comes from the provider, so sanitize it before you show it.",
      "properties": {
        "description_html": {
          "description": "Product description in HTML; sanitize before rendering",
          "type": "string"
        },
        "disclosure_html": {
          "description": "Product disclosures in HTML; sanitize before rendering",
          "type": "string"
        },
        "image_url": {
          "description": "A link to a picture of the product.",
          "type": "string"
        },
        "instructions_html": {
          "description": "Redemption instructions in HTML; sanitize before rendering",
          "type": "string"
        }
      },
      "type": "object"
    },
    "RewardFulfillment": {
      "description": "How Scrip fulfills a managed reward: its type, pricing, supported countries, currencies, denominations, and delivery method.",
      "properties": {
        "account_status": {
          "description": "Lifecycle status of the fulfillment account backing this reward. Redemptions are accepted only while ACTIVE; ARCHIVED means the account was removed.",
          "enum": [
            "ACTIVE",
            "DISABLED",
            "PENDING_ONBOARDING",
            "PENDING_REVIEW",
            "REJECTED",
            "ARCHIVED"
          ],
          "type": "string"
        },
        "asset_scale": {
          "description": "Decimal places supported by the asset used to pay for this reward",
          "maximum": 18,
          "minimum": 0,
          "type": "integer"
        },
        "countries": {
          "description": "Countries where the product can be used.",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "currencies": {
          "description": "Currencies accepted when redeeming this reward",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "delivery_method": {
          "description": "How the participant accesses a successfully fulfilled reward.",
          "enum": [
            "claim_link"
          ],
          "type": "string"
        },
        "denominations": {
          "description": "Allowed fixed face values, in addition to any allowed range, listed once per accepted currency.",
          "items": {
            "$ref": "#/$defs/Money"
          },
          "type": "array"
        },
        "limits": {
          "$ref": "#/$defs/RewardFulfillmentLimits",
          "description": "The limits set for this reward alone in its product settings, on top of the program's limits. An empty object when it has none."
        },
        "pricing": {
          "description": "Pricing mode (`FIXED` uses the chosen face value).",
          "enum": [
            "FIXED"
          ],
          "type": "string"
        },
        "product_status": {
          "description": "Whether the fulfillment account still lists the product. REMOVED means the vendor stopped selling it, and Scrip archives the reward.",
          "enum": [
            "ACTIVE",
            "REMOVED"
          ],
          "type": "string"
        },
        "rate": {
          "description": "Asset units per currency minor unit of face value (omitted when pinned to a single face value).",
          "type": "string"
        },
        "rate_override": {
          "description": "The rate set for this reward alone, in asset units per currency minor unit, from its product settings. Null when the reward uses the reward source's rate.",
          "type": [
            "string",
            "null"
          ]
        },
        "type": {
          "description": "Fulfillment delivery type (`GIFT_CARD` for gift cards, prepaid cards, and charity).",
          "enum": [
            "GIFT_CARD"
          ],
          "type": "string"
        },
        "value_max": {
          "description": "Maximum allowed face value (null for fixed denominations only or multi-currency products).",
          "oneOf": [
            {
              "$ref": "#/$defs/Money"
            },
            {
              "type": "null"
            }
          ]
        },
        "value_min": {
          "description": "Minimum allowed face value (null for fixed denominations only or multi-currency products).",
          "oneOf": [
            {
              "$ref": "#/$defs/Money"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "type": "object"
    },
    "RewardFulfillmentLimits": {
      "description": "The limits one reward has in its product settings. A limit you have not set is left out.",
      "properties": {
        "currency": {
          "description": "The currency of the two amounts above, when the reward is limited to one currency. Left out when the reward takes more than one currency, and when it has no amount limit.",
          "type": "string"
        },
        "max_face_value_minor": {
          "description": "Largest face value or price of one redemption of this reward, in minor units of the reward's currency.",
          "type": "integer"
        },
        "participant_max_amount_minor": {
          "description": "Most total value of this reward one participant can redeem in the rolling period, in minor units of the reward's currency.",
          "type": "integer"
        },
        "participant_max_count": {
          "description": "Most redemptions of this reward one participant can make in the rolling period.",
          "type": "integer"
        },
        "participant_window_seconds": {
          "description": "Rolling period, in seconds, for this reward's per-participant limits.",
          "type": "integer"
        }
      },
      "type": "object"
    }
  }
}