B2B Starter: Foundation for a modern B2B setup
by Medusa
Let employees purchase on behalf of their company while companies manage users, invite employees, set purchasing rules, and track orders. Ships with pre-built B2B purchase flows out of the box — draft orders, quotes, cart approvals, spending limits, and bulk add-to-cart. Manage large catalogs with millions of SKUs and configure custom price lists and promotions for each B2B client, all within the Medusa Admin.

Medusa B2B Starter
Documentation | Website
Building blocks for digital commerce
Medusa B2B Starter
An official Medusa starter for B2B ecommerce, built with Medusa and Next.js 15. It covers common business-to-business requirements out of the box and is designed to be customized and extended.
Features
- Company management — Create and manage companies, invite employees, and assign roles
- Spending limits — Set per-employee spending limits with configurable reset frequencies
- Approval workflows — Require admin or sales manager approval before orders are placed
- Quote management — Allow customers and merchants to negotiate quotes with messaging
- Order editing — Adjust order items, pricing, and totals after placement
- Bulk add-to-cart — Add multiple products to the cart at once
- Promotions — Manual and automatic promotion support with free shipping progress
- Full ecommerce — Products, collections, cart, checkout, and order history
Getting Started
Deploy with Medusa Cloud
The fastest way to get started is deploying with Medusa Cloud:
- Create a Medusa Cloud account
- Deploy this starter directly from your dashboard
Local Installation
**Prerequisites:
- Node.js v20+
- PostgreSQL v15+
- pnpm v10+
- Clone the repository and install dependencies:
1git clone https://github.com/medusajs/b2b-starter.git2cd b2b-starter3pnpm install- Set up environment variables for the backend:
cp apps/backend/.env.template apps/backend/.env- Set the database URL in :
1# Replace with actual database URL, make sure the database exists.2DATABASE_URL=postgres://postgres:@localhost:5432/medusa-b2b-starter- Run migrations:
1cd apps/backend2pnpm medusa db:migrate- Add admin user:
1cd apps/backend2pnpm medusa user -e admin@test.com -p supersecret- Start Medusa backend:
1cd apps/backend2pnpm dev-
Open the admin dashboard at and log in. Retrieve your publishable API key at Settings > Publishable API key.
-
Set up environment variables for the storefront:
cp apps/storefront/.env.template apps/storefront/.env.local- Update with your Medusa publishable API key:
NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY=pk_6c3...- Start storefront:
1cd apps/storefront2pnpm devThe storefront runs on .
You can slo run the following command from the root to start both backend and storefront:
pnpm devConfiguration
Backend ()
| Variable | Description |
|---|---|
| PostgreSQL connection string | |
| Redis connection string (optional) | |
| Secret used to sign JWT tokens | |
| Secret used to sign session cookies |
Storefront ()
| Variable | Description |
|---|---|
| URL of the Medusa backend | |
| Public URL of the storefront | |
| Default region code (e.g. ) | |
| Secret for on-demand cache revalidation |
Resources
License
Licensed under the MIT License.