Skip to main content
Creates invite records with a signed token and expiry for each entry. Triggered by POST /admin/sellers/:id/members/invite and the vendor invite routes; also run as a step by createSellersWorkflow for the initial member. Emits member_invite.created with { id, token, expires_at } per invite, which typically drives the invitation email.

Usage

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

const { result } = await createMemberInvitesWorkflow(container).run({
  input: [
    {
      seller_id: "sel_123",
      email: "teammate@acme.co",
      role_id: "role_seller_support",
    },
  ],
})

Input

The input is an array of invites.
[].seller_id
string
required
Seller the invite belongs to.
[].email
string
required
Email of the invitee.
[].role_id
string
required
Role the invitee receives on acceptance.

Result

result
MemberInviteDTO[]
The created invites, including token and expires_at.