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

# Stored calculations

> What the API records, what it does not, and why reading never recalculates

Every `/v1/payroll/calculate` call and every successful row of `/v1/payroll/batch` is
**recorded before the response is sent**, and can be fetched later exactly as it was
answered.

## What is stored

| Surface                      | Stored?                                    |
| ---------------------------- | ------------------------------------------ |
| `POST /v1/payroll/calculate` | Yes                                        |
| `POST /v1/payroll/batch`     | Yes — the batch, plus every successful row |
| `POST /v1/payroll/simulate`  | **No**                                     |

`/simulate` is the explicit ephemeral path: use it for quote and preview UIs, scenario
comparison, and anything that must not leave a record.

The **audit trail is always stored**, even when you asked not to receive it
(`options.include_audit_trail: false`). Showing a number and being able to defend it are
different things, and the second is what you need eight months later.

## Isolation and immutability

* Everything is keyed to your `client_id`, not to the API key you presented. Rotating a
  key does not cost you your history. See [Authentication](/authentication).

## Employers and employees id

In every calculation you have to send your `employer.id` and `employee.id`.

Both ids accept any string up to **128 characters**. Longer returns `422`.

An `employee.id` is unique **within its employer**. `emp_001` at company A (`corp_a`) and `emp_001` at
company B (`corp_b`) are two different people. An integrator serving many client companies cannot
guarantee IDs unique across them, and merging them would mix two workers' histories.

<CardGroup cols={2}>
  <Card title="Retrieve" icon="magnifying-glass" href="/calculations/retrieve">
    The four GET endpoints, filters and cursor pagination.
  </Card>

  <Card title="Provenance" icon="fingerprint" href="/calculations/provenance">
    `record`, `rule_fingerprint` and `content_digest`.
  </Card>

  <Card title="Idempotency" icon="arrows-rotate" href="/calculations/idempotency">
    Retry a calculation without duplicating your history.
  </Card>

  <Card title="Corrections" icon="pen-to-square" href="/calculations/corrections">
    Recalculate without destroying what you already answered.
  </Card>
</CardGroup>
