> ## Documentation Index
> Fetch the complete documentation index at: https://docs.scrip.dev/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Start with https://docs.scrip.dev/agents.md and https://docs.scrip.dev/which-endpoints-you-need.md. Your application only needs a few API calls as users earn and spend (`POST /v1/events`, balance/history reads, and redemptions); program setup happens in the dashboard or setup scripts.
> Use `https://api-sandbox.scrip.dev` with `sk_test_` keys for testing, and `https://api.scrip.dev` with `sk_live_` keys for production. Keep API keys on your server.
> Pass your own user ID as `external_id` on events and prefix it with `ext:` in participant URL paths (e.g., `GET /v1/participants/ext:user_123/balances`). By default (`on_unknown_participant: CREATE`), the first event for a new `external_id` creates and enrolls the participant automatically.
> Events process asynchronously: `POST /v1/events` returns `202 Accepted` when queued, and rules evaluate in the background. Pass an `idempotency_key` (such as an order ID) on every event, and wait for the `event.completed` webhook or poll `GET /v1/events/{event_id}` before reading updated balances.
> Connect the hosted MCP server at https://mcp.scrip.dev/mcp (OAuth, defaults to Sandbox) to inspect programs, validate and simulate rules, and trace events. Append `.md` to any docs URL for Markdown, or fetch https://docs.scrip.dev/openapi.json for full endpoint schemas.

# Cancel a pending redemption

> Cancel a pending redemption and release its held balance.

Marks a `PENDING` redemption as `CANCELLED` and returns any remaining `HELD` points to `AVAILABLE` in one `RELEASE` journal entry (`release_journal_entry_id` and `released_amount`).

* **Gift-card redemptions:** Cancelling also fails the fulfillment with `redemption_cancelled`. Once Scrip places the provider order, cancellation returns `409 fulfillment_in_progress`.
* **Expired held lots:** On `LOT`-mode assets, only unexpired held value is released; if all held points already expired, no `RELEASE` entry is created and `release_journal_entry_id` and `released_amount` are `null`.
* **Retries:** Repeating cancellation returns the stored redemption; a different terminal outcome returns `409 redemption_already_resolved`.

> [!NOTE]
>
> For expiration and terminal state behavior, see [Pending redemptions](https://docs.scrip.dev/guides/redemption-lifecycle.md).


## OpenAPI

````yaml POST /v1/redemptions/{redemption_id}/cancel
openapi: 3.1.0
info:
  contact:
    email: support@scrip.dev
    name: Scrip Support
  description: >-
    Scrip is the operating system for rewards programs. Use this REST API to
    send events, read balances and history, trigger redemptions, and configure
    programs, assets, rules, tiers, and rewards. Full guides and reference:
    https://docs.scrip.dev


    Base URLs:

    - **Sandbox:** `https://api-sandbox.scrip.dev` (keys start with `sk_test_`)

    - **Production:** `https://api.scrip.dev` (keys start with `sk_live_`)


    Authentication & headers:

    - Pass `Authorization: Bearer <api_key>` on every request.

    - Pass `Content-Type: application/json` on requests with a JSON body.


    Response envelopes:

    - **List endpoints** return `{"data": [...], "pagination": {"has_more":
    false, "next_cursor": null}}`.

    - **Single-resource endpoints** return the resource object directly.

    - **Errors** return `{"type": "...", "code": "...", "message": "...",
    "request_id": "...", "doc_url": "..."}` (plus `param`, `fields`, or
    `details` when applicable). Match on `code` in your error handling and
    include `request_id` when contacting support.


    Participant identifiers: every `{participant_id}` path accepts either
    Scrip's UUID or `ext:` followed by your own `external_id` (for example,
    `/v1/participants/ext:user_123/balances`).


    Idempotency: every operation carries `x-scrip-idempotency` (`replay`,
    `conflict_safe`, `natural_key`, or `none`). On `replay` routes, repeating a
    request with the same `Idempotency-Key` within 24 hours returns the original
    response with `Idempotent-Replayed: true`.
  license:
    name: Proprietary
  termsOfService: https://scrip.dev/terms
  title: Scrip API
  version: '1.0'
servers:
  - description: Production
    url: https://api.scrip.dev
  - description: Sandbox
    url: https://api-sandbox.scrip.dev
