# Audit Trail

Percents exposes enough identifiers and summaries to reconcile issuer state with Percents processing.

## Audit Chain

```mermaid
flowchart LR
  A[auth_ or txn_ id] --> B[brevt_ reward event]
  B --> C[rg_ RewardGrant bucket]
  B --> E[evt_ webhook]
```

Start from the Percents `auth_` or `txn_` id, then use the audit chain to answer three questions:

1. Did Percents receive and process the transaction?
2. Which branded balance or cashback effects were created, posted, reversed, expired, or spent?
3. Which webhook deliveries correspond to the effect?


## Reconciliation Endpoints

| Endpoint | Use |
|  --- | --- |
| [`GET /api/v2/chg/{chgId}/rewards/summary`](/percents-api/openapi/percents-api/rewards/getrewardsummary) | Compare aggregate branded balance and cashback totals. |
| [`GET /api/v2/chg/{chgId}/rewards/activity`](/percents-api/openapi/percents-api/rewards/getrewardactivityfeed) | Review cardholder-visible activity rows. |
| [`GET /api/v2/chg/{chgId}/rewards/expiring`](/percents-api/openapi/percents-api/rewards/getexpiringbalances) | Identify branded balance that is nearing expiry. |
| [`GET /api/v2/chg/{chgId}/merchant/{merchantId}/balance`](/percents-api/openapi/percents-api/rewards/getbalancedetails) | Reconcile a merchant-scoped branded balance. |
| [`GET /api/v2/chg/{chgId}/transaction/{txnId}/reward-detail`](/percents-api/openapi/percents-api/rewards/gettransactionrewarddetails) | Reconcile one transaction and its reward events. |
| [`POST /api/v2/chg/{chgId}/transactions/reward-overviews`](/percents-api/openapi/percents-api/rewards/getrewardoverviewfortransactions) | Reconcile many transactions by id. |


## Webhook Attempts

Webhook records have a stable `webhookId` and attempts are retried on the configured schedule. Issuers should store:

- `webhookId`
- `type`
- receive timestamp
- signature verification result
- processing status
- source ids from `data`


When a webhook is replayed, the issuer should return success if the event was already processed successfully.

## Accounting Backing

Percents uses a double-entry ledger to back all debt and liability changes resulting from cardholder activity, transfers, and expiration. The public API exposes the balances, reward events, and webhooks needed for issuer reconciliation.