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

# Activity Log

> The Activity Log is an append-only audit trail of business-significant subscription events across renewals, dunning, cancellations, and subscription lifecycle changes.

The Activity Log is a cross-domain audit trail that records business-significant events for each subscription. It aggregates events from Subscriptions, Renewals, Dunning, and Cancellation & Retention into a single operator-facing view. The log is append-only — existing records are never modified. State evolution is represented by new entries, not by mutating older ones.

## What gets logged

The Activity Log records operator-facing outcomes, not internal diagnostics. Logged events include:

**Subscription events**

* Subscription created during storefront checkout
* Subscription paused, resumed, or canceled
* Plan change scheduled
* Shipping address updated
* Next delivery skipped

**Renewal events**

* Renewal approval approved or rejected
* Force renewal requested
* Renewal succeeded or failed

**Dunning events**

* Dunning started
* Retry executed
* Case recovered or unrecovered
* Retry schedule updated manually

**Cancellation & Retention events**

* Cancellation case started
* Retention offer applied
* Cancellation reason updated
* Cancellation finalized

Low-level operational details — such as scheduler internals, lock diagnostics, payment provider payloads, and batch summaries — are not logged here. Those stay in structured operational logs.

## Event record

Each log entry captures:

| Field                    | Purpose                                                                           |
| ------------------------ | --------------------------------------------------------------------------------- |
| **Event type**           | The specific event from the taxonomy above                                        |
| **Actor**                | Who or what triggered the event: `user`, `customer`, `system`, or `scheduler`     |
| **Previous / new state** | A compact before/after summary of the relevant fields that changed                |
| **Changed fields**       | A structured diff showing field-level before and after values                     |
| **Reason**               | An optional operator-facing explanation (e.g. cancellation reason, approval note) |

Display labels such as subscription reference, customer name, product title, and variant title are stored as snapshots on the record. This keeps the audit trail readable even if the underlying entities change later.

## Admin surfaces

The Activity Log is accessible in two places:

**Global Activity Log page** (`/subscriptions/activity-log`) — a cross-subscription audit view with filtering by event type, actor, and date range. Quick presets let you filter to a specific domain (Subscriptions, Renewals, Dunning, Cancellations) in one click. Clicking any row opens a detail drawer with the full event payload.

**Subscription detail timeline** — an embedded Activity Log section on each subscription detail page, scoped to that subscription's history. Useful for reviewing the full lifecycle of one subscription without leaving its detail view.

One common first event in that timeline is `subscription.created`, recorded when a customer completes subscription checkout through the storefront.

## Retention

The Activity Log has no automatic purge or archival policy. Log records are treated as a business audit trail and are retained indefinitely. If a cleanup requirement arises in the future, it will be implemented as an explicit maintenance operation with clearly documented semantics.
