> ## 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.

# getCustomerActivity

> Retrieve the logged-in customer's unified activity feed.

Retrieve a paginated, newest-first feed of the customer's loyalty activity: point earnings, redemptions, and cashback rows combined into a single list.

## Usage

```javascript theme={null}
MageSDK.getCustomerActivity({ limit: 20, offset: 0 }).then(function(resp) {
  if (resp.success) {
    resp.data.activity.forEach(function(row) {
      var value = MageSDK.formatSignedLoyaltyValue(
        row.points,
        resp.data.loyaltyMode,
        resp.data.currency
      );
      console.log(row.name, value);
    });
  }
});
```

## Parameters

<ParamField query="limit" type="number" default="10">
  Maximum number of rows to return.
</ParamField>

<ParamField query="offset" type="number" default="0">
  Number of rows to skip, for pagination.
</ParamField>

## Response

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

<ResponseField name="data.points" type="number">
  The customer's current balance, in the shop's loyalty unit.
</ResponseField>

<ResponseField name="data.pointsNextExpiryAt" type="string | null">
  When the next tranche of points expires, or `null`.
</ResponseField>

<ResponseField name="data.hasCashback" type="boolean">
  Whether the shop runs cashback. When `true`, cashback rows may appear in the feed.
</ResponseField>

<ResponseField name="data.activity" type="array">
  The activity rows.

  <Expandable title="Activity entry properties">
    <ResponseField name="id" type="string">
      The row ID.
    </ResponseField>

    <ResponseField name="type" type="string">
      `"earning"`, `"redemption"`, or `"cashback"`.
    </ResponseField>

    <ResponseField name="name" type="string">
      A display name for the row.
    </ResponseField>

    <ResponseField name="points" type="number">
      The point value of the row (0 for cashback rows). Positive for earnings, representing the amount moved.
    </ResponseField>

    <ResponseField name="refundedPoints" type="number">
      Amount later reversed, if any.
    </ResponseField>

    <ResponseField name="status" type="string">
      Row status, e.g. `"APPROVED"`, `"EXPIRED"`, `"PENDING"`, `"REFUNDED"`, `"PARTIALLY_REFUNDED"`.
    </ResponseField>

    <ResponseField name="createdAt" type="string">
      ISO 8601 timestamp of the event.
    </ResponseField>

    <ResponseField name="pointsExpiryAt" type="string | null">
      Expiry timestamp, set only for future-dated points drops.
    </ResponseField>

    <ResponseField name="amount" type="number">
      Cashback rows only. The money amount of the cashback.
    </ResponseField>

    <ResponseField name="refundedAmount" type="number">
      Cashback rows only. Any clawed-back portion.
    </ResponseField>

    <ResponseField name="currencySymbol" type="string">
      Cashback rows only. The currency symbol for `amount`.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="data.pagination" type="object">
  `{ hasMore, totalCount }`. Use with `offset` to page through the feed.
</ResponseField>

<ResponseField name="data.content" type="object">
  Merchant-configured `{ greeting, description }` copy for the activity block.
</ResponseField>

<ResponseField name="data.loyaltyMode" type="string">
  `"points"` or `"store_credit"`. In store-credit mode `points` values are minor currency units. See [Loyalty modes](/js-sdk/loyalty-modes).
</ResponseField>

<ResponseField name="data.currency" type="string">
  The shop's ISO currency code.
</ResponseField>

## Sample response

```json theme={null}
{
  "success": true,
  "data": {
    "points": 450,
    "pointsNextExpiryAt": "2025-01-01T00:00:00.000Z",
    "hasCashback": false,
    "activity": [
      {
        "id": "cer_abc",
        "type": "earning",
        "name": "Points for purchase",
        "points": 150,
        "refundedPoints": 0,
        "status": "APPROVED",
        "createdAt": "2024-06-01T12:00:00.000Z",
        "pointsExpiryAt": null
      },
      {
        "id": "cr_abc",
        "type": "redemption",
        "name": "£5 off your next order",
        "points": 500,
        "refundedPoints": 0,
        "status": "USED",
        "createdAt": "2024-05-20T09:00:00.000Z",
        "pointsExpiryAt": null
      }
    ],
    "pagination": {
      "hasMore": false,
      "totalCount": 2
    },
    "content": {
      "greeting": "Your activity",
      "description": "Everything you've earned and redeemed."
    },
    "loyaltyMode": "points",
    "currency": "GBP"
  }
}
```
