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 .
How to get the customer id if user is logged in , in volusion platform
236 Views Asked by Shubhanshu Jaiswal At
2
There are 2 best solutions below
0
On
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);
}
});
You can use the Volusion frontend API:
www.yoursite.com /api/v1/users
This endpoint will return the logged in user as a JSON.