{"lexicon":1,"id":"money.atmosphere.payment.diagnoseSubscriptionFailure","defs":{"main":{"type":"query","description":"Diagnose why a subscription renewal failed, for the originating app. Requires a service-auth JWT signed by the app DID; the app may only diagnose a subscription it originated. Returns a COARSE reason + ATM-authored guidance ONLY — never the recipient's KYC specifics, account ids, or raw processor text. A recipient-side cause is surfaced only as a coarse 'blocked on recipient' reason.","parameters":{"type":"params","properties":{"subscriptionId":{"type":"string","maxLength":128,"description":"The durable ATM subscription id."},"invoiceId":{"type":"string","maxLength":256,"description":"Optional failed-cycle invoice id (informational)."}},"required":["subscriptionId"]},"output":{"encoding":"application/json","schema":{"type":"object","required":["reason","recipientHold","retryEligible","recommendedActions","detail"],"properties":{"reason":{"type":"string","knownValues":["payer_declined","payment_method_expired","authentication_required","processor_unavailable","recipient_account_held","recipient_kyc_pending","unknown"],"maxLength":32},"recipientHold":{"type":"boolean","description":"True when the cause is on the recipient's payout account."},"retryEligible":{"type":"boolean","description":"Whether the processor will keep retrying (false for recipient holds)."},"recommendedActions":{"type":"array","items":{"type":"string","maxLength":256},"description":"ATM-authored guidance the app acts on (it owns customer comms)."},"detail":{"type":"string","maxLength":256,"description":"App-safe summary line; never the raw processor message."},"failedAt":{"type":"string","format":"datetime"},"invoiceId":{"type":"string","maxLength":256}}}}}}}