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
Whether the request was successful.
List of redeemed rewards.Show Customer reward properties
Name of the reward that was redeemed.
Description of the reward.
Points spent to redeem this reward.
The generated Shopify discount code.
Type of discount (e.g. "fixed", "percentage").
Current status of the reward ("ACTIVE", "USED", "EXPIRED").
ISO 8601 timestamp of when the reward was redeemed.
ISO 8601 timestamp of when the discount code expires, or null if it doesn’t expire.
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"
}
]
}
}