Skip to main content
Retrieve all rewards that the currently logged-in customer has redeemed, including their discount codes and statuses.

Usage

MageSDK.getCustomerRewards().then(function(resp) {
  if (resp.success) {
    resp.data.customerRewards.forEach(function(reward) {
      console.log(reward.discountCode, reward.status);
    });
  }
});

Response

success
boolean
Whether the request was successful.
data.customerRewards
array
List of redeemed rewards.

Sample response

{
  "success": true,
  "data": {
    "customerRewards": [
      {
        "id": "cr_abc123",
        "rewardName": "\u00a35 off your next order",
        "rewardDescription": "\u00a35 off your order",
        "points": 500,
        "discountCode": "MAGE-XYZ789",
        "discountType": "fixed",
        "status": "ACTIVE",
        "createdAt": "2024-06-01T12:00:00.000Z",
        "expiresAt": "2024-07-01T12:00:00.000Z"
      }
    ]
  }
}