security: []
tags:
  - description: Create and manage rewards programs and program wallets.
    name: Programs
  - description: Group programs and other folders inside your organization.
    name: Folders
  - description: Define and manage units of value (points, cashback, credits).
    name: Assets
  - description: Manage participants, balances, state, and transaction history.
    name: Participants
  - description: Manage participant groups with shared balances and state.
    name: Groups
  - description: Create, validate, simulate, and version earn rules.
    name: Rules
  - description: Ingest, inspect, retry, and reverse user events.
    name: Events
  - description: Transfer balances between participants and groups.
    name: Transfers
  - description: >-
      Liability, rollforward, attribution, expiration, activity, and fulfillment
      cost reports.
    name: Reporting
  - description: >-
      Redeem participant balances for catalog items, gift cards, or custom
      amounts.
    name: Redemptions
  - description: Manage items in a program's rewards catalog.
    name: Rewards
  - description: Schedule recurring, one-time, or participant-state-triggered events.
    name: Automations
  - description: >-
      Configure ranked tier tracks, qualification criteria, and downgrade
      policies.
    name: Tiers
  - description: Inspect double-entry ledger records for auditing and reconciliation.
    name: Journal Entries
  - description: >-
      Manage webhook endpoints and delivery logs. Webhooks notify your
      application of real-time events via HTTP POST with HMAC-SHA256 signatures.
    name: Webhooks
  - description: >-
      Inspect the gift-card provider accounts that fulfill redemptions, and the
      products each one offers.
    name: Fulfillment Accounts
  - description: >-
      Connect a program to a fulfillment account so its catalog backs rewards,
      and choose which products the program offers.
    name: Reward Sources
  - description: >-
      Group a program's rules into ordered sets, and reorder the sets and the
      rules inside them.
    name: Rule Sets
  - description: >-
      Events Scrip sends to your webhook endpoints. Each key under `webhooks` is
      an event type, and its request body is the delivery.
    name: Webhook events
