Skip to main content
Retrieve the full profile for the currently logged-in customer. Returns points balance, VIP tier, earning history, and referral earnings.

Usage

MageSDK.getCustomerDetails().then(function(resp) {
  if (resp.success) {
    console.log(resp.data.customer);
  }
});

Response

success
boolean
Whether the request was successful.
data.customer
object
The customer object.

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"
    }
  }
}