AI

OSS Eコマース比較:Medusa vs WooCommerce vs Saleor でヘッドレス通販を構築する

オープンソースラボ編集部2026年6月14日

OSSEコマース比較:Medusa vs WooCommerce vs Saleor でヘッドレス通販を構築する

Shopifyの月額費用・制限から脱却してフルコントロールのヘッドレスEコマースをセルフホストできるOSSプラットフォームが成熟しています。Medusa(Node.js製・ヘッドレスAPI First)・WooCommerce(WordPress拡張・シェア最大)・Saleor(Python Django製・GraphQL)の3つが2026年のOSS Eコマースデファクトスタンダードです。

OSS Eコマースを選ぶ理由

  • コスト削減: Shopify Plus($2000/月)→セルフホストで$50〜200/月のVPS費用のみ
  • フルカスタマイズ: 商品・注文・決済・物流のビジネスロジックを自由に変更可能
  • データ所有権: 顧客データ・購買履歴が完全に自社管理(GDPRコンプライアンスが容易)
  • ヘッドレス構成: Next.js・Remixなど任意のフロントエンドを使えるAPI First設計

主要プラットフォームの概要

Medusa

2021年公開、TypeScript製のOSSです。GitHubスター27k+。Node.js製のモジュラーなヘッドレスEコマースプラットフォームで、商品・注文・顧客・決済をREST API / Admin SDKで完全管理できます。Next.js製スターターが公式提供されており、Stripeをはじめ多数の決済プロバイダーに対応します。

# Medusa セットアップ(PostgreSQL + Redis + MinIO)
npx create-medusa-app@latest my-store   --with-nextjs-starter

cd my-store/backend

# .env 設定
cat > .env << 'EOF'
DATABASE_URL=postgresql://medusa:password@localhost:5432/medusa
REDIS_URL=redis://localhost:6379
JWT_SECRET=$(openssl rand -hex 32)
COOKIE_SECRET=$(openssl rand -hex 32)
EOF

# データベースマイグレーション & 起動
npx medusa db:migrate
npx medusa develop
// src/api/store/custom/products/route.ts: カスタムAPIエンドポイント
import { MedusaRequest, MedusaResponse } from '@medusajs/framework/http'

export const GET = async (req: MedusaRequest, res: MedusaResponse) => {
  const productService = req.scope.resolve('productService')

  // カスタムフィルタリングロジック
  const products = await productService.list(
    { status: 'published', collection_id: req.params.collectionId },
    { relations: ['variants', 'images', 'tags'] }
  )

  res.json({ products, count: products.length })
}
// src/workflows/custom-order.ts: Medusa Workflowでカスタム注文処理
import { createWorkflow, createStep, StepResponse } from '@medusajs/framework/workflows-sdk'

const validateInventoryStep = createStep('validate-inventory', async (input: { variantId: string; quantity: number }, context) => {
  const inventoryService = context.container.resolve('inventoryService')
  const [item] = await inventoryService.list({ variant_id: input.variantId })
  if (!item || item.stocked_quantity < input.quantity) {
    throw new Error('在庫不足')
  }
  return new StepResponse({ available: true })
})

const sendOrderNotificationStep = createStep('send-notification', async (input: { orderId: string; email: string }) => {
  // Resend / SendGrid でメール送信
  return new StepResponse({ sent: true })
})

export const customOrderWorkflow = createWorkflow('custom-order-workflow', (input) => {
  const inventory = validateInventoryStep(input)
  const notification = sendOrderNotificationStep(input)
  return { inventory, notification }
})

WooCommerce

2011年公開、PHP製のOSSです。GitHubスター9k+(WordPress中心)。世界シェア最大のEコマースプラットフォーム(全オンラインストアの28%がWooCommerce)で、WordPress上で動作し5万以上のプラグインエコシステムを持ちます。

// functions.php: WooCommerce カスタム決済ゲートウェイ
add_filter('woocommerce_payment_gateways', function($gateways) {
    $gateways[] = 'Custom_Payment_Gateway';
    return $gateways;
});

class Custom_Payment_Gateway extends WC_Payment_Gateway {
    public function __construct() {
        $this->id = 'custom_payment';
        $this->title = 'カスタム決済';
        $this->method_title = 'カスタム決済ゲートウェイ';
        $this->has_fields = true;
        $this->init_form_fields();
        $this->init_settings();
    }

    public function process_payment($order_id): array {
        $order = wc_get_order($order_id);
        // 決済APIを呼び出して処理
        $order->payment_complete();
        $order->add_order_note('カスタム決済完了');
        return ['result' => 'success', 'redirect' => $this->get_return_url($order)];
    }
}

Saleor

2012年公開、Python製のOSSです。GitHubスター21k+。Django製のGraphQL API First Eコマースプラットフォームで、高度なグラフモデル(チャンネル・属性・バリアント)でB2B・マルチリージョン・マルチテナントのユースケースに対応します。

