> ## 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.

# Get customer loyalty information

> Retrieves comprehensive loyalty information for the currently authenticated customer.

**Primary use case:**
This is the main endpoint for displaying a customer's loyalty dashboard. Call this endpoint
when a customer views their loyalty page to show all their points, rewards, and program status.

**What you'll get:**
- Current point balances (available, pending, total credited)
- Store credit balance (if applicable)
- VIP tier information and expiration
- List of rewards/discount codes
- Social media engagement tracking
- Referral statistics and link
- Account creation date
- Customer status in loyalty program

**Authentication:**
Requires a signed-in customer. Call it through Shopify's App Proxy on the store's domain: the proxy signs the request and attaches the customer, so you send no API key or token.
The signed-in customer's data is returned.

**Filtering rewards by status:**
Use the optional 'status' query parameter to filter rewards:
- UNUSED: Show only unused discount codes
- USED: Show only used/redeemed codes
- EXPIRED: Show only expired codes
- Multiple: "UNUSED,USED" for multiple statuses
- Omit parameter to get all rewards regardless of status

**Point balance fields explained:**
- availablePoints: Points customer can redeem RIGHT NOW
- pendingPoints: Points awaiting approval (e.g., from pending orders)
- creditedPoints: Approved points earned toward VIP tiers, since the VIP program's start date or within its current evaluation period (including points since spent). Points given back for a cancelled, returned or expired reward aren't counted again.

**VIP tier information:**
- currentVipTier: Name of customer's current tier (null if not in a tier)
- vipTierExpiredAt: When tier expires (null if permanent or not in tier)
- achievableTierId: Next tier customer can reach

**Social media tracking (boolean flags):**
- rewardedForFacebook: Claimed Facebook like/follow points
- rewardedForInstagram: Claimed Instagram follow points
- rewardedForTwitter: Claimed Twitter follow points
- rewardedForPinterest: Claimed Pinterest follow points
- rewardedForYoutube: Claimed YouTube subscribe points
- rewardedForTiktok: Claimed TikTok follow points
- rewardedForNewsLetter: Claimed newsletter signup points
- rewardedForSms: Claimed SMS subscription points
- rewardedForCreatingAccount: Claimed account creation points
- rewardedForSharingOnFacebook: Claimed Facebook share points
- rewardedForSharingOnX: Claimed X (Twitter) share points

**Referral information:**
- referredCompleted: Number of successful referrals
- referralLink: Unique URL for customer to share

**Customer status values:**
- ACTIVE: Actively enrolled in loyalty program
- EXCLUDED: Excluded by admin
- EXCLUDED_BY_CUSTOMER: Customer opted out

**Common integration patterns:**
1. Load loyalty dashboard: Call on page load
2. After redemption: Call to get updated points and new reward
3. After earning points: Call to show updated balance
4. Real-time updates: Poll this endpoint or use webhooks

**Performance tips:**
- Cache response for 30-60 seconds on frontend
- Don't call on every page view, only on loyalty pages
- Use status parameter to reduce response size if needed




## OpenAPI

