{"lexicon":1,"id":"money.atmosphere.payment.getSubscriptionChange","defs":{"subscriptionChange":{"type":"object","required":["changeId","subscriptionId","subscriptionRevision","environment","status","direction","fromPaymentId","targetProgram","targetTier","targetListing","targetEntitlements","currentAmount","targetAmount","chargeAmount","currency","interval","intervalCount","requiresPayment","effectiveAt","quoteHash","quoteExpiresAt","createdAt","updatedAt"],"properties":{"changeId":{"type":"string","maxLength":128,"description":"Opaque ATM tier-change id. Apps may persist this id and reconcile only changes they already know."},"subscriptionId":{"type":"string","maxLength":256},"subscriptionRevision":{"type":"integer","minimum":1},"environment":{"type":"string","knownValues":["live","test"],"maxLength":16},"status":{"type":"string","knownValues":["quoted","awaiting_confirmation","awaiting_payment","action_required","scheduled","paid_pending_apply","applied","failed","canceled","superseded","expired"],"maxLength":32},"direction":{"type":"string","knownValues":["upgrade","downgrade","lateral"],"maxLength":16},"fromPaymentId":{"type":"string","maxLength":256},"currentProgram":{"type":"ref","ref":"com.atproto.repo.strongRef"},"currentTier":{"type":"ref","ref":"com.atproto.repo.strongRef"},"currentListing":{"type":"ref","ref":"com.atproto.repo.strongRef"},"targetProgram":{"type":"ref","ref":"com.atproto.repo.strongRef"},"targetTier":{"type":"ref","ref":"com.atproto.repo.strongRef"},"targetListing":{"type":"ref","ref":"com.atproto.repo.strongRef"},"targetEntitlements":{"type":"array","maxLength":50,"items":{"type":"ref","ref":"com.atproto.repo.strongRef"}},"currentAmount":{"type":"integer","minimum":0},"targetAmount":{"type":"integer","minimum":0},"chargeAmount":{"type":"integer","minimum":0,"description":"Amount ATM will attempt immediately after exact hosted confirmation. Upgrades charge the full target amount with no old-tier credit; scheduled changes return zero."},"currency":{"type":"string","minLength":3,"maxLength":3},"interval":{"type":"string","knownValues":["day","week","month","year"],"maxLength":16},"intervalCount":{"type":"integer","minimum":1,"maximum":1095},"requiresPayment":{"type":"boolean","description":"True when confirmation requires an immediate upgrade payment. False for a scheduled change, whose target access still waits for the exact paid renewal."},"effectiveAt":{"type":"string","format":"datetime"},"currentPeriodEnd":{"type":"string","format":"datetime"},"quoteHash":{"type":"string","minLength":64,"maxLength":64,"description":"ATM-authored hash of the exact revision, CIDs, money, cadence, policy, and expiry shown to the payer."},"quoteExpiresAt":{"type":"string","format":"datetime"},"confirmedAt":{"type":"string","format":"datetime"},"paidAt":{"type":"string","format":"datetime"},"appliedAt":{"type":"string","format":"datetime"},"failureCode":{"type":"string","maxLength":64},"createdAt":{"type":"string","format":"datetime"},"updatedAt":{"type":"string","format":"datetime"}}},"main":{"type":"query","description":"Return one known membership tier-change status to the registered app that requested that change. The query is scoped by both opaque changeId and service-auth issuer; another app, including the stable subscription originator when it did not request this change, receives the same not-found response as a missing id. No payer assertion is required so the requesting app can reconcile durable state after missed webhooks or local projection loss.","parameters":{"type":"params","required":["changeId"],"properties":{"changeId":{"type":"string","maxLength":128}}},"output":{"encoding":"application/json","schema":{"type":"object","required":["change"],"properties":{"change":{"type":"ref","ref":"#subscriptionChange"}}}},"errors":[{"name":"AppNotRegistered"},{"name":"RateLimited"},{"name":"SubscriptionChangeNotFound"}]}}}