Creates sellers (defaulting status to pending_approval), then runs createMemberInvitesWorkflow to invite each seller’s initial member with the seller administration role. Triggered by POST /admin/sellers. Emits seller.created and member_invite.created.
Usage
import { createSellersWorkflow } from "@mercurjs/core/workflows"
const { result } = await createSellersWorkflow ( container ). run ({
input: {
sellers: [
{
name: "Acme" ,
email: "hello@acme.co" ,
currency_code: "usd" ,
member: { email: "owner@acme.co" },
},
],
},
})
Sellers to create. Display name of the seller.
Contact email of the seller.
Default currency of the seller.
Initial member to invite; { email: string }.
URL handle; auto-generated from the name when omitted.
Public seller description.
External system identifier.
One of open, pending_approval, suspended, terminated; defaults to pending_approval.
Reason attached to the current status.
Marks the seller as premium.
Start of a store closure window.
End of a store closure window.
Custom data passed through to the workflow hooks.
Result
Hooks
validate — runs before creation with { input }.
sellersCreated — runs after creation with { sellers, additional_data }.
createSellersWorkflow . hooks . sellersCreated ( async ({ sellers , additional_data }) => {
// react to new sellers
})