# 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 JWT token for the customer. The token identifies which customer's data to retrieve. Customer must be authenticated via Shopify customer login. 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: Total points earned all-time (including spent points) - Relationship: creditedPoints = availablePoints + pendingPoints + spentPoints 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 Endpoint: GET /loyalty/cp/api/customer-loyalty ## Query parameters: - `status` (string) Filter rewards by status (comma-separated values). Allowed values: UNUSED, USED, EXPIRED Example: "UNUSED,USED" ## Response 200 fields (application/json): - `availablePoints` (number) - `pendingPoints` (number) - `creditedPoints` (number) - `spentAmount` (number) - `storeCreditBalance` (number) - `achievableTierId` (integer) - `currentVipTier` (string) - `vipTierExpiredAt` (string) - `createAt` (string) - `rewardedForFacebook` (boolean) - `rewardedForPinterest` (boolean) - `rewardedForTwitter` (boolean) - `rewardedForInstagram` (boolean) - `rewardedForYoutube` (boolean) - `rewardedForTiktok` (boolean) - `rewardedForNewsLetter` (boolean) - `rewardedForSms` (boolean) - `referredCompleted` (integer) - `referralLink` (string) - `customerStatus` (string) Enum: "ACTIVE", "INACTIVE", "EXCLUDED", "EXCLUDED_BY_CUSTOMER" - `dob` (string) - `rewards` (array) - `rewards.id` (integer) - `rewards.shop` (string, required) - `rewards.customerId` (integer, required) - `rewards.description` (string) - `rewards.pointTransactionId` (integer) - `rewards.pointRedeemRuleId` (integer) - `rewards.discountCode` (string, required) - `rewards.usedAt` (string) - `rewards.orderId` (integer) - `rewards.orderName` (string) - `rewards.status` (string, required) Enum: "USED", "UNUSED", "REFUNDED", "EXPIRED", "SUBSCRIPTION_ACTIVE" - `rewards.expireDate` (string) - `rewards.variantId` (integer) - `rewards.discountCodeId` (string) - `rewards.productData` (string) - `rewards.usageCount` (integer) - `rewards.amount` (number) - `rewards.rewardType` (string) Enum: "STORE_CREDIT", "DISCOUNT_CODE", "POINTS" - `rewards.lastExpiryReminderSentDate` (string) - `rewardedForCreatingAccount` (boolean) - `rewardedForSharingOnFacebook` (boolean) - `rewardedForSharingOnX` (boolean) ## Response 400 fields ## Response 401 fields