> For the complete documentation index, see [llms.txt](https://docs.perkville.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.perkville.com/integrations/integrating-perkville/integrating-your-app-with-perkville/point-history-page.md).

# Point history page

To provide customers with a view of their recent transactions and points history, you can create a "Points" page within your mobile app. This page will display the details of each transaction related to the customer's points.

<figure><img src="https://2181708597-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSiE75SeColbiBVbet0NZ%2Fuploads%2FRkMjDkhZa3lFkqRmxJDl%2Fpoint_history_Perkville_page.png?alt=media&amp;token=5955200a-3cdd-45e7-bf39-e8eade699191" alt="" width="371"><figcaption></figcaption></figure>

#### Accessing Points History

The customer's points history can be retrieved using the [**Transaction** endpoint](https://www.perkville.com/developers/docs/v2/#v2_resource_24_anchor). This endpoint provides detailed information on all transactions related to the customer’s points, including earning and redeeming activities.

### How to generate it

**Fetch transactions for the customer**\
Use a business and user filter: `user` URI or `user__emails__email`

**Render each transaction**, see screenshot for details\
Use the following fields:

* `title` as the activity label
* `classification` to label EARN vs REDEEM (show `+` or `-` or `x`)
* `points` and `quantity` to calculate the total (points × quantity)

{% hint style="info" %}
Certain perks will be 0 points. In this case, your application should display just the quantity, like 1x, 3x, etc
{% endhint %}

* `transaction_dt` for the timestamp
* `transaction_status` to handle voids (see below)

**Link to vouchers when present**\
If `voucher` is present on the transaction, link the customer to the specific voucher, if you're rendering voucher views.

### Nuances to handle

#### Instant rewards

Some earning rules can trigger **instant rewards**. In those cases:

* You may see an **additional transaction** created as a result of an earn.
* Treat it as a separate line item in point history.
* If it includes a voucher, link to it.

#### Voided transactions

`transaction_status` can be:

* `ACTIVE`
* `VOID`
* `VOID_REF`

When a transaction is voided, the original is marked `VOID` and a **new reversing transaction** is created with status `VOID_REF`. To avoid double-counting:

* Do not include/display `VOID_REF` transactions
* Display the `VOID` transaction crossed out and label it\
  e.g. ~~`Gym Check-In +1 pt`~~`(VOIDED)`


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.perkville.com/integrations/integrating-perkville/integrating-your-app-with-perkville/point-history-page.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
