getCustomerDetails
Retrieve loyalty data for the logged-in customer
RivoJS.getCustomerDetails().then(function(resp){
console.log(resp)
});Optional Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
opts | Object | {} | 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_followtiktok_followfacebook_likefacebook_sharetwitter_followtwitter_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.
| Action | Description |
|---|---|
| manual | Manual points adjustment by admin |
| customer_member_enabled | Customer account signup/activation |
| order_placed | Customer placed an order |
| customer_birthday | Customer birthday bonus |
| points_purchase | Customer purchased points with money |
| instagram_follow | Followed on Instagram |
| facebook_like | Liked Facebook page |
| facebook_share | Shared on Facebook |
| twitter_follow | Followed on Twitter |
| twitter_share | Shared on Twitter |
| referral_complete | Successful referral |
| csv_import | Bulk import via CSV |
| csv_adjust | CSV adjustment |
| csv_reset | CSV reset |
| review_complete | Left a product review |
| custom_action | Custom action defined by merchant |
| shopify_flow | Shopify Flow automation |
| api | API-triggered action |
| tiktok_follow | Followed on TikTok |
| pos | Point of sale transaction |
| revoked | Points revoked |
| expiry | Points expired |
| visit_url | Visited a specific URL |
| credits_migration | Credits migration |
| points_migration | Points migration |
| membership_tier_unlocked | VIP tier unlocked |
| membership_recurring_signup | Recurring membership signup |
| recurring_anniversary_credits | Anniversary credits |
| consolidation | Account consolidation |
| upload_receipt | Uploaded purchase receipt |
| email_subscribe | Subscribed to email list |
| sms_subscribe | Subscribed to SMS |
| customer_anniversary | Customer anniversary bonus |
| contest_entry | Entered a contest |
| product_purchased | Purchased specific product |
| punch_card_checkpoint | Punch card milestone |
| vip_tier_upgrade | VIP tier upgrade |
| wallet_pass_subscribe | Added wallet pass |
| gift_card_usage | Gift card redemption |
| shopify_store_credit_usage | Store credit usage |
Updated 2 months ago