{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://mandateshield.com/schemas/purchase-envelope.json","title":"Mandate Execution Boundary Purchase Envelope","description":"Protocol-neutral facts required to evaluate an AI-agent purchase immediately before execution.","type":"object","additionalProperties":true,"required":["protocol","mandate_id","agent_id","merchant_id","amount","limits","expires_at","idempotency_key","user_consent"],"properties":{"protocol":{"type":"string","enum":["AP2","TAP","UCP","X402","ACP","CUSTOM"],"description":"Source protocol or CUSTOM for a normalized envelope."},"mandate_id":{"type":"string","minLength":1,"description":"Stable identifier for the user-approved authority."},"agent_id":{"type":"string","minLength":1,"description":"Stable identifier for the acting AI agent."},"merchant_id":{"type":"string","minLength":1,"description":"Stable identifier for the final seller or payee."},"amount":{"type":"object","required":["value","currency"],"properties":{"value":{"type":"number","exclusiveMinimum":0},"currency":{"type":"string","pattern":"^[A-Za-z]{3}$","description":"Three-letter ISO currency code."}}},"limits":{"type":"object","required":["max_amount","currencies","merchants"],"properties":{"max_amount":{"type":"number","exclusiveMinimum":0},"currencies":{"type":"array","minItems":1,"items":{"type":"string","pattern":"^[A-Za-z]{3}$"}},"merchants":{"type":"array","minItems":1,"items":{"type":"string","minLength":1}}}},"created_at":{"type":"string","format":"date-time"},"expires_at":{"type":"string","format":"date-time"},"idempotency_key":{"type":"string","minLength":1,"description":"Unique identifier for this intended payment attempt."},"intent_hash":{"type":"string"},"user_consent":{"type":"boolean"},"credential_binding":{"type":"string"},"purpose":{"type":"string","description":"Non-sensitive plain-language purchase purpose."}}}