paths:
  /v1/redemptions/{redemption_id}/cancel:
    post:
      tags:
        - Redemptions
      summary: Cancel a redemption
      description: Cancel a pending redemption and release its held balance.
      operationId: cancelRedemption
      parameters:
        - description: The redemption's id.
          example: 7f422b43-4ba2-41c7-b05d-e4e90b68e978
          in: path
          name: redemption_id
          required: true
          schema:
            format: uuid
            type: string
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        content:
          application/json:
            example:
              reason: participant_changed_plans
            schema:
              $ref: '#/components/schemas/CancelRedemptionRequest'
        description: Cancellation details
        x-originalParamName: request
      responses:
        '200':
          content:
            application/json:
              examples:
                default:
                  value:
                    amount: '1000.00'
                    asset_id: a3bb189e-8bf9-4c8b-9be0-6b5d2f4e7a02
                    capture_journal_entry_id: 657a0312-1aaa-4ba7-842b-edfbb39edf14
                    captured_at: '2027-01-15T10:30:00Z'
                    created_at: '2027-01-15T10:30:00Z'
                    description: 'Redeemed: Insulated Water Bottle'
                    id: 7f422b43-4ba2-41c7-b05d-e4e90b68e978
                    journal_entry_id: 657a0312-1aaa-4ba7-842b-edfbb39edf14
                    participant_id: f7a8b9c0-1d2e-4f3a-b4c5-d6e7f8a9b006
                    program_id: 8f14e45f-ceea-4e70-9df8-2a7d1b3c9f01
                    reservation_id: 5d1f8a26-3c79-4e0b-9a64-b2e7c1d85f10
                    resolved_at: '2027-01-15T10:30:00Z'
                    reversals:
                      - amount: '500.00'
                        created_at: '2027-01-15T10:30:00Z'
                        id: 9e3c5b71-6d28-4a94-8f1e-0c7b2a4d6e11
                        journal_entry_id: 657a0312-1aaa-4ba7-842b-edfbb39edf14
                        reason: Customer refund request
                        redemption_id: 7f422b43-4ba2-41c7-b05d-e4e90b68e978
                    reversed_amount: '0.00'
                    status: COMPLETED
                    updated_at: '2027-01-15T10:30:00Z'
              schema:
                $ref: '#/components/schemas/RedemptionResponse'
          description: Pending redemption cancelled and held points released
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/X-RateLimit-Limit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/X-RateLimit-Remaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/X-RateLimit-Reset'
            X-Request-ID:
              $ref: '#/components/headers/X-Request-ID'
        '400':
          content:
            application/json:
              examples:
                invalid_json:
                  summary: The request body is not a valid JSON object.
                  value:
                    code: invalid_json
                    doc_url: https://docs.scrip.dev/errors#invalid_json
                    message: The request body is not a valid JSON object.
                    request_id: req_6f1c2d7e-4b7a-4c0e-9c1a-2f3e4d5c6b7a
                    type: invalid_request
                validation_error:
                  summary: >-
                    One or more request fields are missing, malformed or not
                    allowed; `fields` lists each one.
                  value:
                    code: validation_error
                    doc_url: https://docs.scrip.dev/errors#validation_error
                    fields:
                      - field: redemption_id
                        message: redemption_id is not valid.
                        reason: invalid_format
                    message: redemption_id is not valid.
                    param: redemption_id
                    request_id: req_6f1c2d7e-4b7a-4c0e-9c1a-2f3e4d5c6b7a
                    type: invalid_request
              schema:
                $ref: '#/components/schemas/ErrBadRequestResponse'
          description: >-
            Validation failed (code: validation_error | invalid_json |
            header_body_mismatch)
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/X-RateLimit-Limit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/X-RateLimit-Remaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/X-RateLimit-Reset'
            X-Request-ID:
              $ref: '#/components/headers/X-Request-ID'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          content:
            application/json:
              examples:
                redemption_not_found:
                  summary: No redemption with that id exists in your organization.
                  value:
                    code: redemption_not_found
                    doc_url: https://docs.scrip.dev/errors#redemption_not_found
                    message: No redemption with that id exists in your organization.
                    request_id: req_6f1c2d7e-4b7a-4c0e-9c1a-2f3e4d5c6b7a
                    type: not_found
              schema:
                $ref: '#/components/schemas/ErrNotFoundResponse'
          description: 'Redemption not found (code: redemption_not_found)'
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/X-RateLimit-Limit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/X-RateLimit-Remaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/X-RateLimit-Reset'
            X-Request-ID:
              $ref: '#/components/headers/X-Request-ID'
        '409':
          content:
            application/json:
              examples:
                fulfillment_in_progress:
                  summary: >-
                    This redemption's gift-card fulfillment is already in
                    progress and cannot be cancelled or failed.
                  value:
                    code: fulfillment_in_progress
                    doc_url: https://docs.scrip.dev/errors#fulfillment_in_progress
                    message: >-
                      This redemption's gift-card fulfillment is already in
                      progress and cannot be cancelled or failed.
                    request_id: req_6f1c2d7e-4b7a-4c0e-9c1a-2f3e4d5c6b7a
                    type: conflict
                idempotency_conflict:
                  summary: >-
                    This idempotency key was already used with a different
                    request.
                  value:
                    code: idempotency_conflict
                    doc_url: https://docs.scrip.dev/errors#idempotency_conflict
                    message: >-
                      This idempotency key was already used with a different
                      request.
                    request_id: req_6f1c2d7e-4b7a-4c0e-9c1a-2f3e4d5c6b7a
                    type: conflict
                idempotency_in_flight:
                  summary: A request with this idempotency key is still running.
                  value:
                    code: idempotency_in_flight
                    doc_url: https://docs.scrip.dev/errors#idempotency_in_flight
                    message: A request with this idempotency key is still running.
                    request_id: req_6f1c2d7e-4b7a-4c0e-9c1a-2f3e4d5c6b7a
                    type: conflict
                participant_inactive:
                  summary: The participant's status does not allow this operation.
                  value:
                    code: participant_inactive
                    doc_url: https://docs.scrip.dev/errors#participant_inactive
                    message: The participant's status does not allow this operation.
                    request_id: req_6f1c2d7e-4b7a-4c0e-9c1a-2f3e4d5c6b7a
                    type: conflict
                redemption_already_resolved:
                  summary: >-
                    The redemption is no longer `PENDING`: it is already
                    `COMPLETED`, `FAILED`, `CANCELLED` or reversed. Completing a
                    `COMPLETED` redemption again also returns this when you send
                    a `provider`, `order_id` or `cost` that differs from the one
                    it recorded.
                  value:
                    code: redemption_already_resolved
                    doc_url: https://docs.scrip.dev/errors#redemption_already_resolved
                    message: >-
                      The redemption is no longer PENDING: it is already
                      COMPLETED, FAILED, CANCELLED or reversed. Completing a
                      COMPLETED redemption again also returns this when you send
                      a provider, order_id or cost that differs from the one it
                      recorded.
                    request_id: req_6f1c2d7e-4b7a-4c0e-9c1a-2f3e4d5c6b7a
                    type: conflict
                retryable_conflict:
                  summary: >-
                    Another request changed the same records at the same moment,
                    so nothing was saved.
                  value:
                    code: retryable_conflict
                    doc_url: https://docs.scrip.dev/errors#retryable_conflict
                    message: >-
                      Another request changed the same records at the same
                      moment, so nothing was saved.
                    request_id: req_6f1c2d7e-4b7a-4c0e-9c1a-2f3e4d5c6b7a
                    type: conflict
              schema:
                $ref: '#/components/schemas/ErrConflictResponse'
          description: >-
            Redemption already resolved or its gift-card fulfillment is already
            in progress
          headers:
            Retry-After:
              $ref: '#/components/headers/Retry-After'
            X-RateLimit-Limit:
              $ref: '#/components/headers/X-RateLimit-Limit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/X-RateLimit-Remaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/X-RateLimit-Reset'
            X-Request-ID:
              $ref: '#/components/headers/X-Request-ID'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'
      security:
        - BearerAuth: []
