getCustomerDetails

Retrieve loyalty data for the logged-in customer

RivoJS.getCustomerDetails().then(function(resp){
  console.log(resp)
});

Optional Parameters

ParameterTypeDefaultDescription
optsObject{}An object with additional options for the request. This object can have a fields property to specify extra attributes to include in the results. For example, setting fields: "lifetime_earnings_tally" will return the total lifetime points or credits earned by the customer, separated by commas.

Available fields values:

lifetime_earnings_tally – Total lifetime points or credits earned by the customer

Example:

var opts = { fields: "lifetime_earnings_tally" }; // Show extra fields lifetime_earnings_tally

RivoJS.getCustomerDetails(opts).then(function(resp){
  console.log(resp)
});

Sample response

{  
  "success": true,  
  "customer": {  
    "shop_id": 59174944839,  
    "remote_id": 7817134145607,  
    "id": 7817134145607,  
    "points_tally": 2114,  
    "credits_tally": 0,  
    "dob": null,  
    "points_expiry": "25th Sep 2025",  
    "social_actions": ["instagram_follow", "facebook_like"],  
    "completed_custom_action_names": ["Daily Check In", "Newsletter Signup"],  
    "loyalty_status": "member",  
    "loyalty_status_last_changed_at": "2025-08-22T12:29:03.000Z",  
    "referral_url": "https://yourstore.myshopify.com?referral_code=Zz6AaRYBud1aZbJZm",  
    "pretty_points_tally": "2,114",  
    "pretty_credits_tally": "0€",  
    "account_activated_at": "2024-01-15T09:30:00.000Z",  
    "completed_actions": [  
      "order_placed",  
      "custom_action",  
      "vip_tier_upgrade",  
      "instagram_follow",  
      "facebook_like" 
    ],  
    "expected_points_tally": null,  
    "expected_completed_actions": null,  
    "lifetime_earnings_tally": 5250,  
    "first_name": "John",  
    "last_name": "Doe",   
    "full_name": "John Doe",  
    "email": "[email protected]",  
    "orders_count": 3,  
    "phone_number": "+1234567890",  
    "accepts_marketing": true,  
    "buyer_accepts_sms_marketing": false,  
    "tags": ["VIP", "repeat_customer"]  
  }  
}

Possible Actions in social_actions Array

  • instagram_follow
  • tiktok_follow
  • facebook_like
  • facebook_share
  • twitter_follow
  • twitter_share

completed_custom_action_names Array

The completed_custom_action_names array can contain any merchant-defined custom action names (e.g. Daily Check In) and is not limited to a predefined set of values


Possible Actions in completed_actions Array

Completed Social Actions will also be contained in this array. Individual custom action names will not show here, for that data, check the completed_custom_action_names array instead.

ActionDescription
manualManual points adjustment by admin
customer_member_enabledCustomer account signup/activation
order_placedCustomer placed an order
customer_birthdayCustomer birthday bonus
points_purchaseCustomer purchased points with money
instagram_followFollowed on Instagram
facebook_likeLiked Facebook page
facebook_shareShared on Facebook
twitter_followFollowed on Twitter
twitter_shareShared on Twitter
referral_completeSuccessful referral
csv_importBulk import via CSV
csv_adjustCSV adjustment
csv_resetCSV reset
review_completeLeft a product review
custom_actionCustom action defined by merchant
shopify_flowShopify Flow automation
apiAPI-triggered action
tiktok_followFollowed on TikTok
posPoint of sale transaction
revokedPoints revoked
expiryPoints expired
visit_urlVisited a specific URL
credits_migrationCredits migration
points_migrationPoints migration
membership_tier_unlockedVIP tier unlocked
membership_recurring_signupRecurring membership signup
recurring_anniversary_creditsAnniversary credits
consolidationAccount consolidation
upload_receiptUploaded purchase receipt
email_subscribeSubscribed to email list
sms_subscribeSubscribed to SMS
customer_anniversaryCustomer anniversary bonus
contest_entryEntered a contest
product_purchasedPurchased specific product
punch_card_checkpointPunch card milestone
vip_tier_upgradeVIP tier upgrade
wallet_pass_subscribeAdded wallet pass
gift_card_usageGift card redemption
shopify_store_credit_usageStore credit usage