0

I want to get the customerid to do some custom code in volusion. Please help me if there is any way so that I can fetch the customerid. I can see in cookie there is a cookie named "CustomerID" but I am unable to decrypt it .

2 Answers2

0

I put this in the jquery .ready() function...

  $.ajax({
    url: "/api/v1/users/current",
    dataType: "json",
    success: function (json) {
   
    firstName = json.data.firstName;
    lastName = json.data.lastName;
    email = json.data.email;
    id = json.data.id;
 
      alert (firstName +  " " + lastName +  " " + email + " " + id + " ") ;
      //return true;
    },
            error: function(e){
            //alert('error '+e.responseText);
         }
});
-1

You can use the Volusion frontend API:

www.yoursite.com /api/v1/users

This endpoint will return the logged in user as a JSON.