Generate a Receipt
packages/api/src/routes/receipt.ts. Validates businessTransactionId (required, UUID format), then calls application.generateReceipt(businessTransactionId) — ReceiptService.generate in packages/runtime/src/services/receipt-service.ts.
ReceiptService.generate requires the trust record’s latest Verification to have status: VERIFIED — if it hasn’t been verified yet, or the last verification failed, it throws ReceiptGenerationError rather than generating a Receipt. See Error Model for how that surfaces over HTTP.200 — the newly created Receipt, signed via ReceiptCrypto (packages/crypto).
Response 400
Get the latest Receipt
receipt-get.ts loads the trust record via application.getTrustRecord(id) and returns record.receipts.at(-1) — the most recently appended Receipt.
Response 200 — the latest Receipt.
Response 404
SDK equivalents
Related
Receipt
The concept this endpoint produces.
Verification
The precondition Receipt generation enforces.
Trust Records
The fallback way to read a previously generated Receipt.
Receipt Verification Guide
A full verify → receipt walkthrough.