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

# Get a Test User's Points Ledger

> Returns a test user's points balance and points ledger, newest first. Use it to confirm a purchase accrued points.

> [!NOTE]
>
> Please review proper request headers [here](https://docs.thanx.com/consumer/usage/headers.md).

<Snippet file="sandbox/auth.mdx" />

Each ledger entry shows how many points it moved and, when it came from a purchase, which purchase. Filter by `purchase_id` to answer "did this purchase accrue points, and how many?".

### Parameters

**user\_id** `string` *required*

The user's `id`. The user must be a member of your merchant.

**purchase\_id** `string`

Only return the entries linked to this purchase. The purchase must belong to this user at your merchant.

**per\_page** `integer`

Number of entries per page.

* Default: `10`
* Minimum: `1`
* Maximum: `100`

**cursor** `string`

The `next_cursor` from the previous page. Omit it to read the first page.

### Response

**points\_balance** `decimal`

The user's current points balance at your merchant. `0` if the user has no points account.

**points\_transactions** `array`

The ledger entries, newest first

**points\_transaction**

**id** `string`

The ledger entry ID

**type** `string`

The kind of entry, for example `Issue` (points earned, from a purchase or a purchase-triggered bonus), `Reverse`, `Clawback`, `Exchange` or `Grant`

**amount** `decimal`

Points the entry moved: positive when the user gained them, negative when they lost them

**purchase\_id** `string`

The purchase the entry is linked to, if any

**active** `boolean`

`false` when the entry was recorded as inactive, for example while the points experience wasn't live

**created\_at** `string`

When the entry was recorded, in ISO8601 format

**pagination** `hash`

**pagination**

**per\_page** `integer`

Number of entries per page

**next\_cursor** `string`

Pass it as `cursor` to read the next page. `null` on the last page.

> [!NOTE]
>
> [`POST /purchases`](https://docs.thanx.com/consumer/purchases/create-purchase) doesn't return the purchase's ID, and a sandbox purchase can take 15 to 30+ minutes to be processed (see the [Sandbox FAQ](https://docs.thanx.com/overview/sandbox-faq.md)). To confirm a synthetic purchase accrued points, read the ledger without `purchase_id` and look for a new `Issue` entry: its `purchase_id` identifies the purchase. Filtering by a `purchase_id` that doesn't exist yet returns `404 Purchase not found`.

### Errors

| Status | Code | Message | When |
| - | - | - | - |
| `400` | `BAD_REQUEST` | `cursor is invalid` | The `cursor` isn't one this endpoint returned |
| `400` | `BAD_REQUEST` | `per_page must be within 1 and 100` | `per_page` is out of range |
| `400` | `CLIENT_ID_HEADER_INVALID` | `X-ClientId header is invalid` | The `X-ClientId` header is missing or doesn't match an app |
| `403` | `FORBIDDEN` | `You do not have access to this resource.` | Called in production, or your `X-ClientId` isn't tied to exactly one merchant |
| `404` | `RESOURCE_NOT_FOUND` | `User not found` | No active user with this `user_id` is a member of your merchant |
| `404` | `RESOURCE_NOT_FOUND` | `Purchase not found` | The `purchase_id` isn't a purchase of this user at your merchant |

```bash Get Points Ledger theme={null}
curl "https://api.thanxsandbox.com/users/${user_id}/points_transactions?purchase_id=${purchase_id}" \
  -X GET \
  -H "Accept-Version: v4.0" \
  -H "Accept: application/json" \
  -H "X-ClientId: ${client_id}"
```

```json theme={null}
{
  "points_balance": 120.0,
  "points_transactions": [
    {
      "id": "8f3k2j9d0s1a",
      "type": "Issue",
      "amount": 13.0,
      "purchase_id": "p2k4j6h8g0f1",
      "active": true,
      "created_at": "2026-11-17T15:32:10Z"
    }
  ],
  "pagination": {
    "per_page": 10,
    "next_cursor": null
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.