Skip to main content
In this guide, you’ll learn how to manage a store’s team from your own server code. You can invite members, add them directly, and update their roles.

Invite a member

inviteSellerWorkflow creates a MemberInvite and sends the invitation email. The invitee sets up access and is linked to the store when they accept.
src/api/custom/invite/route.ts

Add a member directly

When you already have the user, for example during a migration, add them to a store without the invite step. Use addSellerMemberWorkflow.
Every store must keep at least one admin member. A workflow that would remove or demote the last admin fails instead of leaving a store unadministered.

Accept an invite

The invitee’s acceptance runs through acceptMemberInviteWorkflow. It links the member to the store, and if the email already exists, it reuses their account.