Skip to main content
Validates the invite token, upserts the member by the invited email, links them to the seller with the invited role (as owner if the seller has none yet), binds the auth identity when the member is new, and deletes the consumed invite. Triggered by POST /vendor/members/invites/accept. Emits member_invite.accepted.

Usage

import { acceptMemberInviteWorkflow } from "@mercurjs/core/workflows"

const { result } = await acceptMemberInviteWorkflow(container).run({
  input: {
    invite_token: "eyJhbGciOi...",
    auth_identity_id: "authid_123",
    first_name: "Jane",
    last_name: "Doe",
  },
})

Input

invite_token
string
required
Signed invite token from the invitation link.
auth_identity_id
string
required
Auth identity of the accepting user.
member_id
string
Existing member id; when set, no auth metadata is written.
first_name
string
First name for a newly created member.
last_name
string
Last name for a newly created member.

Result

result
MemberDTO
The member linked to the seller.