{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://composium.app/machine/contracts/purchase.v1.schema.json","title":"Composium.app Purchase v1","description":"The server-created C. authorization passed to Carmelita only after Stripe verifies the bound €4 test-mode Checkout Session.","x-composium":{"document":"machine-readable application contract","status":"CURRENT — runtime-aligned","date":"2026-10-23","scope":"Verified purchase entitlement and the linked purchases ledger row","placement":"4-D CONDUCT-A-COMPOSITION / composium.app / domain/contracts","authority":"server/child/composiumService.js, server/child/purchaseRepository.js, and their tests","source":"Standalone CHILD runtime and approved three-table ledger","confidentiality":"Schema is public; purchase identifiers and records are not public","permissions":"Describes verified server state; does not create checkout or authorize external machine invocation","contractVersion":"1"},"type":"object","properties":{"type":{"type":"string","const":"verified_child_payment"},"purchase_id":{"type":"string","format":"uuid"},"composition_id":{"type":"string","format":"uuid"},"amount_cents":{"type":"integer","const":400},"currency":{"type":"string","const":"eur"},"verified_at":{"type":"string","format":"date-time"}},"required":["type","purchase_id","composition_id","amount_cents","currency","verified_at"],"additionalProperties":false,"$defs":{"ledgerRecord":{"type":"object","description":"Column-level shape of public.purchases; transaction identifiers are private operational records.","properties":{"id":{"type":"string","format":"uuid"},"composition_id":{"type":"string","format":"uuid"},"stripe_checkout_session_id":{"type":["string","null"]},"stripe_payment_intent_id":{"type":["string","null"]},"idempotency_key":{"type":"string"},"amount_cents":{"type":"integer","const":400},"currency":{"type":"string","const":"eur"},"status":{"type":"string","enum":["pending","paid","failed","expired","refunded"]},"verified_at":{"type":["string","null"],"format":"date-time"},"fulfilled_at":{"type":["string","null"],"format":"date-time"},"refund_status":{"type":"string","enum":["not_requested","pending","succeeded","failed"]},"stripe_refund_id":{"type":["string","null"]},"refund_requested_at":{"type":["string","null"],"format":"date-time"},"refund_updated_at":{"type":["string","null"],"format":"date-time"},"refund_reason":{"type":["string","null"],"maxLength":80},"refund_last_error":{"type":["string","null"],"maxLength":80},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","composition_id","stripe_checkout_session_id","stripe_payment_intent_id","idempotency_key","amount_cents","currency","status","verified_at","fulfilled_at","refund_status","stripe_refund_id","refund_requested_at","refund_updated_at","refund_reason","refund_last_error","created_at","updated_at"],"additionalProperties":false}}}