getCustomerDetails

Retrieve loyalty data for the logged-in customer

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

Optional Parameters

ParameterTypeDefaultDescription
optsObject{ fields: "lifetime_earnings_tally" }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.

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": 63325896925,
        "remote_id": 6089389113565,
        "points_tally": 2167568,
        "credits_tally": 6,
        "dob": "02-02",
        "points_expiry": null,
        "social_actions": [
            "instagram_follow",
            "tiktok_follow",
            "twitter_follow",
            "facebook_like"
        ],
        "loyalty_status": "member",
        "loyalty_status_last_changed_at": "2022-03-04T21:48:21.000Z"
    }
}