# Where should I store the receipt?

> Store the receipt in your own database, next to the record ID in the row where you record the acceptance. What the receipt holds and how to fetch it again.

Source: https://esigncomply.com/docs/kb/where-should-i-store-the-receipt

Last updated November 25, 2026

Store the receipt in your own database, in the row where you record the acceptance, next to the record ID. Esign Comply returns the receipt in the `receipt` field of `GET /v1/records/{id}`, the call your server already makes to confirm a record. Save that copy. The receipt is a compact signed token that names the record hash.

## What does the receipt hold?

A receipt is a JWS signed with ES256. Its payload names the record ID (`rid`), the registered domain (`dom`), the record hash (`hash`), the signing time (`iat`), the assurance level (`asr`), the position in your domain's ledger (`seq` and `prev`) and the environment (`live`). It holds no signer name, no email address and no document text. Store it as text. `POST /v1/verify` accepts a receipt of up to 4,096 characters.

## Why should I keep my own copy of the receipt?

The receipt is the proof you hand to someone else. Anyone who holds it can check the record without your database and without an account: they send it to `POST /v1/verify`, or paste it on the record's verification page. A record ID alone shows them nothing. With the receipt in your acceptances table, every row carries the signed proof for its own record.

## Which copy of the receipt should my server save?

Save the one your server reads from the API. The browser SDK also returns a receipt from `complete()`, and the browser is not a trusted source: that value is `null` when the SDK recovered the record after a lost response. Your server takes only the record ID from the browser, reads the record with its secret key, checks it, and stores `id` and `receipt` from that response.

## How do I get the receipt again?

Call `GET /v1/records/{id}/receipt` with a secret key of any permission. It returns the same token with its decoded payload.

```bash
curl https://esigncomply.com/v1/records/rec_Z4m8/receipt \
  -H "Authorization: Bearer $ESIGNCOMPLY_API_KEY"
```

A record whose `status` is `pending_seal` has no receipt yet. The call then returns `503` [`service_unavailable`](https://esigncomply.com/docs/api/errors.md#service_unavailable) with `Retry-After: 5`, and the receipt is signed within 60 seconds.

## Related

- [Server confirmation](https://esigncomply.com/docs/guides/server-confirmation.md): the checks to run before you store the receipt.
- [Retrieve the receipt](https://esigncomply.com/docs/api/records/retrieve-the-receipt-of-a-record.md)
- [Evidence: receipt](https://esigncomply.com/docs/concepts/evidence.md#receipt): every claim in the payload.
- [How do I verify a record without an account?](https://esigncomply.com/docs/kb/how-do-i-verify-a-record-without-an-account.md)