````yaml /loyalty/storefront-api-swagger.json get /loyalty/cp/api/customer-loyalty
openapi: 3.0.1
info:
  description: >
    These endpoints are called **from the shop's storefront, in the shopper's
    browser**, through the Shopify App Proxy:

    `https://{store-domain}/apps/loyalty/cp/api/...`. Shopify signs every
    proxied request and attaches the logged-in

    customer (`logged_in_customer_id`), and that signature is the only
    credential these endpoints accept.


    - **No API key, no Bearer token, no customer ID parameter.** The customer is
    the one logged in to the storefront. Accept referral offer also works for a
    shopper who isn't signed in.

    - Requests sent straight to `loyalty-admin.appstle.com` (including this
    page's "Try it" button, Postman, or a server)
      have no App Proxy signature and are rejected with **401 Unauthorized**.
    - Non-GET requests must also send `X-Requested-With: XMLHttpRequest`.

    - If the merchant changed the proxy path in Advanced Settings, replace
    `/apps/loyalty` with that path.


    **Headless storefronts and server-to-server integrations** can't use the App
    Proxy. Use the Admin APIs instead

    (`/api/external/**` with the `X-API-Key` header, passing `customerId` or
    `customerEmail` explicitly).
  title: Storefront APIs
  version: 0.0.1
servers:
  - description: >-
      Shop's storefront domain (App Proxy). Must be called from the storefront
      by a logged-in customer.
    url: https://{storeDomain}/apps
    variables:
      storeDomain:
        default: your-store.myshopify.com
security: []
tags:
  - description: >-
      Storefront APIs for the signed-in customer to enroll, enable the loyalty
      program, view their loyalty profile, sync metafields, and update profile
      attributes.
    name: Customer Enrollment & Profile
  - description: >-
      Storefront APIs for the signed-in customer to view point transactions,
      claim social-media reward points, and record store visits.
    name: Points & Earn Rules
  - description: >-
      Storefront APIs for the signed-in customer to redeem loyalty points for
      rewards or discount codes.
    name: Redemptions & Discount Codes
  - description: >-
      Storefront APIs for managing the signed-in customer's referral activity:
      generating referral URLs, sending invites, viewing referral history, and
      accepting referral offers.
    name: Referrals
  - description: >-
      Storefront APIs for retrieving product and collection data, proxied
      through the Shopify Storefront API for loyalty widgets.
    name: Product Catalog
paths:
  /loyalty/cp/api/customer-loyalty:
    get:
      tags:
        - Customer Enrollment & Profile
      summary: Get customer loyalty information
      description: >
        Retrieves comprehensive loyalty information for the currently
        authenticated customer.


        **Primary use case:**

        This is the main endpoint for displaying a customer's loyalty dashboard.
        Call this endpoint

        when a customer views their loyalty page to show all their points,
        rewards, and program status.


        **What you'll get:**

        - Current point balances (available, pending, total credited)

        - Store credit balance (if applicable)

        - VIP tier information and expiration

        - List of rewards/discount codes

        - Social media engagement tracking

        - Referral statistics and link

        - Account creation date

        - Customer status in loyalty program


        **Authentication:**

        Requires a signed-in customer. Call it through Shopify's App Proxy on
        the store's domain: the proxy signs the request and attaches the
        customer, so you send no API key or token.

        The signed-in customer's data is returned.


        **Filtering rewards by status:**

        Use the optional 'status' query parameter to filter rewards:

        - UNUSED: Show only unused discount codes

        - USED: Show only used/redeemed codes

        - EXPIRED: Show only expired codes

        - Multiple: "UNUSED,USED" for multiple statuses

        - Omit parameter to get all rewards regardless of status


        **Point balance fields explained:**

        - availablePoints: Points customer can redeem RIGHT NOW

        - pendingPoints: Points awaiting approval (e.g., from pending orders)

        - creditedPoints: Approved points earned toward VIP tiers, since the VIP
        program's start date or within its current evaluation period (including
        points since spent). Points given back for a cancelled, returned or
        expired reward aren't counted again.


        **VIP tier information:**

        - currentVipTier: Name of customer's current tier (null if not in a
        tier)

        - vipTierExpiredAt: When tier expires (null if permanent or not in tier)

        - achievableTierId: Next tier customer can reach


        **Social media tracking (boolean flags):**

        - rewardedForFacebook: Claimed Facebook like/follow points

        - rewardedForInstagram: Claimed Instagram follow points

        - rewardedForTwitter: Claimed Twitter follow points

        - rewardedForPinterest: Claimed Pinterest follow points

        - rewardedForYoutube: Claimed YouTube subscribe points

        - rewardedForTiktok: Claimed TikTok follow points

        - rewardedForNewsLetter: Claimed newsletter signup points

        - rewardedForSms: Claimed SMS subscription points

        - rewardedForCreatingAccount: Claimed account creation points

        - rewardedForSharingOnFacebook: Claimed Facebook share points

        - rewardedForSharingOnX: Claimed X (Twitter) share points


        **Referral information:**

        - referredCompleted: Number of successful referrals

        - referralLink: Unique URL for customer to share


        **Customer status values:**

        - ACTIVE: Actively enrolled in loyalty program

        - EXCLUDED: Excluded by admin

        - EXCLUDED_BY_CUSTOMER: Customer opted out


        **Common integration patterns:**

        1. Load loyalty dashboard: Call on page load

        2. After redemption: Call to get updated points and new reward

        3. After earning points: Call to show updated balance

        4. Real-time updates: Poll this endpoint or use webhooks


        **Performance tips:**

        - Cache response for 30-60 seconds on frontend

        - Don't call on every page view, only on loyalty pages

        - Use status parameter to reduce response size if needed
      operationId: getCustomerLoyalty
      parameters:
        - description: >-
            Filter rewards by status (comma-separated values). Allowed values:
            UNUSED, USED, EXPIRED
          example: UNUSED,USED
          in: query
          name: status
          required: false
          schema:
            type: string
      responses:
        '200':
          content:
            application/json:
              example:
                availablePoints: 150.5
                creditedPoints: 175.5
                currentVipTier: Gold
                customerStatus: ACTIVE
                dob: '1990-05-15'
                pendingPoints: 25
                referralLink: https://store.com/referral/abc123
                referredCompleted: 3
                rewardedForFacebook: true
                rewardedForInstagram: false
                rewards: []
                spentAmount: 299.99
                storeCreditBalance: 15
                vipTierExpiredAt: '2025-12-31T23:59:59Z'
              schema:
                $ref: '#/components/schemas/CustomerLoyaltyResponseVM'
          description: Customer loyalty information retrieved successfully
        '400':
          description: Invalid status parameter
        '401':
          description: Customer not authenticated
