{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://travel.agenthaven.dev/contracts/schemas/receipt.schema.json",
  "title": "Receipt (payload of a receipt+jwt)",
  "description": "What the seller returns from create_checkout, as the payload of a compact JWS with header {alg: ES256, typ: receipt+jwt, kid: <thumbprint of the seller instance key>}. It cites the quote hash, the payment intent and the ledger entry that recorded it, so a buyer can seal it into its own chain (receipt.sealed) and a verifier can join the two chains on quote_hash and payment_intent_id. Status: IMPLEMENTED by the seller (agent-bench 76baafc).",
  "type": "object",
  "required": ["iss", "jti", "iat", "quote_id", "quote_hash", "payment_intent_id", "payment_status", "amount", "currency", "merchant_id", "correlation_id", "ledger_hash"],
  "properties": {
    "iss": { "type": "string", "format": "uri" },
    "jti": { "type": "string", "pattern": "^r_[0-9a-f-]{36}$" },
    "iat": { "type": "integer" },
    "quote_id": { "type": "string" },
    "quote_hash": { "type": "string", "pattern": "^[0-9a-f]{64}$" },
    "payment_intent_id": { "type": "string", "description": "pi_sim_… in simulation; a real pi_… in Stripe test mode, in state requires_payment_method. Created, never confirmed." },
    "payment_status": { "type": "string" },
    "amount": { "type": "integer", "minimum": 1 },
    "currency": { "type": "string", "pattern": "^[A-Z]{3}$" },
    "merchant_id": { "type": "string" },
    "correlation_id": { "type": "string", "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$" },
    "ledger_hash": { "type": "string", "pattern": "^[0-9a-f]{64}$", "description": "The hash of the seller's payment_intent.created entry." }
  }
}
