{"lexicon":1,"id":"money.atmosphere.membership.createTier","defs":{"main":{"type":"procedure","description":"Create a portable money.atmosphere.membership.tier record under an existing program in the creator's repo. Requires registered-app service auth and the same creator-consent model as createProgram. The program strongRef must resolve to a money.atmosphere.membership.program in the creator's repo; any linked product/price must be a membership listing in that repo.","input":{"encoding":"application/json","schema":{"type":"object","required":["creatorDid","environment","program","title"],"properties":{"creatorDid":{"type":"string","format":"did"},"environment":{"type":"string","knownValues":["test","live"],"maxLength":8},"program":{"type":"ref","ref":"com.atproto.repo.strongRef","description":"Parent money.atmosphere.membership.program record in the creator's repo."},"title":{"type":"string","minLength":1,"maxGraphemes":100,"maxLength":1000},"description":{"type":"string","maxGraphemes":1000,"maxLength":10000},"benefits":{"type":"array","maxLength":24,"items":{"type":"ref","ref":"#benefit"},"description":"Public benefit labels only; access enforcement comes from payment state."},"product":{"type":"ref","ref":"com.atproto.repo.strongRef"},"price":{"type":"ref","ref":"com.atproto.repo.strongRef"},"unitAmount":{"type":"integer","minimum":0},"currency":{"type":"string","minLength":3,"maxLength":3},"rank":{"type":"integer","minimum":0},"sortOrder":{"type":"integer","minimum":0},"recipientAssertionJwt":{"type":"string","maxLength":8192}}}},"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 create memberships for this creator."},{"name":"MembershipCreatorAuthorizationRequired","description":"ATM holds no live grant to write membership records to the creator's repo; the creator must sign in to ATM (or re-authorize)."},{"name":"InvalidMembershipEntitlement","description":"The program, product, or price does not resolve to a valid membership record in the creator's repo."},{"name":"WriteFailed","description":"ATM could not write the membership tier record."}]},"benefit":{"type":"object","required":["label"],"properties":{"kind":{"type":"string","maxLength":80},"label":{"type":"string","minLength":1,"maxGraphemes":120,"maxLength":1200}}}}}