# Get customer loyalty details Retrieves comprehensive loyalty program details for a customer. What you'll get: - Current point balance (available, pending, credited) - Store credit balance - VIP tier information and expiration date - List of rewards/discount codes with their status - Social media engagement status - Referral statistics - Customer enrollment date Query options: - By customer ID: Use customerId parameter with Shopify customer ID - By email: Use customerEmail parameter with customer's email address - You must provide either customerId OR customerEmail (not both) Filtering rewards: - Use status parameter to filter rewards: "ACTIVE", "USED", "UNUSED", "EXPIRED" - Comma-separated for multiple statuses: "UNUSED,ACTIVE" - Omit status parameter to get all rewards Common use cases: - Display customer's loyalty dashboard - Check point balance before redemption - Verify discount code availability - Show VIP tier progress - Display referral achievements Response field explanations: - availablePoints: Points customer can redeem right now - pendingPoints: Points awaiting approval (e.g., from pending orders) - creditedPoints: Total points earned all-time - spentAmount: Total monetary value of purchases - storeCreditBalance: Store credit in shop currency - currentVipTier: Name of customer's current VIP tier (null if not in a tier) - vipTierExpiredAt: When the VIP tier expires (null if permanent or not in tier) - rewardedForFacebook/Instagram/etc: Whether customer claimed social media points - referredCompleted: Count of successful referrals - referralLink: Unique referral URL for this customer - rewards: Array of discount codes/rewards with status, expiry, and value Endpoint: GET /api/external/customer-loyalty ## Header parameters: - `X-API-Key` (string, required) API key for authentication ## Query parameters: - `customerId` (integer) Shopify customer ID (optional if customerEmail provided) - `customerEmail` (string) Customer email address (optional if customerId provided) - `status` (string) Filter rewards by status (comma-separated: ACTIVE, USED, UNUSED) ## 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)