{"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 exact Program and required canonical kind=membership Product strongRefs must resolve in that creator repo.","input":{"encoding":"application/json","schema":{"type":"object","required":["creatorDid","environment","program","product"],"properties":{"creatorDid":{"type":"string","format":"did"},"environment":{"type":"string","knownValues":["test","live"],"maxLength":16},"program":{"type":"ref","ref":"com.atproto.repo.strongRef","description":"Parent money.atmosphere.membership.program record in the creator's repo."},"product":{"type":"ref","ref":"com.atproto.repo.strongRef","description":"Required canonical money.atmosphere.product with kind=membership in the creator's repo."},"rank":{"type":"integer","minimum":0},"sortOrder":{"type":"integer","minimum":0}}}},"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 or required Product does not resolve to a valid membership record in the creator's repo."},{"name":"WriteFailed","description":"ATM could not write the membership tier record."}]}}}