> ## Documentation Index
> Fetch the complete documentation index at: https://developers.mageloyalty.com/llms.txt
> Use this file to discover all available pages before exploring further.

# getCustomerRewards

> List the logged-in customer's redeemed rewards and discount codes.

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

## Usage

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

## Response

<ResponseField name="success" type="boolean">
  Whether the request was successful.
</ResponseField>

<ResponseField name="data.customerRewards" type="array">
  List of redeemed rewards.

  <Expandable title="Customer reward properties">
    <ResponseField name="id" type="string">
      The customer reward ID.
    </ResponseField>

    <ResponseField name="rewardName" type="string">
      Name of the reward that was redeemed.
    </ResponseField>

    <ResponseField name="rewardDescription" type="string">
      Description of the reward.
    </ResponseField>

    <ResponseField name="points" type="number">
      Points spent to redeem this reward.
    </ResponseField>

    <ResponseField name="discountCode" type="string">
      The generated Shopify discount code.
    </ResponseField>

    <ResponseField name="discountType" type="string">
      Type of discount (e.g. `"fixed"`, `"percentage"`).
    </ResponseField>

    <ResponseField name="status" type="string">
      Current status of the reward (`"ACTIVE"`, `"USED"`, `"EXPIRED"`).
    </ResponseField>

    <ResponseField name="createdAt" type="string">
      ISO 8601 timestamp of when the reward was redeemed.
    </ResponseField>

    <ResponseField name="expiresAt" type="string | null">
      ISO 8601 timestamp of when the discount code expires, or `null` if it doesn't expire.
    </ResponseField>
  </Expandable>
</ResponseField>

## Sample response

```json theme={null}
{
  "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"
      }
    ]
  }
}
```
