zapier-user-docs/10-reading-receipts.md

1.1 KiB

10. Reading receipts

Completed JSON (wait, hook, or lookup):

{
  "jobId": "…",
  "status": "completed",
  "sha256": "…",
  "receipts": [
    { "kind": "seal", "timestamp": "…", "certificate": "…", "blockIndex": 42 },
    { "kind": "metadata-attach", "attachedAt": "…", "publicMetadata": {} },
    { "kind": "tree-leaf", "merkleRoot": "…", "proof": [], "itemizedOnMainChain": false }
  ],
  "files": [{ "id": "invoice.pdf", "sha256": "…", "archiveId": "archive-b" }],
  "archivesQueried": true,
  "archiveReplies": 2
}
kind Meaning
seal Chain certificate. If of: merkleRoot, this seal covers a batch, not the leaf itself.
metadata-attach Public or private metadata added later.
file-attach Off-chain file (content hash in the record).
tree-leaf Inclusion proof for a hash that is not itemized on the main chain.

Verify Timestamp takes a certificate string and returns { valid, timestamp, blockIndex }. For a bulk leaf, verify the root certificate, then trust the leaf only if proofOk is true.