{"lexicon":1,"id":"money.atmosphere.payment.previewSubscriptionChange","defs":{"main":{"type":"procedure","description":"Create a short-lived ATM-authored membership tier-change quote without changing billing or access. Requires registered requesting-app service auth plus a fresh, single-use payer assertion. The requester must either be the stable subscription originator or hold the creator's current environment-scoped subscription approval; ATM preserves the original originator in either case. ATM validates the target program, tier, and recurring price strongRefs in the creator's repo, requires the same portable membership program/currency/cadence, binds the quote to expectedRevision, and permits only one active change intent per subscription.","input":{"encoding":"application/json","schema":{"type":"object","required":["payerDid","payerAssertion","environment","subscriptionId","expectedRevision","changeAttemptId","targetProgram","targetTier","targetPrice"],"properties":{"payerDid":{"type":"string","format":"did"},"payerAssertion":{"type":"string","maxLength":4096},"environment":{"type":"string","knownValues":["live","test"],"maxLength":16},"subscriptionId":{"type":"string","maxLength":256},"expectedRevision":{"type":"integer","minimum":1},"changeAttemptId":{"type":"string","minLength":1,"maxLength":200,"description":"App-generated idempotency key. Reuse with different semantic input is rejected."},"targetProgram":{"type":"ref","ref":"com.atproto.repo.strongRef"},"targetTier":{"type":"ref","ref":"com.atproto.repo.strongRef"},"targetPrice":{"type":"ref","ref":"com.atproto.repo.strongRef"},"targetAmount":{"type":"integer","minimum":0,"description":"Optional target amount assertion. In v1 tier switching requires a fixed recurring target price and this value, when sent, must equal it."}}}},"output":{"encoding":"application/json","schema":{"type":"object","required":["change"],"properties":{"change":{"type":"ref","ref":"money.atmosphere.payment.defs#subscriptionChange"}}}},"errors":[{"name":"FeatureUnavailable"},{"name":"AppNotRegistered"},{"name":"RateLimited"},{"name":"InvalidPayerAssertion"},{"name":"PayerDidMismatch"},{"name":"SubscriptionNotFound"},{"name":"SubscriptionRevisionMismatch"},{"name":"SubscriptionNotEligible"},{"name":"SubscriptionNoticesUnavailable"},{"name":"MembershipContextUnavailable"},{"name":"MembershipTargetInvalid"},{"name":"MembershipProgramMismatch"},{"name":"SubscriptionPeriodUnavailable"},{"name":"TargetChanged"},{"name":"SubscriptionCadenceMismatch"},{"name":"CurrencyMismatch"},{"name":"AlreadyOnTier"},{"name":"VariableAmountTierChangeUnsupported"},{"name":"InvalidAmount"},{"name":"TargetAmountMismatch"},{"name":"TargetProcessorPriceUnavailable"},{"name":"SubscriptionChangeAlreadyPending"},{"name":"IdempotencyConflict"},{"name":"QuoteExpired"},{"name":"SubscriptionChangeWriteFailed"},{"name":"SubscriptionChangeFailed"}]}}}