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

# Redeem loyalty points for a reward

> Allows a customer to redeem their loyalty points for a specific reward option. This deducts points from their balance and generates a discount code or applies the reward.

**What happens:**
1. Validates customer has enough points
2. Deducts points from customer's balance
3. Generates discount code (for discount rewards)
4. Records redemption in customer's history
5. Returns discount code or confirmation

**Reward Types:**
- **Discount codes**: Generates unique code customer can use at checkout
- **Auto-apply discounts**: Automatically applied to next order
- **Free products**: Adds free product to next order
- **Free shipping**: Waives shipping on next order

**Important Notes:**
- Points are deducted immediately and cannot be refunded
- Discount codes typically expire after 30 days
- Some rewards have minimum purchase requirements
- Rewards cannot be combined with other discounts (depends on configuration)

**Use Cases:**
- Customer clicks 'Redeem' button in customer portal
- Apply points at checkout
- Redeem points for subscription discount

**Authentication:** Customer must be logged in via Shopify customer session



## OpenAPI

````yaml /subscription/storefront-api-swagger.json post /subscriptions/cp/api/loyalty-integration/redeem
openapi: 3.0.1
info:
  description: >-
    Comprehensive API documentation for the customer-facing subscription portal.
    These APIs enable customers to manage their subscriptions, update billing
    information, modify delivery schedules, and access their account details
    through your storefront.


    **Important**: These APIs must be called from your shop's domain (e.g.,
    https://www.myshop.com/apps/subscriptions/cp/api/**) and require customer
    authentication. Unauthenticated requests will return a 401 Unauthorized
    error.
  title: Storefront APIs
  version: 0.0.1
servers:
  - url: https://www.myshop.com/apps
security: []
tags:
  - description: >-
      Core customer portal APIs for managing customer account settings,
      authentication, and portal configurations.
    name: Customer Portal
  - description: >-
      APIs for customers to view and manage their subscription contracts
      including status updates, frequency changes, and cancellations.
    name: Subscription Management
  - description: >-
      APIs for retrieving and updating subscription contract details — delivery
      schedules, line items, addresses, billing cycles.
    name: Subscription Contracts
  - description: >-
      APIs for retrieving available subscription plans and selling plan
      configurations exposed to customers.
    name: Subscription Plans
  - description: >-
      APIs for managing one-time add-on products that can be purchased alongside
      recurring subscription items.
    name: Subscription One-Time Products
  - description: >-
      APIs for retrieving aggregated subscription data and account-level
      subscription information for the signed-in customer.
    name: Subscription Data
  - description: >-
      APIs for managing customizable product boxes and bundles where customers
      can select multiple items.
    name: Build-a-Box & Bundles
  - description: >-
      APIs for managing payment methods, billing information, and processing
      subscription payments.
    name: Billing & Payments
  - description: >-
      APIs for retrieving product information, selling plans, variant data, and
      subscription-enabled products available to customers.
    name: Product Catalog
  - description: >-
      APIs for managing delivery schedules, shipping addresses, delivery
      methods, and tracking order status.
    name: Delivery & Shipping
  - description: >-
      APIs for handling subscription cancellations, retention activities, and
      customer feedback management.
    name: Customer Retention
  - description: >-
      APIs for integrating loyalty programs with subscriptions including points
      redemption and earning options.
    name: Loyalty Integration
  - description: >-
      APIs for accessing portal customization settings, translations, and theme
      configurations.
    name: Customization
  - description: >-
      APIs for retrieving promotional campaigns shown in the customer portal,
      tracking banner engagement, and redeeming campaign offers.
    name: Campaigns
  - description: >-
      APIs for local pickup and click-and-collect — listing pickup locations and
      resolving eligible pickup dates and time slots.
    name: Store Pickup
paths:
  /subscriptions/cp/api/loyalty-integration/redeem:
    post:
      tags:
        - Loyalty Integration
      summary: Redeem loyalty points for a reward
      description: >-
        Allows a customer to redeem their loyalty points for a specific reward
        option. This deducts points from their balance and generates a discount
        code or applies the reward.


        **What happens:**

        1. Validates customer has enough points

        2. Deducts points from customer's balance

        3. Generates discount code (for discount rewards)

        4. Records redemption in customer's history

        5. Returns discount code or confirmation


        **Reward Types:**

        - **Discount codes**: Generates unique code customer can use at checkout

        - **Auto-apply discounts**: Automatically applied to next order

        - **Free products**: Adds free product to next order

        - **Free shipping**: Waives shipping on next order


        **Important Notes:**

        - Points are deducted immediately and cannot be refunded

        - Discount codes typically expire after 30 days

        - Some rewards have minimum purchase requirements

        - Rewards cannot be combined with other discounts (depends on
        configuration)


        **Use Cases:**

        - Customer clicks 'Redeem' button in customer portal

        - Apply points at checkout

        - Redeem points for subscription discount


        **Authentication:** Customer must be logged in via Shopify customer
        session
      operationId: redeemPoints
      parameters:
        - description: Customer ID (Shopify GraphQL ID format)
          example: gid://shopify/Customer/6548267876558
          in: query
          name: customerId
          required: true
          schema:
            type: string
        - description: ID of the redemption option to redeem
          example: 1
          in: query
          name: redeemOptionId
          required: true
          schema:
            format: int64
            type: integer
        - description: Number of points to redeem (for variable point redemptions)
          in: query
          name: points
          required: false
          schema:
            format: int64
            type: integer
      responses:
        '200':
          content:
            application/json:
              examples:
                Discount code generated:
                  description: Discount code generated
                  value: LOYALTY500-ABC123
          description: Points redeemed successfully
        '400':
          content:
            '*/*':
              schema:
                type: string
          description: Insufficient points or invalid redemption option
        '401':
          content:
            '*/*':
              schema:
                type: string
          description: Customer not logged in

````