{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://freedom250.local/schemas/agentic-payment-receipt/v0.1","title":"Freedom 250 Agentic Payment Authority Receipt","description":"Research schema joining principal attribution, agent identity, bounded mandate, deterministic admission, scoped credential, commerce, payment, settlement, performance, accounting, revocation, correction and loss. It is not a technical standard or implementation approval.","type":"object","additionalProperties":false,"required":["schemaVersion","receiptId","receiptStatus","eventTimes","principal","delegation","agent","intent","policyDecision","commerce","credential","payment","settlement","performance","accounting","controls","correction","cryptography","evidence"],"properties":{"schemaVersion":{"const":"0.1-research"},"receiptId":{"type":"string","minLength":1},"receiptStatus":{"enum":["proposed","denied","authorized","executed","settled","performed","accounted","disputed","corrected","closed"]},"eventTimes":{"type":"object","additionalProperties":false,"required":["receiptCreatedAt","authoritativeTimeSource"],"properties":{"receiptCreatedAt":{"type":"string","format":"date-time"},"mandateEffectiveAt":{"type":["string","null"],"format":"date-time"},"mandateExpiresAt":{"type":["string","null"],"format":"date-time"},"decisionAt":{"type":["string","null"],"format":"date-time"},"instructionAt":{"type":["string","null"],"format":"date-time"},"acceptedAt":{"type":["string","null"],"format":"date-time"},"settledAt":{"type":["string","null"],"format":"date-time"},"performedAt":{"type":["string","null"],"format":"date-time"},"postedAt":{"type":["string","null"],"format":"date-time"},"revocationIssuedAt":{"type":["string","null"],"format":"date-time"},"revocationAcknowledgedAt":{"type":["string","null"],"format":"date-time"},"authoritativeTimeSource":{"type":"string","minLength":1}}},"principal":{"$ref":"#/$defs/legalActor"},"delegation":{"type":"object","additionalProperties":false,"required":["instrumentId","authoritySource","scope","revocation"],"properties":{"instrumentId":{"type":"string","minLength":1},"instrumentDigest":{"$ref":"#/$defs/digest"},"authoritySource":{"enum":["individual-consent","account-agreement","power-of-attorney","corporate-policy","board-resolution","employment-authority","contract","statute-or-regulation","other"]},"approverActorId":{"type":"string"},"governingLawOrTermsRef":{"type":"string"},"scope":{"$ref":"#/$defs/scope"},"humanApproval":{"type":"object","additionalProperties":false,"required":["required","status"],"properties":{"required":{"type":"boolean"},"status":{"enum":["not-required","pending","approved","denied","expired"]},"approvalRef":{"type":["string","null"]},"approvedFieldsDigest":{"$ref":"#/$defs/nullableDigest"}}},"revocation":{"$ref":"#/$defs/revocation"}}},"agent":{"type":"object","additionalProperties":false,"required":["provider","agentId","instanceId","runtimeIdentity","versions","delegationChain"],"properties":{"provider":{"$ref":"#/$defs/legalActor"},"agentId":{"type":"string","minLength":1},"instanceId":{"type":"string","minLength":1},"runtimeIdentity":{"type":"string","minLength":1},"activeKeyId":{"type":"string"},"versions":{"type":"object","additionalProperties":false,"required":["model","code","tools","policyClient"],"properties":{"model":{"type":"string"},"code":{"type":"string"},"tools":{"type":"array","items":{"type":"string"},"uniqueItems":true},"policyClient":{"type":"string"},"environmentDigest":{"$ref":"#/$defs/nullableDigest"}}},"delegationChain":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["parentActorId","childAgentId","scopeDigest"],"properties":{"parentActorId":{"type":"string"},"childAgentId":{"type":"string"},"scopeDigest":{"$ref":"#/$defs/digest"}}}}}},"intent":{"type":"object","additionalProperties":false,"required":["structuredGoal","prohibitedOutcomes","inputProvenanceRefs"],"properties":{"naturalLanguageIntentDigest":{"$ref":"#/$defs/nullableDigest"},"structuredGoal":{"type":"string","minLength":1},"prohibitedOutcomes":{"type":"array","items":{"type":"string"},"uniqueItems":true},"inputProvenanceRefs":{"type":"array","items":{"type":"string"},"uniqueItems":true}}},"policyDecision":{"type":"object","additionalProperties":false,"required":["decisionId","engine","policyVersion","decision","evaluatedActionDigest","reasonCodes","revocationChecked"],"properties":{"decisionId":{"type":"string"},"engine":{"type":"string"},"policyVersion":{"type":"string"},"decision":{"enum":["allow","deny","require-human","error"]},"evaluatedActionDigest":{"$ref":"#/$defs/digest"},"reasonCodes":{"type":"array","items":{"type":"string"},"minItems":1},"revocationChecked":{"type":"boolean"},"aggregateExposureAfter":{"$ref":"#/$defs/nullableMoney"},"decisionReceiptRef":{"type":["string","null"]}}},"commerce":{"type":"object","additionalProperties":false,"required":["merchant","commercialObject","checkoutDigest","currency","total","termsRef"],"properties":{"merchant":{"$ref":"#/$defs/legalActor"},"merchantDestinationId":{"type":"string"},"commercialObject":{"type":"string","minLength":1},"itemOrServiceIds":{"type":"array","items":{"type":"string"}},"checkoutDigest":{"$ref":"#/$defs/digest"},"merchantSignatureRef":{"type":["string","null"]},"currency":{"type":"string","minLength":3},"total":{"type":"string","pattern":"^-?[0-9]+(\\.[0-9]+)?$"},"tax":{"type":["string","null"],"pattern":"^-?[0-9]+(\\.[0-9]+)?$"},"termsRef":{"type":"string"},"deliveryTermsRef":{"type":["string","null"]},"refundTermsRef":{"type":["string","null"]}}},"credential":{"type":"object","additionalProperties":false,"required":["provider","credentialType","credentialId","scopeDigest","secretExcluded","status"],"properties":{"provider":{"$ref":"#/$defs/legalActor"},"credentialType":{"enum":["card-network-token","shared-payment-token","bank-api-token","wallet-key","delegated-wallet-key","stablecoin-authorization","other"]},"credentialId":{"type":"string"},"scopeDigest":{"$ref":"#/$defs/digest"},"audience":{"type":"string"},"expiresAt":{"type":["string","null"],"format":"date-time"},"secretExcluded":{"const":true},"status":{"enum":["requested","issued","used","expired","revoked","rejected"]}}},"payment":{"type":"object","additionalProperties":false,"required":["instructionId","protocol","rail","asset","amount","payee","idempotencyKey","authenticationStatus","instructionDigest"],"properties":{"instructionId":{"type":"string"},"protocol":{"type":"string"},"protocolVersion":{"type":"string"},"rail":{"enum":["card","ach-or-eft","wire","tokenized-deposit","stablecoin","other-dlt","internal-ledger","other"]},"networkOrChain":{"type":["string","null"]},"asset":{"type":"string"},"assetContractOrInstrumentId":{"type":["string","null"]},"amount":{"type":"string","pattern":"^-?[0-9]+(\\.[0-9]+)?$"},"payee":{"$ref":"#/$defs/legalActor"},"payeeDestinationId":{"type":"string"},"nonce":{"type":["string","null"]},"idempotencyKey":{"type":"string"},"instructionDigest":{"$ref":"#/$defs/digest"},"signatureRef":{"type":["string","null"]},"authenticationStatus":{"enum":["not-attempted","approved","declined","error"]},"authorizationOrAcceptanceRef":{"type":["string","null"]},"captureStatus":{"enum":["not-applicable","not-captured","captured","reversed","failed"]}}},"settlement":{"type":"object","additionalProperties":false,"required":["status","authoritativeRecord","finalityRule"],"properties":{"status":{"enum":["not-started","pending","provisional","final","failed","reversed","compensated"]},"authoritativeRecord":{"type":"string"},"transactionOrSettlementId":{"type":["string","null"]},"finalityRule":{"type":"string"},"finalityEvidenceRef":{"type":["string","null"]},"issuerOrBankLiabilityRecordRef":{"type":["string","null"]},"redemptionOrCashExitRef":{"type":["string","null"]}}},"performance":{"type":"object","additionalProperties":false,"required":["status","evidenceRefs"],"properties":{"status":{"enum":["not-due","pending","partial","delivered","accepted","rejected","failed","refunded"]},"evidenceRefs":{"type":"array","items":{"type":"string"}},"acceptanceActorId":{"type":["string","null"]},"disputeId":{"type":["string","null"]}}},"accounting":{"type":"object","additionalProperties":false,"required":["reportingEntity","eventType","accountingPolicyVersion","postingStatus","reconciliationStatus"],"properties":{"reportingEntity":{"$ref":"#/$defs/legalActor"},"eventType":{"enum":["no-entry-control-event","commitment","purchase","prepayment","settlement","fee","refund","chargeback","recovery","loss","other"]},"accountingPolicyVersion":{"type":"string"},"postingRuleVersion":{"type":"string"},"generalLedgerDocumentId":{"type":["string","null"]},"postingStatus":{"enum":["not-applicable","pending","posted","rejected","reversed","adjusted"]},"classification":{"type":["string","null"]},"reportingPeriod":{"type":["string","null"]},"reconciliationStatus":{"enum":["not-started","exception","matched","corrected"]},"reconciliationRef":{"type":["string","null"]}}},"controls":{"type":"object","additionalProperties":false,"required":["sanctions","fraud","conflict","privacy","duplicate","deliveryMatch"],"properties":{"sanctions":{"$ref":"#/$defs/controlResult"},"fraud":{"$ref":"#/$defs/controlResult"},"kytOrTransactionMonitoring":{"$ref":"#/$defs/nullableControlResult"},"conflict":{"$ref":"#/$defs/controlResult"},"privacy":{"$ref":"#/$defs/controlResult"},"duplicate":{"$ref":"#/$defs/controlResult"},"deliveryMatch":{"$ref":"#/$defs/controlResult"}}},"correction":{"type":"object","additionalProperties":false,"required":["revocation","correctionStatus","lossStatus"],"properties":{"revocation":{"$ref":"#/$defs/revocation"},"correctionStatus":{"enum":["not-needed","pending","cancelled","reversed","refunded","charged-back","compensated","unrecoverable"]},"linkedOriginalReceiptId":{"type":["string","null"]},"linkedCorrectionReceiptIds":{"type":"array","items":{"type":"string"}},"disputeOrCaseRef":{"type":["string","null"]},"lossStatus":{"enum":["none","provisional","recovery-pending","allocated","final"]},"provisionalLossBearerActorId":{"type":["string","null"]},"finalLossBearerActorId":{"type":["string","null"]},"lossRuleRef":{"type":["string","null"]}}},"cryptography":{"type":"object","additionalProperties":false,"required":["algorithms","keyIds","pqMigrationState","rotationAndRecoveryRef"],"properties":{"algorithms":{"type":"array","items":{"type":"string"},"uniqueItems":true},"keyIds":{"type":"array","items":{"type":"string"},"uniqueItems":true},"pqMigrationState":{"enum":["not-assessed","classical-only","hybrid","pq-ready","exception"]},"rotationAndRecoveryRef":{"type":"string"}}},"evidence":{"type":"object","additionalProperties":false,"required":["custodian","retentionRuleRef","evidenceRefs","receiptDigest"],"properties":{"custodian":{"$ref":"#/$defs/legalActor"},"retentionRuleRef":{"type":"string"},"evidenceRefs":{"type":"array","items":{"type":"string"},"minItems":1,"uniqueItems":true},"receiptDigest":{"$ref":"#/$defs/digest"},"signatures":{"type":"array","items":{"type":"string"}},"rawSecretsExcluded":{"const":true},"sensitiveContentLocation":{"enum":["none","controlled-external-store","selectively-disclosed-credential"]}}}},"$defs":{"legalActor":{"type":"object","additionalProperties":false,"required":["actorId","legalName","actorType","jurisdiction"],"properties":{"actorId":{"type":"string","minLength":1},"legalName":{"type":"string","minLength":1},"actorType":{"enum":["natural-person","legal-entity","government","financial-institution","merchant","service-provider","other"]},"jurisdiction":{"type":"string","minLength":1},"accountOrRegistrationRef":{"type":["string","null"]}}},"scope":{"type":"object","additionalProperties":false,"required":["permittedActions","prohibitedActions","currencies","assets","rails","singleTransactionLimit","cumulativeLimit","counterpartyRules","geographyRules","recurrence"],"properties":{"permittedActions":{"type":"array","items":{"type":"string"},"minItems":1,"uniqueItems":true},"prohibitedActions":{"type":"array","items":{"type":"string"},"uniqueItems":true},"currencies":{"type":"array","items":{"type":"string"},"uniqueItems":true},"assets":{"type":"array","items":{"type":"string"},"uniqueItems":true},"rails":{"type":"array","items":{"type":"string"},"uniqueItems":true},"singleTransactionLimit":{"$ref":"#/$defs/money"},"cumulativeLimit":{"$ref":"#/$defs/money"},"cumulativeWindow":{"type":"string"},"counterpartyRules":{"type":"array","items":{"type":"string"}},"categoryRules":{"type":"array","items":{"type":"string"}},"geographyRules":{"type":"array","items":{"type":"string"}},"recurrence":{"enum":["one-time","recurring","streaming","prohibited"]},"maximumRetries":{"type":"integer","minimum":0}}},"money":{"type":"object","additionalProperties":false,"required":["currency","amount"],"properties":{"currency":{"type":"string","minLength":3},"amount":{"type":"string","pattern":"^[0-9]+(\\.[0-9]+)?$"}}},"nullableMoney":{"anyOf":[{"$ref":"#/$defs/money"},{"type":"null"}]},"digest":{"type":"object","additionalProperties":false,"required":["algorithm","value"],"properties":{"algorithm":{"type":"string","minLength":1},"value":{"type":"string","minLength":1}}},"nullableDigest":{"anyOf":[{"$ref":"#/$defs/digest"},{"type":"null"}]},"controlResult":{"type":"object","additionalProperties":false,"required":["status","controlVersion","evidenceRef"],"properties":{"status":{"enum":["pass","fail","review","not-applicable","error"]},"controlVersion":{"type":"string"},"evidenceRef":{"type":"string"}}},"nullableControlResult":{"anyOf":[{"$ref":"#/$defs/controlResult"},{"type":"null"}]},"revocation":{"type":"object","additionalProperties":false,"required":["status","statusEndpointOrRegistryRef"],"properties":{"status":{"enum":["active","suspended","revoked","expired","unknown"]},"statusEndpointOrRegistryRef":{"type":"string"},"noticeRef":{"type":["string","null"]},"downstreamAcknowledgementRefs":{"type":"array","items":{"type":"string"}},"inFlightActionDisposition":{"enum":["none","cancelled","too-late","under-review","unknown"]}}}}}
