Skip to content

Receipts

One committed entry's receipt: the sealed record as it was committed, its seal, and what the check needs. records.receipt in the SDKs, GET .../receipts/{seq} on the wire, fetched with the number the record.committed webhook gives.

HTTP
GET /api/v1/records/{recordType}/{record}/receipts/{seq}

A receipt is one committed entry, on its own. It carries the sealed record exactly as it was committed, the seal, and what a check needs to compare the two. The history carries every receipt at once; fetch a single receipt when you hold an entry number from the record.committed webhook and want just that entry. An attempt and a failure record are committed entries, and each has a receipt.

Call

The record.committed webhook for evaluation run 4417 names the entry that just committed as records[].seq, the wire's count from 0. Add 1 and fetch its receipt.

TypeScript
// seq from the record.committed webhook; entries count from 1, so seq 2 is entry 3.
const { receipt } = await pac.records.receipt({ record: 'eval-run-4417', entry: seq + 1 });

What comes back

JSON
{
  "success": true,
  "data": {
    "recordType": "machine-action-record",
    "entityId": "eval-run-4417",
    "receipt": { "...": "the committed entry, its seal, and what the check needs" },
    "verify": { "...": "where the record was committed, for a check that reads the proof layer" }
  }
}

Inside receipt, the part you read is the sealed record: the title, occurredAt, actorId, payloads, and whatever else you sent, exactly as committed. For a record whose fields are sealed one by one (its history says record-history-bundle/v2), each field is an item of receipt.revealed, written { pointer, value, salt }, where pointer names the field, such as /title or /payloads/0. For an older record the sealed record is receipt.recordContent. The rest of the receipt is what a check consumes, and its shape belongs to the checker. Read it with records.check or the standalone checker rather than by hand.

Entries count from 1 in the SDKs and on every page: entry: 1 is the first entry, the one the record page calls Entry 1. On the wire the same position is seq, counted from 0, so the path for the first entry ends in /receipts/0 and seq is entry - 1; the SDKs convert for you and refuse an entry below 1 before anything is sent. The number comes from the record.committed webhook (records[].seq) or from the history; the write's own answer does not carry it, because the number is assigned when the entry commits.

Who can read it

Your workspace's key, or a grant token for this record sent as ?grant=. A person on the other side does not need either; the Shared Record shows them each entry.

When the call is refused

On the wire each code is at error.code in the answer's body. In the SDKs a 404 arrives as NotFoundError, carrying the API's message; the other codes arrive as a PacSpaceError with the code below.

CodeThe rule
RECORD_NOT_FOUND (404)No record exists for this id in your workspace.
RECORD_ENTRY_NOT_FOUND (404)No committed entry exists at this position for this record.
RECORD_RECEIPT_NOT_READY (409)No committed entry exists at this position yet; the record has entries still being written. Read the history, or wait for record.committed.
RECORD_RECEIPT_GRANT_REQUIRED (403)Reading a receipt takes your workspace's key or a grant for this record.
RECORD_BUNDLE_RANGE_INVALID (400)The entry number in the path is a whole number, 0 or more on the wire.