components:
  schemas:
    CustomerLoyaltyResponseVM:
      properties:
        achievableTierId:
          format: int64
          type: integer
        availablePoints:
          format: double
          type: number
        createAt:
          format: date-time
          type: string
        creditedPoints:
          format: double
          type: number
        currentVipTier:
          type: string
        customerStatus:
          enum:
            - ACTIVE
            - INACTIVE
            - EXCLUDED
            - EXCLUDED_BY_CUSTOMER
          type: string
        dob:
          format: date
          type: string
        dobYearProvided:
          type: boolean
        expiringPointsAmount:
          format: double
          type: number
        pendingPoints:
          format: double
          type: number
        pointsExpireAt:
          format: date-time
          type: string
        referralLink:
          description: >-
            The customer's short referral link, on
            `https://referral.appstle.com/` or the merchant's custom referral
            domain. Its last part is the customer's referral token, which Accept
            referral offer takes as `token`. The link redirects to the store's
            primary domain with `appstle_referral=true` and
            `appstle_referral_code={token}` in the query string.
          example: https://referral.appstle.com/abc123def456ghij
          type: string
        referredCompleted:
          format: int64
          type: integer
        rewardedForCreatingAccount:
          type: boolean
        rewardedForFacebook:
          type: boolean
        rewardedForInstagram:
          type: boolean
        rewardedForNewsLetter:
          type: boolean
        rewardedForPinterest:
          type: boolean
        rewardedForSharingOnFacebook:
          type: boolean
        rewardedForSharingOnX:
          type: boolean
        rewardedForSms:
          type: boolean
        rewardedForTiktok:
          type: boolean
        rewardedForTwitter:
          type: boolean
        rewardedForYoutube:
          type: boolean
        rewards:
          items:
            $ref: '#/components/schemas/CustomerReward'
          type: array
        spentAmount:
          format: double
          type: number
        storeCreditBalance:
          format: double
          type: number
        storeCreditCurrency:
          type: string
        vipTierExpiredAt:
          format: date-time
          type: string
        vipTierSpentAmount:
          format: double
          type: number
      type: object
    CustomerReward:
      properties:
        activeFrom:
          format: date-time
          type: string
        amount:
          format: double
          type: number
        createAt:
          format: date-time
          type: string
        customerId:
          format: int64
          type: integer
        description:
          type: string
        discountCode:
          type: string
        discountCodeId:
          type: string
        expireDate:
          format: date-time
          type: string
        id:
          format: int64
          type: integer
        lastExpiryReminderSentDate:
          format: date-time
          type: string
        orderId:
          format: int64
          type: integer
        orderName:
          type: string
        pointRedeemRuleId:
          format: int64
          type: integer
        pointTransactionId:
          format: int64
          type: integer
        productData:
          type: string
        rewardType:
          enum:
            - STORE_CREDIT
            - DISCOUNT_CODE
            - POINTS
          type: string
        shop:
          type: string
        status:
          enum:
            - USED
            - UNUSED
            - REFUNDED
            - EXPIRED
            - SUBSCRIPTION_ACTIVE
            - CANCELED
          type: string
        usageCount:
          format: int64
          type: integer
        usedAt:
          format: date-time
          type: string
        variantId:
          format: int64
          type: integer
      required:
        - createAt
        - customerId
        - discountCode
        - shop
        - status
      type: object

````

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