{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/scrip-dev/json-schema/scrip-dev-redemption-response-schema.json",
  "title": "RedemptionResponse",
  "description": "A redemption: value a participant spent, with its status and fulfillment.",
  "x-generated": "2026-11-24",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/scrip-dev-openapi.json#/components/schemas/RedemptionResponse",
  "properties": {
    "amount": {
      "description": "Total amount debited from the participant's balance (decimal string)",
      "type": "string"
    },
    "asset_id": {
      "description": "The asset that was debited",
      "format": "uuid",
      "type": "string"
    },
    "capture_journal_entry_id": {
      "description": "Ledger entry that completed a pending redemption",
      "format": "uuid",
      "type": "string"
    },
    "captured_at": {
      "description": "When the pending redemption was completed",
      "format": "date-time",
      "type": "string"
    },
    "cost": {
      "$ref": "#/$defs/Money",
      "description": "What the provider billed, in its own currency. Present only when you sent it to complete the redemption."
    },
    "created_at": {
      "description": "When this redemption was created",
      "format": "date-time",
      "type": "string"
    },
    "description": {
      "description": "Context for this redemption, used in journal entries",
      "type": "string"
    },
    "expires_at": {
      "description": "The redemption's deadline. Present for pending redemptions; defaults to 90 days and may be configured up to one year.",
      "format": "date-time",
      "type": "string"
    },
    "face_value": {
      "$ref": "#/$defs/Money",
      "description": "The money the redemption pays for, such as a $50 gift card. Present when the redemption has a money price (`face_value` sent instead of `amount`, or a gift card's value). `amount` records the points it priced to at redemption time."
    },
    "failure_reason": {
      "description": "Machine-readable or operator-supplied terminal failure detail",
      "type": "string"
    },
    "fulfillment": {
      "$ref": "#/$defs/RedemptionFulfillmentSummary",
      "description": "Gift-card vendor order status, present only for provider-backed\n(fulfillment) redemptions"
    },
    "id": {
      "description": "Unique identifier for this redemption",
      "format": "uuid",
      "type": "string"
    },
    "journal_entry_id": {
      "description": "Immutable ledger anchor: the `HOLD` entry for a pending redemption, otherwise the instant redemption entry",
      "format": "uuid",
      "type": "string"
    },
    "order_id": {
      "description": "The provider's id for the purchase. Present only when you sent it with `provider` to complete the redemption.",
      "type": "string"
    },
    "participant_id": {
      "description": "The participant who redeemed",
      "format": "uuid",
      "type": "string"
    },
    "program_id": {
      "description": "The program this redemption belongs to",
      "format": "uuid",
      "type": "string"
    },
    "provider": {
      "description": "Who you bought from, as free text. Present only when you sent it to complete the redemption.",
      "type": "string"
    },
    "quantity": {
      "description": "Number of units redeemed (catalog redemptions only)",
      "type": "integer"
    },
    "release_journal_entry_id": {
      "description": "Ledger entry that released the held points back to AVAILABLE. Present only on FAILED or CANCELLED redemptions whose hold was released.",
      "format": "uuid",
      "type": "string"
    },
    "released_amount": {
      "description": "Amount returned to AVAILABLE by the release entry (decimal string). Present only when `release_journal_entry_id` is present.",
      "type": "string"
    },
    "reservation_id": {
      "description": "The ID of the hold behind a pending redemption",
      "format": "uuid",
      "type": "string"
    },
    "resolved_at": {
      "description": "When the pending redemption reached a terminal state",
      "format": "date-time",
      "type": "string"
    },
    "reversals": {
      "description": "The redemption's reversals, newest first: the newest 100 when there are more, and reversed_amount covers them all. Returned by GET /v1/redemptions/{redemption_id} with `expand[]=reversals`, as an empty list when the redemption has none.",
      "items": {
        "$ref": "#/$defs/RedemptionReversalResponse"
      },
      "type": "array"
    },
    "reversed_amount": {
      "description": "Cumulative amount reversed so far (decimal string)",
      "type": "string"
    },
    "reversed_quantity": {
      "description": "Cumulative units reversed so far (UNIT_BASED catalog redemptions only)",
      "type": "integer"
    },
    "reward_id": {
      "description": "The reward catalog item that was redeemed (catalog redemptions only)",
      "format": "uuid",
      "type": "string"
    },
    "status": {
      "description": "Current lifecycle and reversal state",
      "enum": [
        "PENDING",
        "COMPLETED",
        "FAILED",
        "CANCELLED",
        "PARTIALLY_REVERSED",
        "FULLY_REVERSED"
      ],
      "type": "string"
    },
    "unit_cost": {
      "description": "Cost per unit at the time of redemption (catalog redemptions only, decimal string)",
      "type": "string"
    },
    "updated_at": {
      "description": "When this redemption was last updated (e.g., after a reversal)",
      "format": "date-time",
      "type": "string"
    }
  },
  "type": "object",
  "$defs": {
    "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"
    },
    "RedemptionFulfillmentSummary": {
      "description": "The current fulfillment outcome of a redemption, such as the provider order and any failure reason.",
      "properties": {
        "claim_url": {
          "description": "Usable claim link, when available on the catalog redemption creation response. Omitted on GET/list; use POST /v1/redemptions/{id}/claim-link to retrieve a link.",
          "type": "string"
        },
        "created_at": {
          "description": "When this fulfillment was created",
          "format": "date-time",
          "type": "string"
        },
        "face_value": {
          "$ref": "#/$defs/Money",
          "description": "Face value ordered"
        },
        "failure_reason": {
          "description": "Bounded terminal failure reason, present only when FAILED",
          "type": "string"
        },
        "provider": {
          "description": "Gift-card provider fulfilling this redemption.",
          "type": "string"
        },
        "provider_order_id": {
          "description": "Provider's order identifier, present once an order has been placed",
          "type": "string"
        },
        "resolved_at": {
          "description": "When this fulfillment reached a terminal state",
          "format": "date-time",
          "type": "string"
        },
        "status": {
          "description": "Fulfillment lifecycle status",
          "enum": [
            "PENDING",
            "PROCESSING",
            "SUCCEEDED",
            "FAILED",
            "AWAITING_FUNDS",
            "CANCELLED"
          ],
          "type": "string"
        },
        "type": {
          "description": "What the fulfillment delivers (`GIFT_CARD` for gift cards, prepaid cards, and charity).",
          "enum": [
            "GIFT_CARD"
          ],
          "type": "string"
        },
        "updated_at": {
          "description": "When this fulfillment was last updated",
          "format": "date-time",
          "type": "string"
        }
      },
      "type": "object"
    },
    "RedemptionReversalResponse": {
      "description": "A reversal of all or part of a redemption.",
      "properties": {
        "amount": {
          "description": "Amount credited back to the participant's balance (decimal string)",
          "type": "string"
        },
        "created_at": {
          "description": "When this reversal was created",
          "format": "date-time",
          "type": "string"
        },
        "id": {
          "description": "Unique identifier for this reversal",
          "format": "uuid",
          "type": "string"
        },
        "journal_entry_id": {
          "description": "The ledger journal entry created by this reversal",
          "format": "uuid",
          "type": "string"
        },
        "quantity": {
          "description": "Units reversed (UNIT_BASED catalog redemptions only)",
          "type": "integer"
        },
        "reason": {
          "description": "Why this reversal was made",
          "type": "string"
        },
        "redemption_id": {
          "description": "The redemption that was reversed",
          "format": "uuid",
          "type": "string"
        }
      },
      "type": "object"
    }
  }
}