# Saleor GraphQL APIで商品を作成
import requests

SALEOR_GRAPHQL_URL = 'http://localhost:8000/graphql/'
AUTH_TOKEN = 'Bearer your-token'

mutation = '''
mutation CreateProduct($input: ProductCreateInput!) {
  productCreate(input: $input) {
    product {
      id
      name
      slug
    }
    errors {
      field
      message
    }
  }
}
'''

variables = {
    'input': {
        'name': '新商品',
        'slug': 'new-product',
        'productType': 'UHJvZHVjdFR5cGU6MQ==',
        'description': '{"blocks": [{"type": "paragraph", "data": {"text": "商品説明"}}]}',
        'isPublished': True,
    }
}

response = requests.post(
    SALEOR_GRAPHQL_URL,
    json={'query': mutation, 'variables': variables},
    headers={'Authorization': AUTH_TOKEN},
)
print(response.json())

機能比較表

比較項目MedusaWooCommerceSaleor
APIタイプRESTRESTGraphQL
ヘッドレス
プラグイン数✅ 最多
B2B対応
学習コスト
GitHub Stars27k+9k+21k+

OSS EコマースはDevOpsカテゴリ/categories/devopsのMinIO(商品画像ストレージ)・Redisキャッシュ・PostgreSQL(トランザクションDB)と組み合わせてフルスタックの通販インフラを構築します。LLM Toolsカテゴリ/categories/llm-toolsのRAG・ベクター検索でAI商品レコメンデーション・自然言語商品検索を実装する構成が最先端のEコマース体験を提供します。

FAQ

Q. Medusaの決済にStripeを設定するには?

A. @medusajs/payment-stripeプラグインを追加して環境変数を設定します。①npm install @medusajs/payment-stripemedusa-config.tsに追加: {resolve: '@medusajs/payment-stripe', options: {apiKey: process.env.STRIPE_SECRET_KEY}}③Stripe DashboardでWebhookを設定: エンドポイントURLhttps://your-domain.com/hooks/payment/stripenpx medusa adminでAdmin UIを開き→設定→リージョン→決済プロバイダーでStripeを有効化⑤フロントエンドでmedusa-payment-stripeパッケージのStripe Elements UIコンポーネントを実装。

Q. WooCommerceとMedusaのどちらを選べばいいですか?

A. 既存WordPressサイトの拡張・SEOコンテンツ重視ならWooCommerceヘッドレス構成・カスタムUI・API First開発ならMedusaが向いています。WooCommerce優位: ①世界最大のプラグインエコシステム(5万+)でほぼ全機能を追加できる②WordPress管理画面でノンエンジニアも操作できる③SEOプラグイン(Yoast)との統合が最も充実。Medusa優位: ①Next.js・Remix・RNとのヘッドレス統合が洗練されたAPIで実現②Workflowエンジンでカスタムビジネスロジックを宣言的に定義③TypeScript製でモダンな開発体験④Shopifyからの移行が容易(データモデルが似ている)。

Q. Medusaで複数の通貨・地域を管理するには?

A. Medusa v2のチャンネル・リージョン機能で対応します。設定: ①Admin UI→設定→リージョンで「日本(JPY・Stripe Japan)」「US(USD・Stripe US)」を作成②各リージョンに税率・対応決済プロバイダーを設定③商品→価格設定で通貨別価格(¥1000・$7.99)を設定④フロントエンドでユーザーの国判定(Accept-Languageヘッダー・IPジオロケーション)してリージョンを選択⑤Medusa JS Client: medusaClient.store.products.list({region_id: 'JP_REGION_ID'})でリージョン対応価格を取得します。

Q. OSS EコマースにAI商品レコメンデーションを実装するには?

A. 購買履歴ベースのCollaborative FilteringまたはRAG商品検索で実装します。協調フィルタリング: ①order_itemsテーブルから「ユーザーAが買った商品Bも買った」を集計②PostgreSQL pg_trgm拡張で類似商品を検索③簡易実装ならSupabaseのEdge FunctionでSELECT product_id, COUNT(*) FROM order_items WHERE order_id IN (SELECT order_id FROM order_items WHERE product_id=$1) GROUP BY product_id ORDER BY COUNT DESC LIMIT 10。RAGベース自然言語商品検索: ①商品説明・タグをEmbeddingしてQdrant/pgvectorに投入②ユーザーの検索クエリをEmbeddingして類似商品を取得③結果をLLMで自然言語回答として整形(「〇〇を探していますか?△△もおすすめです」)。

まとめ

ユースケース推奨ツール
ヘッドレス・Next.js・API FirstMedusa
WordPress統合・プラグイン豊富・SEOWooCommerce
GraphQL・B2B・マルチリージョンSaleor

関連外部リソース

他の記事も読む

Let's Build Together

OSS導入、自社だけで悩まない。

ツール選定から構築・運用・AI活用まで、オープンソースラボ運営元のClasslessが伴走します。初回のご相談は無料です。