Usage
MageSDK.getCustomerDetails().then(function(resp) {
if (resp.success) {
console.log(resp.data.customer);
}
});
Response
Whether the request was successful.
The customer object.
Show Customer properties
Show Customer properties
Internal Mage customer ID.
The Shopify customer ID.
Customer email address.
Customer first name.
Customer last name.
Current available points balance.
Total points earned over the customer’s lifetime.
Total points redeemed.
Whether the customer is excluded from the loyalty program.
Customer date of birth in ISO 8601 format.
The customer’s unique referral code.
The customer’s full referral URL that can be shared.
The customer’s current VIP tier, or
null if no tier is assigned.The customer’s progress value toward the next tier.
List of point earning events.
List of earnings from referrals.
ISO 8601 timestamp of when the customer was enrolled.
ISO 8601 timestamp of the last update.
Sample response
{
"success": true,
"data": {
"customer": {
"id": "abc123",
"shopifyCustomerId": "6789012345",
"email": "jane@example.com",
"firstName": "Jane",
"lastName": "Doe",
"points": 450,
"lifetimePoints": 1200,
"redeemedPoints": 750,
"isExcluded": false,
"dateOfBirth": "1990-05-15T00:00:00.000Z",
"referralCode": "ABC123",
"referralUrl": "https://mystore.com?referral_code=ABC123",
"tier": {
"id": "tier_abc",
"name": "Gold",
"description": "Our most valued customers",
"pointsRequired": 500,
"pointsMultiplier": 1.5,
"badgeImageUrl": null,
"badgeColor": "#FFD700"
},
"tierProgressValue": 1200,
"earningHistory": [
{
"id": "cer_abc",
"earningRuleId": "rule_abc",
"status": "approved",
"points": 150,
"createdAt": "2024-06-01T12:00:00.000Z",
"earningRule": {
"id": "rule_abc",
"name": "Points for purchase"
}
}
],
"referralEarnings": [],
"createdAt": "2024-01-15T10:00:00.000Z",
"updatedAt": "2024-06-20T14:30:00.000Z"
}
}
}