Quickstart
Inspect a receipt
You can read a receipt's result, authorizing decision, and idempotency key, and confirm a retry does not double-apply.
preview10 minbeginnerEnvironment: testContract >=0.8 <1.0
What you will build
An understanding of the receipt: the durable record of an effect. Receipts make execution auditable and idempotent, so the same command retried returns the original result rather than double-running.
Architecture preview
A receipt records the command, the result, the authorizing decision, and an idempotency key. It is the end of the evidence-gated execution flow.
Prerequisites
- A completed effect (see the previous quickstart)
Steps
Fetch the receipt
Read the receipt produced by the effect.
bash curl --url "$CRESCEVO_BASE_URL/v1/receipts/rcpt_1" \ --header "Authorization: Bearer $CRESCEVO_API_KEY"Expected response { "receipt_id": "rcpt_1", "command": "artifact.deliver", "result": "succeeded", "authorized_by": "d_1", "idempotency_key": "quickstart-deliver-001" }Confirm idempotency
Re-issue the original command with the same idempotency key. You get the original receipt back, not a second effect.
bash curl --request POST \ --url "$CRESCEVO_BASE_URL/v1/commands" \ --header "Authorization: Bearer $CRESCEVO_API_KEY" \ --header "Content-Type: application/json" \ --header "Idempotency-Key: quickstart-deliver-001" \ --data '{ "command": "artifact.deliver", "target": { "type": "artifact", "id": "a_123" }, "arguments": { "destination": "mock://inbox" } }'Expected response { "command_id": "cmd_1", "effect_id": "eff_1", "receipt_id": "rcpt_1", "idempotent_replay": true }
Verify success
- The receipt links to the authorizing decision and carries the idempotency key.
- Re-issuing with the same key returns the original receipt.
- No second effect ran.
Clean up
Test-tenant resources expire automatically; reset the fixture to start over.