{"lexicon":1,"id":"money.atmosphere.membership.updateTier","defs":{"main":{"type":"procedure","description":"Update a money.atmosphere.membership.tier record ATM authored in the creator's repo (the record CID rotates). The creator is derived from the tier strongRef's repo authority; the calling app must hold the same creator consent as createTier. The parent Program URI and Product URI are immutable. The same Product's CID, rank, sort order, and lifecycle may change; another Product requires a new Tier.","input":{"encoding":"application/json","schema":{"type":"object","required":["environment","tier"],"properties":{"environment":{"type":"string","knownValues":["test","live"],"maxLength":16},"tier":{"type":"ref","ref":"com.atproto.repo.strongRef","description":"The money.atmosphere.membership.tier record to update."},"product":{"type":"ref","ref":"com.atproto.repo.strongRef","description":"Optional refreshed strongRef to the same Product URI. Changing the Product URI requires a new Tier."},"rank":{"type":"integer","minimum":0},"sortOrder":{"type":"integer","minimum":0},"archived":{"type":"boolean"}}}},"output":{"encoding":"application/json","schema":{"type":"object","required":["tier"],"properties":{"tier":{"type":"ref","ref":"com.atproto.repo.strongRef"}}}},"errors":[{"name":"AppEnvironmentNotConfigured","description":"The app environment is not configured in ATM."},{"name":"NotAuthorized","description":"The calling app is not authorized to manage memberships for this creator."},{"name":"MembershipTierNotFound","description":"ATM could not load that membership tier record."},{"name":"RecordVersionConflict","description":"The record changed since the supplied strongRef cid was read (compare-and-swap failed). Re-read the record and retry the update."},{"name":"MembershipCreatorAuthorizationRequired","description":"ATM holds no live grant to write to the creator's repo; the creator must re-authorize."},{"name":"InvalidMembershipEntitlement","description":"The Tier's required Product does not resolve to a valid membership listing in the creator's repo, or the update attempts to change its immutable Product URI."},{"name":"InvalidCurrency","description":"The existing tier carries a historical currency; supply an ISO 4217 currency to repair it before any update."},{"name":"WriteFailed","description":"ATM could not write the membership tier record."}]}}}