components:
  parameters:
    IdempotencyKey:
      description: >-
        Unique key (1-255 printable ASCII characters) to make retries safe.
        Repeating the same request with the same key within 24 hours replays the
        original response (`Idempotent-Replayed: true`).
      in: header
      name: Idempotency-Key
      schema:
        maxLength: 255
        type: string
  schemas:
    CancelRedemptionRequest:
      additionalProperties: false
      description: Cancels a pending redemption and releases its held balance.
      properties:
        idempotency_key:
          description: >-
            Your key for this request. You can send it in the Idempotency-Key
            header instead; when both are sent they must match.
          examples:
            - cancel-2f4b-0001
          type: string
        reason:
          description: Optional fulfillment failure or cancellation reason (1-500 chars)
          examples:
            - participant_changed_plans
          maxLength: 500
          minLength: 1
          type: string
      type: object
    RedemptionResponse:
      description: >-
        A redemption: value a participant spent, with its status and
        fulfillment.
      properties:
        amount:
          description: Total amount debited from the participant's balance (decimal string)
          examples:
            - '1000.00'
          type: string
        asset_id:
          description: The asset that was debited
          examples:
            - a3bb189e-8bf9-4c8b-9be0-6b5d2f4e7a02
          format: uuid
          type: string
        capture_journal_entry_id:
          description: Ledger entry that completed a pending redemption
          examples:
            - 657a0312-1aaa-4ba7-842b-edfbb39edf14
          format: uuid
          type: string
        captured_at:
          description: When the pending redemption was completed
          examples:
            - '2027-01-15T10:30:00Z'
          format: date-time
          type: string
        cost:
          $ref: '#/components/schemas/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
          examples:
            - '2027-01-15T10:30:00Z'
          format: date-time
          type: string
        description:
          description: Context for this redemption, used in journal entries
          examples:
            - 'Redeemed: Insulated Water Bottle'
          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.
          examples:
            - '2027-12-31T23:59:59Z'
          format: date-time
          type: string
        face_value:
          $ref: '#/components/schemas/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
          examples:
            - fulfillment_failed
          type: string
        fulfillment:
          $ref: '#/components/schemas/RedemptionFulfillmentSummary'
          description: |-
            Gift-card vendor order status, present only for provider-backed
            (fulfillment) redemptions
        id:
          description: Unique identifier for this redemption
          examples:
            - 7f422b43-4ba2-41c7-b05d-e4e90b68e978
          format: uuid
          type: string
        journal_entry_id:
          description: >-
            Immutable ledger anchor: the `HOLD` entry for a pending redemption,
            otherwise the instant redemption entry
          examples:
            - 657a0312-1aaa-4ba7-842b-edfbb39edf14
          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.
          examples:
            - ord_123
          type: string
        participant_id:
          description: The participant who redeemed
          examples:
            - f7a8b9c0-1d2e-4f3a-b4c5-d6e7f8a9b006
          format: uuid
          type: string
        program_id:
          description: The program this redemption belongs to
          examples:
            - 8f14e45f-ceea-4e70-9df8-2a7d1b3c9f01
          format: uuid
          type: string
        provider:
          description: >-
            Who you bought from, as free text. Present only when you sent it to
            complete the redemption.
          examples:
            - acme-travel
          type: string
        quantity:
          description: Number of units redeemed (catalog redemptions only)
          examples:
            - 2
          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.
          examples:
            - 657a0312-1aaa-4ba7-842b-edfbb39edf14
          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.
          examples:
            - '1000.00'
          type: string
        reservation_id:
          description: The ID of the hold behind a pending redemption
          examples:
            - 5d1f8a26-3c79-4e0b-9a64-b2e7c1d85f10
          format: uuid
          type: string
        resolved_at:
          description: When the pending redemption reached a terminal state
          examples:
            - '2027-01-15T10:30:00Z'
          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: '#/components/schemas/RedemptionReversalResponse'
          type: array
        reversed_amount:
          description: Cumulative amount reversed so far (decimal string)
          examples:
            - '0.00'
          type: string
        reversed_quantity:
          description: >-
            Cumulative units reversed so far (UNIT_BASED catalog redemptions
            only)
          examples:
            - 0
          type: integer
        reward_id:
          description: The reward catalog item that was redeemed (catalog redemptions only)
          examples:
            - 2b7a9c4e-1f3d-4a8b-9e6c-5a1d3f7b8c08
          format: uuid
          type: string
        status:
          description: Current lifecycle and reversal state
          enum:
            - PENDING
            - COMPLETED
            - FAILED
            - CANCELLED
            - PARTIALLY_REVERSED
            - FULLY_REVERSED
          examples:
            - COMPLETED
          type: string
        unit_cost:
          description: >-
            Cost per unit at the time of redemption (catalog redemptions only,
            decimal string)
          examples:
            - '500.00'
          type: string
        updated_at:
          description: When this redemption was last updated (e.g., after a reversal)
          examples:
            - '2027-01-15T10:30:00Z'
          format: date-time
          type: string
      type: object
    ErrBadRequestResponse:
      additionalProperties: false
      description: 'The error body for a 400 response: the request itself is wrong.'
      properties:
        code:
          description: >-
            The specific reason for the error. Branch on this value, not on
            message
          examples:
            - validation_error
          type: string
        details:
          additionalProperties: true
          description: Extra context for this code, documented per code on the errors page
          type: object
        doc_url:
          description: A link to this code on the errors page
          examples:
            - https://docs.scrip.dev/errors#validation_error
          type: string
        fields:
          description: Every failing field on a validation_error, reported in one pass
          items:
            $ref: '#/components/schemas/ErrorFieldDetail'
          type: array
        message:
          description: What happened and what to do next, in one or two sentences
          examples:
            - The request failed validation. Fix every field listed in fields.
          type: string
        param:
          description: The one request field at fault, when there is one
          type: string
        request_id:
          description: >-
            The id of this request, the same req_ value as the X-Request-ID
            response header. Quote it when you contact support
          examples:
            - req_6f1c2d7e-4b7a-4c0e-9c1a-2f3e4d5c6b7a
          type: string
        type:
          description: The error family. It is one value per HTTP status
          examples:
            - invalid_request
          type: string
      type: object
    ErrNotFoundResponse:
      description: >-
        The error body for a 404 response: the resource does not exist in your
        organization.
      properties:
        code:
          description: >-
            The specific reason for the error. Branch on this value, not on
            message
          examples:
            - participant_not_found
          type: string
        details:
          additionalProperties: true
          description: Extra context for this code, documented per code on the errors page
          type: object
        doc_url:
          description: A link to this code on the errors page
          examples:
            - https://docs.scrip.dev/errors#participant_not_found
          type: string
        fields:
          description: Every failing field on a validation_error, reported in one pass
          items:
            $ref: '#/components/schemas/ErrorFieldDetail'
          type: array
        message:
          description: What happened and what to do next, in one or two sentences
          examples:
            - The participant was not found.
          type: string
        param:
          description: The one request field at fault, when there is one
          type: string
        request_id:
          description: >-
            The id of this request, the same req_ value as the X-Request-ID
            response header. Quote it when you contact support
          examples:
            - req_6f1c2d7e-4b7a-4c0e-9c1a-2f3e4d5c6b7a
          type: string
        type:
          description: The error family. It is one value per HTTP status
          examples:
            - not_found
          type: string
      type: object
    ErrConflictResponse:
      description: >-
        The error body for a 409 response: the current state of a resource
        blocks the request.
      properties:
        code:
          description: >-
            The specific reason for the error. Branch on this value, not on
            message
          examples:
            - idempotency_conflict
          type: string
        details:
          additionalProperties: true
          description: Extra context for this code, documented per code on the errors page
          type: object
        doc_url:
          description: A link to this code on the errors page
          examples:
            - https://docs.scrip.dev/errors#idempotency_conflict
          type: string
        fields:
          description: Every failing field on a validation_error, reported in one pass
          items:
            $ref: '#/components/schemas/ErrorFieldDetail'
          type: array
        message:
          description: What happened and what to do next, in one or two sentences
          examples:
            - >-
              The Idempotency-Key header was already used for a different
              request.
          type: string
        param:
          description: The one request field at fault, when there is one
          type: string
        request_id:
          description: >-
            The id of this request, the same req_ value as the X-Request-ID
            response header. Quote it when you contact support
          examples:
            - req_6f1c2d7e-4b7a-4c0e-9c1a-2f3e4d5c6b7a
          type: string
        type:
          description: The error family. It is one value per HTTP status
          examples:
            - conflict
          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
          examples:
            - 2500
          type: integer
        currency:
          description: ISO 4217 currency code
          examples:
            - USD
          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.
          examples:
            - https://claim.example.com/abc123
          type: string
        created_at:
          description: When this fulfillment was created
          examples:
            - '2027-01-15T10:30:00Z'
          format: date-time
          type: string
        face_value:
          $ref: '#/components/schemas/Money'
          description: Face value ordered
        failure_reason:
          description: Bounded terminal failure reason, present only when FAILED
          examples:
            - provider_permanent_error
          type: string
        provider:
          description: Gift-card provider fulfilling this redemption.
          examples:
            - TREMENDOUS
          type: string
        provider_order_id:
          description: Provider's order identifier, present once an order has been placed
          examples:
            - ord_abc123
          type: string
        resolved_at:
          description: When this fulfillment reached a terminal state
          examples:
            - '2027-01-15T10:30:00Z'
          format: date-time
          type: string
        status:
          description: Fulfillment lifecycle status
          enum:
            - PENDING
            - PROCESSING
            - SUCCEEDED
            - FAILED
            - AWAITING_FUNDS
            - CANCELLED
          examples:
            - PROCESSING
          type: string
        type:
          description: >-
            What the fulfillment delivers (`GIFT_CARD` for gift cards, prepaid
            cards, and charity).
          enum:
            - GIFT_CARD
          examples:
            - GIFT_CARD
          type: string
        updated_at:
          description: When this fulfillment was last updated
          examples:
            - '2027-01-15T10:30:00Z'
          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)
          examples:
            - '500.00'
          type: string
        created_at:
          description: When this reversal was created
          examples:
            - '2027-01-15T10:30:00Z'
          format: date-time
          type: string
        id:
          description: Unique identifier for this reversal
          examples:
            - 9e3c5b71-6d28-4a94-8f1e-0c7b2a4d6e11
          format: uuid
          type: string
        journal_entry_id:
          description: The ledger journal entry created by this reversal
          examples:
            - 657a0312-1aaa-4ba7-842b-edfbb39edf14
          format: uuid
          type: string
        quantity:
          description: Units reversed (UNIT_BASED catalog redemptions only)
          examples:
            - 1
          type: integer
        reason:
          description: Why this reversal was made
          examples:
            - Customer refund request
          type: string
        redemption_id:
          description: The redemption that was reversed
          examples:
            - 7f422b43-4ba2-41c7-b05d-e4e90b68e978
          format: uuid
          type: string
      type: object
    ErrorFieldDetail:
      description: 'One failing field: its JSON name, why it failed, and what to change.'
      properties:
        field:
          description: The JSON name of the failing field, with dots for nested fields
          type: string
        message:
          description: What to change in this field
          type: string
        reason:
          description: >-
            Why the field failed: required, invalid_format, out_of_range,
            unknown_field, not_allowed or too_long
          examples:
            - required
          type: string
      type: object
    ErrUnauthorizedResponse:
      description: 'The error body for a 401 response: the API key is missing or not valid.'
      properties:
        code:
          description: >-
            The specific reason for the error. Branch on this value, not on
            message
          examples:
            - invalid_api_key
          type: string
        details:
          additionalProperties: true
          description: Extra context for this code, documented per code on the errors page
          type: object
        doc_url:
          description: A link to this code on the errors page
          examples:
            - https://docs.scrip.dev/errors#invalid_api_key
          type: string
        fields:
          description: Every failing field on a validation_error, reported in one pass
          items:
            $ref: '#/components/schemas/ErrorFieldDetail'
          type: array
        message:
          description: What happened and what to do next, in one or two sentences
          examples:
            - >-
              The API key in the Authorization header is unknown, revoked or
              needs rotation.
          type: string
        param:
          description: The one request field at fault, when there is one
          type: string
        request_id:
          description: >-
            The id of this request, the same req_ value as the X-Request-ID
            response header. Quote it when you contact support
          examples:
            - req_6f1c2d7e-4b7a-4c0e-9c1a-2f3e4d5c6b7a
          type: string
        type:
          description: The error family. It is one value per HTTP status
          examples:
            - authentication
          type: string
      type: object
    ErrForbiddenResponse:
      description: 'The error body for a 403 response: the caller is not allowed to do this.'
      properties:
        code:
          description: >-
            The specific reason for the error. Branch on this value, not on
            message
          examples:
            - insufficient_permissions
          type: string
        details:
          additionalProperties: true
          description: Extra context for this code, documented per code on the errors page
          type: object
        doc_url:
          description: A link to this code on the errors page
          examples:
            - https://docs.scrip.dev/errors#insufficient_permissions
          type: string
        fields:
          description: Every failing field on a validation_error, reported in one pass
          items:
            $ref: '#/components/schemas/ErrorFieldDetail'
          type: array
        message:
          description: What happened and what to do next, in one or two sentences
          examples:
            - Your dashboard role does not allow this action.
          type: string
        param:
          description: The one request field at fault, when there is one
          type: string
        request_id:
          description: >-
            The id of this request, the same req_ value as the X-Request-ID
            response header. Quote it when you contact support
          examples:
            - req_6f1c2d7e-4b7a-4c0e-9c1a-2f3e4d5c6b7a
          type: string
        type:
          description: The error family. It is one value per HTTP status
          examples:
            - permission
          type: string
      type: object
    ErrTooManyRequestsResponse:
      additionalProperties: false
      description: >-
        The error body for a 429 response: you sent more requests than the rate
        limit allows.
      properties:
        code:
          description: >-
            The specific reason for the error. Branch on this value, not on
            message
          examples:
            - rate_limit_exceeded
          type: string
        details:
          additionalProperties: true
          description: Extra context for this code, documented per code on the errors page
          type: object
        doc_url:
          description: A link to this code on the errors page
          examples:
            - https://docs.scrip.dev/errors#rate_limit_exceeded
          type: string
        fields:
          description: Every failing field on a validation_error, reported in one pass
          items:
            $ref: '#/components/schemas/ErrorFieldDetail'
          type: array
        message:
          description: What happened and what to do next, in one or two sentences
          examples:
            - Rate limit exceeded. Wait for the Retry-After delay, then retry.
          type: string
        param:
          description: The one request field at fault, when there is one
          type: string
        request_id:
          description: >-
            The id of this request, the same req_ value as the X-Request-ID
            response header. Quote it when you contact support
          examples:
            - req_6f1c2d7e-4b7a-4c0e-9c1a-2f3e4d5c6b7a
          type: string
        type:
          description: The error family. It is one value per HTTP status
          examples:
            - rate_limited
          type: string
      type: object
    ErrInternalResponse:
      description: >-
        The error body for a 500 response: something failed on Scrip's side.
        Quote the `request_id` when you contact support.
      properties:
        code:
          description: >-
            The specific reason for the error. Branch on this value, not on
            message
          examples:
            - internal_error
          type: string
        doc_url:
          description: A link to this code on the errors page
          examples:
            - https://docs.scrip.dev/errors#internal_error
          type: string
        message:
          description: What happened and what to do next, in one or two sentences
          examples:
            - >-
              An internal error occurred. Retry the request; if it keeps
              failing, contact support with the request_id.
          type: string
        request_id:
          description: >-
            The id of this request, the same req_ value as the X-Request-ID
            response header. Quote it when you contact support
          examples:
            - req_6f1c2d7e-4b7a-4c0e-9c1a-2f3e4d5c6b7a
          type: string
        type:
          description: The error family. It is one value per HTTP status
          examples:
            - internal
          type: string
      type: object
  headers:
    X-RateLimit-Limit:
      description: Request ceiling enforced by the API instance that served your request.
      schema:
        examples:
          - 1000
        type: integer
    X-RateLimit-Remaining:
      description: Requests left before the instance that served your request returns 429.
      schema:
        examples:
          - 0
        type: integer
    X-RateLimit-Reset:
      description: >-
        Unix time in seconds when the instance that served your request has its
        full allowance again.
      schema:
        examples:
          - 1790000000
        type: integer
    X-Request-ID:
      description: >-
        The id of this request, the same `req_` value as `request_id` in an
        error body. Quote it when you contact support.
      schema:
        examples:
          - req_6f1c2d7e-4b7a-4c0e-9c1a-2f3e4d5c6b7a
        type: string
    Retry-After:
      description: Seconds to wait before you retry, rounded up to a whole second.
      schema:
        examples:
          - 1
        type: integer
    WWW-Authenticate:
      description: >-
        The authentication challenge: `Bearer realm="scrip"`. Send your API key
        as a bearer token.
      schema:
        examples:
          - Bearer realm="scrip"
        type: string
  responses:
    Unauthorized:
      content:
        application/json:
          examples:
            authentication_required:
              summary: The request carried no API key or session token.
              value:
                code: authentication_required
                doc_url: https://docs.scrip.dev/errors#authentication_required
                message: The request carried no API key or session token.
                request_id: req_6f1c2d7e-4b7a-4c0e-9c1a-2f3e4d5c6b7a
                type: authentication
            invalid_api_key:
              summary: >-
                The API key in the `Authorization` header is unknown, revoked or
                needs rotation.
              value:
                code: invalid_api_key
                doc_url: https://docs.scrip.dev/errors#invalid_api_key
                message: >-
                  The API key in the Authorization header is unknown, revoked or
                  needs rotation.
                request_id: req_6f1c2d7e-4b7a-4c0e-9c1a-2f3e4d5c6b7a
                type: authentication
          schema:
            $ref: '#/components/schemas/ErrUnauthorizedResponse'
      description: >-
        The API key is missing or not valid. See
        [Authentication](https://docs.scrip.dev/authentication).
      headers:
        WWW-Authenticate:
          $ref: '#/components/headers/WWW-Authenticate'
        X-Request-ID:
          $ref: '#/components/headers/X-Request-ID'
    Forbidden:
      content:
        application/json:
          examples:
            insufficient_permissions:
              summary: Your dashboard role does not allow this action.
              value:
                code: insufficient_permissions
                doc_url: https://docs.scrip.dev/errors#insufficient_permissions
                message: Your dashboard role does not allow this action.
                request_id: req_6f1c2d7e-4b7a-4c0e-9c1a-2f3e4d5c6b7a
                type: permission
          schema:
            $ref: '#/components/schemas/ErrForbiddenResponse'
      description: The caller is not allowed to do this.
      headers:
        X-RateLimit-Limit:
          $ref: '#/components/headers/X-RateLimit-Limit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/X-RateLimit-Remaining'
        X-RateLimit-Reset:
          $ref: '#/components/headers/X-RateLimit-Reset'
        X-Request-ID:
          $ref: '#/components/headers/X-Request-ID'
    TooManyRequests:
      content:
        application/json:
          examples:
            rate_limit_exceeded:
              summary: Your organization sent more requests than the rate limit allows.
              value:
                code: rate_limit_exceeded
                doc_url: https://docs.scrip.dev/errors#rate_limit_exceeded
                message: >-
                  Your organization sent more requests than the rate limit
                  allows.
                request_id: req_6f1c2d7e-4b7a-4c0e-9c1a-2f3e4d5c6b7a
                type: rate_limited
          schema:
            $ref: '#/components/schemas/ErrTooManyRequestsResponse'
      description: >-
        Too many requests. Wait the number of seconds in the `Retry-After`
        header, then retry. See [Limits and
        durations](https://docs.scrip.dev/limits#rate-limits).
      headers:
        Retry-After:
          $ref: '#/components/headers/Retry-After'
        X-RateLimit-Limit:
          $ref: '#/components/headers/X-RateLimit-Limit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/X-RateLimit-Remaining'
        X-RateLimit-Reset:
          $ref: '#/components/headers/X-RateLimit-Reset'
        X-Request-ID:
          $ref: '#/components/headers/X-Request-ID'
    InternalError:
      content:
        application/json:
          examples:
            internal_error:
              summary: Scrip hit an unexpected error while handling the request.
              value:
                code: internal_error
                doc_url: https://docs.scrip.dev/errors#internal_error
                message: Scrip hit an unexpected error while handling the request.
                request_id: req_6f1c2d7e-4b7a-4c0e-9c1a-2f3e4d5c6b7a
                type: internal
          schema:
            $ref: '#/components/schemas/ErrInternalResponse'
      description: >-
        Something failed on Scrip's side. Retry the request, and quote
        `request_id` if it keeps failing.
        [Errors](https://docs.scrip.dev/errors) lists every code, and the [API
        introduction](https://docs.scrip.dev/api-reference/introduction)
        describes the error format.
      headers:
        X-RateLimit-Limit:
          $ref: '#/components/headers/X-RateLimit-Limit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/X-RateLimit-Remaining'
        X-RateLimit-Reset:
          $ref: '#/components/headers/X-RateLimit-Reset'
        X-Request-ID:
          $ref: '#/components/headers/X-Request-ID'
  securitySchemes:
    BearerAuth:
      description: 'Send your API key as `Authorization: Bearer <key>`.'
      scheme: bearer
      type: http
      x-default: sk_...

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.