B2B

icon

Medusa for B2B

B2B platform that works 
with your existing systems 

Build advanced B2B commerce applications with Medusa while seamlessly integrating with ERP, PIM,
and other systems for a fully connected commerce operation. All free and open-source.

image

Powering leading B2B brands

logo
logo
logo

Open-Source Starter

Starter packed with pre-built B2B features

Launch a B2B store in minutes with our Next.js Starter. It comes with pre-built backend features designed specifically for B2B commerce.

  • Company and employee accounts
  • Employee spending limit
  • Request for quote flow
  • Bulk add-to-cart
  • Custom line item pricing
  • Account price lists and discounts
  • Custom payment methods
  • Multiple sales channels
  • Extend pre-built B2B workflows
  • Customer groups
  • Bulk product uploads
  • Cart approval flows

Seamless integration

Let a PIM or ERP handle your product and pricing

Our modular architecture lets you easily interact with outside systems. For instance, retrieve product information or pricing logic to create custom line items in your cart.

quantity discounts

Handle millions of products and custom pricing logic

Don’t let the platform be your limitation. Most of our merchants operate huge product catalogues with complex pricing logic to it.

Customizations ready in hours, not weeks

10x faster time to market, no extra fees

time iconReady-to-use middleware

Our Framework tooling gives you the entire middleware layer that usually takes months to build.

receipt iconNo extra fees

Unlike traditional commerce platforms, our B2B Starter is free and open-source.

Company-employee-links

Set up employee-to-company links with controls like spend limits and cart approval flows.

Company-employee-links

B2B account pricing

Create custom price lists for B2B accounts and automated promotions. Upload via CSV and manage in our bulk-editor.

B2B account pricing

Quotation management

Enable customers to request price quotes that merchants can comment on, accept, alter, or reject.

Quotation management

Multiple market and channels

Set up multiple sales channels and regions with different product and pricing rules to handle DTC, B2B, and offline orders.

Multiple market and channels

Purpose-built for complex B2B commerce

Use built-in B2B features like draft orders or create custom workflows from multi-level cart approvals to special pricing rules.

Framework for customizations

Faster time to market with our framework

Our developer-first framework makes it easy to build custom integrations and features: from data models and workflows to UI extensions and APIs.

No hacks, no workarounds - just clean, scalable customization.

A workflow step performs a query or action in a system. Steps can receive inputs from previous steps and return data to be used in subsequent steps. You can resolve services in your steps, allowing you to build business logic involving Medusa’s core commerce modules, third-party systems, or custom systems.

create-order-in-erp.ts

sync-order-to-erp.ts

src > workflows > steps > create-order-in-erp.ts

import { createStep, StepResponse } from "@medusajs/framework/workflows-sdk"
export const createOrderInERP = createStep(
"create-order-in-erp"
async (order: StepInput, { container }) => {
const erpService = container.resolve("erp")
const createdOrder = await erpService.createOrder(order)
return new StepResponse(createdOrder)
}
)

To connect multiple steps together you create a Workflow. Creating a Workflow is like writing any other function. Behind the scenes Medusa generates a representation of your workflow that enables automatic retries of steps if they fail.

create-order-in-erp.ts

sync-order-to-erp.ts

src > workflows > sync-order-to-erp.ts

import { createWorkflow, WorkflowResponse } from "@medusajs/framework/workflows-sdk"
import { createOrderInERP, transformOrder } from "./steps"
export const syncOrderToERP = createWorkflow(
"sync-order-to-erp",
(input: WorkflowInput, { container }) => {
const medusaOrder = retrieveOrder(input.order_id)
const createdOrder = when({ medusaOrder }, ({ medusaOrder }) => {
return medusaOrder.status === "completed"
}).then(() => {
const preparedOrder = transformOrder(medusaOrder)
return createOrderInERP(preparedOrder)
})
return new WorkflowResponse(createdOrder)
}
)

If step retries don't succeed, Medusa will rollback previous steps. A rollback will call a step's compensation method, ensuring your data is kept consistent across systems.

create-order-in-erp.ts

sync-order-to-erp.ts

src > workflows > accept-quote.ts

import { createStep, StepResponse } from "@medusajs/framework/workflows-sdk"
export const createOrderInERP = createStep(
"create-order-in-erp"
async (order: StepInput, { container }) => {
const erpService = container.resolve("erp")
const createdOrder = await erpService.createOrder(order)
return new StepResponse(createdOrder, createdOrder)
},
// In the face of errors, we roll back and delete the order
async (createdOrder, { container }) => {
const erpService = container.resolve("erp")
await erpService.deleteOrder(createdOrder)
}
)

You can trigger your workflows anywhere in Medusa. Use your workflows in Subscribers to start them in response to an event. Start them in response to requests with API Routes. Or have them run on a defined schedule with Scheduled Jobs.

create-order-in-erp.ts

sync-order-to-erp.ts

src > subscribers > sync-order-to-erp.ts

import {
type SubscriberConfig,
} from "@medusajs/framework"
import syncOrderToErp from "../workflows/sync-order-to-erp"
export default async function handleOrderPlaced({
event: { data },
container,
}) {
const orderService = container.resolve("order")
const order = await orderService.retrieve(id)
await syncOrderToErp(container).run({
input: {
order
},
})
}
export const config: SubscriberConfig = {
event: "order.placed",
}

Some real-life examples

Trusted by industry leaders

Medusa is the world’s most popular open-source commerce platform. Learn why leading B2B users opted for our flexibility.

testimonial logo

+$4bn GMV per year

Built India’s largest B2B platform with 70,000+ partners

testimonial logo

Implemented in 6 weeks

Achieved 9x processing improvement with 60-80% cost savings

testimonial logo

Implemented in 3 months

Series D startup built a B2B platform for over 3,000 designers in Japan.

testimonial logo

+10k daily orders

Handle high volumes and integrates with 43 different regional distributor ERPs.

Get in touch

Let Medusa support your B2B journey

We have supported B2B companies of all sizes on their Medusa journeys. Let us help find the right Medusa Expert or leverage our Cloud+ plan for direct support from the Medusa core team.

Project dashboard

Ready to build your custom commerce setup?