Seller Module
In this section of the documentation, you will find resources to learn more about the Seller Module and how to use it in your application. Mercur has multi-vendor management features available out-of-the-box through the Seller Module. A module is a standalone package that provides features for a single domain. Each of Mercur’s marketplace features are placed in custom modules, such as this Seller Module. Learn more about why modules are isolated in this documentation.Seller Features
- Seller Management: Create and manage seller accounts with business information and store status.
- Team Member Management: Handle multiple team members per seller with role-based access (owner, admin, member).
- Member Invitations: Send JWT-based invitations to team members with expiration and validation.
- Seller Onboarding: Track seller onboarding progress through multiple setup steps.
- Store Status Control: Manage seller store status (ACTIVE, INACTIVE, SUSPENDED) to control marketplace access.
- Resource Isolation: Each seller has isolated access to their own products, orders, inventory, and shipping configurations.
How to Use the Seller Module
In your Medusa application, you build flows around Commerce Modules. A flow is built as a Workflow, which is a special function composed of a series of steps that guarantees data consistency and reliable roll-back mechanism. You can build custom workflows and steps. Mercur provides pre-built workflows for seller operations in the@mercurjs/b2c-core package.
For example, the createSellerWorkflow:
src/workflows/seller/create-seller.ts
Subscriber
src/subscribers/seller-creation-request-accepted.ts
Concepts
In this document, you’ll learn about the main concepts related to sellers in Mercur.Seller
A seller is a vendor entity in the marketplace that can manage products, orders, and customers. It is represented by the Seller data model. A seller holds information about:- Business details (name, description, contact information)
- Business address and tax identification
- Store status (ACTIVE, INACTIVE, SUSPENDED)
- A unique handle for storefront URLs
- Team members who can manage the seller’s resources
- Onboarding progress
Store Status
A seller’s store can be in one of three states:ACTIVE
The seller is fully operational and can:- List and sell products
- Receive and fulfill orders
- Manage all marketplace resources
- Access the vendor panel
INACTIVE
The seller account exists but is not currently operational. This status might be used for:- Sellers who haven’t completed onboarding
- Temporarily closed stores
- Sellers taking a break from the marketplace
SUSPENDED
The seller has been suspended by marketplace administrators, typically due to:- Policy violations
- Customer complaints
- Payment issues
Member
A member represents a user who can manage a seller’s marketplace operations. It is represented by the Member data model.Member Roles
Members can have one of three roles: owner: Full administrative control- Manage seller business information
- Invite and remove team members
- Access financial and payout settings
- Delete the seller account
- Manage products, inventory, and orders
- Configure shipping and promotions
- View reports and analytics
- Cannot modify business settings or team members
- View and fulfill orders
- Update inventory
- Cannot modify products or settings
Member Invite
A member invite represents a pending invitation to join a seller’s team. It is represented by the MemberInvite data model.Invitation Flow
- Existing member creates invite: Owner or admin generates invitation with email and role
- JWT token generated: System creates signed JWT token with 7-day expiration
- Email sent: Invitation email with unique link sent to invitee
- Recipient accepts: User clicks link and completes registration
- Token validation: System verifies token is valid and not expired
- Member created: New member account created and linked to seller
- Invite marked accepted: Invite record updated to prevent reuse
Seller Onboarding
Seller onboarding tracks the setup progress of new sellers through required steps. It is represented by the SellerOnboarding data model.Onboarding Steps
1. store_information (boolean)- Business name, description, contact details
- Business address and tax ID
- Store branding (logo, photos)
- Payout account creation
- Stripe Connect onboarding
- Bank account verification
- Stock location setup
- Shipping zones and options
- Fulfillment configuration
- First product creation
- Inventory setup
- Pricing configuration
isOnboardingCompleted method checks if all four steps are complete, determining if the seller can start selling.
Resource Isolation
The Seller Module implements multi-tenancy through module links, giving each seller their own isolated resources: Commerce Resources:- Products and inventory
- Orders and returns
- Customer groups
- Promotions and campaigns
- Price lists
- Stock locations
- Fulfillment sets
- Service zones
- Shipping options
- Shipping profiles
- Data security (sellers only see their own data)
- Independent operations (one seller’s actions don’t affect others)
- Scalability (resources scale per seller)
Authentication Integration
The Seller Module integrates with Medusa’s Auth Module to enable member authentication:- Members are a custom actor type (
seller) - Auth identities store
member_idinapp_metadata - Routes are protected with
authenticate("seller")middleware - Member ID is used to resolve seller ownership