commercetools × Metabase

How to build commercetools dashboards in Metabase

commercetools is a headless, API-first platform for composable commerce, holding orders, carts, products, and customers across stores and channels. Metabase is where you turn that activity into shared, trustworthy dashboards. This guide covers two complementary paths: a lightweight MCP + CLI route that pulls live data with the commercetools MCP and loads a CSV into Metabase with the Metabase CLI for quick analysis, and a durable pipeline route that syncs commercetools into a database so you can build dashboards anyone can read.

Heads up: Metabase connects to databases and warehouses — it does not ship a native commercetools connector. For dashboards that need history and reliability, you'll sync commercetools into a database first (covered below).

How do you connect commercetools to Metabase?

Most teams combine both routes: use the commercetools MCP and Metabase CLI route to pull live data and stand up a quick analysis, and the pipeline route for the dashboards people depend on.

1 · MCP + CLI route (AI-assisted)

Live data in, quick analysis out

Pair a commercetools MCP server (to read live carts, orders, and project resources) with the Metabase CLI, whose upload command loads a CSV into Metabase as a ready-to-query table and model.

Best for
  • Quick lookups like "orders by store this week?"
  • Loading a commercetools CSV export into Metabase in seconds
  • Spot-checks and one-off analyses without a warehouse
Trade-offs
  • Great for exploration, not governed reporting
  • Use read-only scopes on the commercetools MCP to avoid accidental writes
  • CSV uploads are snapshots — refresh or move to the pipeline for history
2 · Pipeline route (warehouse-backed)

Durable dashboards with history

Sync commercetools into a database or warehouse with the Export API, GraphQL, or dlt, then point Metabase at it.

Best for
  • GMV, AOV, and cohort dashboards leaders depend on
  • Multi-store, multi-channel composable commerce reporting
  • Peak-season comparisons across quarters and years
Trade-offs
  • You own the refresh schedule and the data model
  • Nested JSON (line items, money, custom fields) needs flattening
  • Money is stored as centAmount + currencyCode + fractionDigits

What can you analyze from commercetools data in Metabase?

  • GMV & sales — gross merchandise value, orders, AOV
  • Channels & stores — revenue split across a composable setup
  • Catalog performance — top products, variants, and categories
  • Customer groups — B2B vs. retail revenue mix
  • Orders & payments — order and payment state funnels
  • Repeat purchase — cohorts and orders per customer

Which commercetools dashboards should you build in Metabase?

For: Commerce leads

GMV overview

The pulse of a composable storefront.

  • Gross merchandise value vs. prior period (number + trend)
  • Orders per day (line)
  • Average order value (number + trend)
  • Revenue by store / channel (bar)
For: Merchandising

Catalog performance

What's selling across the catalog.

  • Top products by net revenue (bar)
  • Units sold by variant (table)
  • Revenue by category (bar)
  • Return rate by product (bar)
For: Growth / retention

Customers & repeat purchase

Are buyers coming back?

  • Repeat-purchase rate by cohort (line)
  • Orders per customer distribution (bar)
  • Revenue by customer group (B2B vs retail) (bar)
  • Revenue by acquisition month (cohort table)
For: Ops & finance

Orders & payments

From cart to captured.

  • Order state funnel (Open → Confirmed → Complete) (bar)
  • Payment state mix (bar)
  • Discounts as % of gross (line)
  • Cart-to-order conversion (number)

How do you use the commercetools MCP server with the Metabase CLI?

Pair a commercetools MCP server with the Metabase CLI for fast, hands-on analysis. commercetools offers an official Commerce MCP for carts, orders, and project resources, and a Knowledge MCP for docs and API access; the Metabase CLI's upload command loads a CSV into Metabase and creates a ready-to-query table and model. For analysis, grant read-only scopes on the commercetools MCP.

Example workflow

  • Ask the commercetools MCP which store or channel drove the most orders this week.
  • Export the orders or line items you want to keep as a CSV.
  • Run mb upload csv to load it into Metabase as a table and model, then build questions and dashboards on top.

Be honest about the limits

  • The commercetools MCP is great for live lookups — not for scheduled or audited reporting.
  • A CSV upload is a point-in-time snapshot; refresh it with mb upload replace or move to the pipeline for real history.
  • Access is scoped by API client credentials — grant read-only scopes so analysis can't trigger writes.
  • mb upload csv needs an uploads database configured under Admin → Settings → Uploads.

How do you set up the commercetools MCP server and the Metabase CLI?

commercetools MCPofficial

Auth
API client credentials (client ID/secret, scopes)
Config
Project key + region auth/API URLs
Servers
Commerce MCP (resources) + Knowledge MCP (docs)
Note
Grant read-only scopes for analysis.

Metabase CLIofficial

Install
npm install -g @metabase/cli
Auth
mb auth login (browser OAuth on v62+, or an API key)
Load data
mb upload csv --file data.csv
Requires
An uploads database (Admin → Settings → Uploads)
Cursor~/.cursor/mcp.json or .cursor/mcp.json
{
  "mcpServers": {
    "commercetools": {
      "command": "npx",
      "args": ["-y", "@commercetools/mcp-essentials"],
      "env": {
        "CLIENT_ID": "YOUR_CLIENT_ID",
        "CLIENT_SECRET": "YOUR_CLIENT_SECRET",
        "PROJECT_KEY": "YOUR_PROJECT_KEY",
        "AUTH_URL": "https://auth.<region>.commercetools.com",
        "API_URL": "https://api.<region>.commercetools.com"
      }
    }
  }
}
TerminalLoad a commercetools CSV with the Metabase CLI
# Install the Metabase CLI
npm install -g @metabase/cli

# Log in (opens your browser; requires Metabase v62+)
mb auth login --url https://your-metabase.example.com

# Load a commercetools CSV export — creates a table AND a model
mb upload csv --file commercetools-orders.csv --collection root

# Refresh that same table later from a new export
mb upload replace <table-id> --file commercetools-orders.csv

Replace the client credentials, project key, and region URLs with your own; grant read-only scopes for analysis. The Metabase CLI stores its credentials securely after mb auth login and loads each CSV into your uploads database as a table and model.

Verify before shipping: confirm an uploads database is enabled under Admin → Settings → Uploads (Metabase docs) and the current commercetools MCP setup in the commercetools MCP docs.

Can you generate a commercetools dashboard with AI?

Yes. Use the prompt below with any assistant that can run the commercetools MCP server and the Metabase CLI. It works end to end: if commercetools tables already exist in Metabase it analyzes those; otherwise it pulls the data over the commercetools MCP, loads it with mb upload csv, then builds the dashboard — normalizing centAmount money, handling multi-currency, and skipping cards it has no data for.

Prompt for creating a commercetools Store Overview dashboard
Create a polished Metabase dashboard for commercetools ecommerce analytics.
Work end to end: get the data into Metabase if it isn't there yet, then build.

Goal: Help commerce leaders understand GMV, average order value, repeat purchase,
catalog performance, and orders/payments from commercetools data.

Step 1 — Find or load the data:
- First, check what already exists in Metabase (search for commercetools tables
  and models). If durable commercetools data is already present — synced from a
  warehouse or uploaded earlier — use it and skip to Step 2.
- If nothing is there, pull it with a commercetools MCP server in read-only mode:
  orders, line items, carts, products (product projections), customers, customer
  groups, and categories. Write each result to a CSV, then load it with the
  Metabase CLI — run "mb upload csv --file <export>.csv" so each upload creates a
  table and a ready-to-query model. Use "mb upload replace <table-id> --file
  <export>.csv" to refresh an existing table instead of creating duplicates.

Step 2 — Inspect before querying:
commercetools CSV exports are usually flat (one row per order, line item, or
customer). Warehouse tables are raw and often carry nested JSON (line items,
money, custom fields) that must be flattened. Either way, money is stored as
centAmount with a currencyCode and fractionDigits — normalize it. Inspect the
actual tables and column names first; do not assume exact names. Map what you
find into these analytical concepts where possible: Orders, Line items, Carts,
Products (product projections), Product variants, Customers, Customer groups, and
Categories.

Important:
- Build on whatever data is present; don't claim Metabase connects natively to
  commercetools — it reads a database or CLI-uploaded tables.
- Normalize centAmount using fractionDigits and keep currencyCode.
- Report NET revenue and GMV consistently; state the definitions.
- Count only completed/confirmed orders per your definition of paid.
- Use order-level grain for AOV.
- Handle multi-currency: convert to a reporting currency or split by currency.
- Define a "repeat customer" once (2+ paid orders) and reuse it everywhere.
- Only build a card if its underlying column/metric exists in the data.
- A single CSV is a point-in-time snapshot: only build trend cards if there is a
  usable date column or multiple periods have been uploaded.

Dashboard title: commercetools Store Overview

Sections:
1. Executive summary (KPI cards): GMV last 30 days; Orders; AOV; Repeat-purchase
   rate; Discount depth.
2. Sales & channels: GMV by day; Orders by day; AOV trend; Revenue by store/channel.
3. Catalog performance: Top products by net revenue; Units by variant; Revenue by
   category.
4. Customers & retention: Repeat-purchase rate by cohort; Orders per customer;
   Revenue by customer group.
5. Orders & payments: Order state funnel; Payment state mix; Discount depth.

Filters: Date range, Store/channel, Category, Customer group, Currency.

Reuse the models Metabase auto-created from uploaded CSVs, or (for a warehouse)
create reusable models: modeled_ct_orders, modeled_ct_line_items,
modeled_ct_products, and modeled_ct_customers.

Output: Build the dashboard if you have permission; otherwise provide the exact
questions, SQL, model definitions, and layout. Include caveats for any metric
that cannot be calculated from the available data. Keep it practical, dense,
and executive-readable. Avoid vanity metrics.

How do you sync commercetools data into a database or warehouse?

For dashboards that need history and reliability, land commercetools data in a database first, then connect Metabase to that database.

Connector options

  • Export API— commercetools' bulk export for orders, products, and customers into your warehouse.
  • dlt(code) — write a Python pipeline against the HTTP or GraphQL API for full control.
  • GraphQL / HTTP API (raw) — the source of truth; paginate orders, line items, products, and customers and upsert on a schedule.
  • Managed ETL (verify) — check whether your ETL vendor offers a commercetools source; availability varies.

Notes

  • Flatten nested JSON (line items, money, custom fields) into clean tables.
  • Normalize money from centAmount using fractionDigits and keep currencyCode.
  • Localized names are maps — pick a locale for reporting labels.

How should you model commercetools data in Metabase?

Core tables (after flattening)

TableGrainKey columns
ordersone row per orderid, customer_id, order_state, total_price_cent_amount, currency_code, created_at
order_line_itemsone row per lineorder_id, product_id, variant_id, quantity, total_price_cent_amount
productsone row per productid, name_en, category_id
customersone row per customerid, email, customer_group_id, created_at

Modeling advice

  • Normalize order_state and pick which states count as paid.
  • Convert cent amounts to a reporting currency, or split by currency.
  • Compute AOV at the order grain; define GMV and net revenue once.
  • Use customer_group_id to separate B2B from retail.

Which commercetools metrics should you track in Metabase?

MetricDefinitionNotes
GMVTotal order value in a period.State currency handling.
Average order value (AOV)GMV ÷ orders.Order grain; segment by store.
Repeat-purchase rateCustomers with 2+ paid orders ÷ all.Fixed window; watch by cohort.
Discount depthDiscounts ÷ gross sales.Ties promotions to margin.
Channel mixRevenue share by store/channel.Core for composable, multi-store setups.

What SQL powers commercetools dashboards in Metabase?

These assume flattened tables in a warehouse (PostgreSQL dialect). Money is divided by 100 to illustrate centAmount normalization — adjust to fractionDigits.

GMV and orders per dayPostgreSQL

Confirmed-order value over the last 30 days.

SELECT
  date_trunc('day', o.created_at)                       AS day,
  COUNT(*)                                              AS orders,
  SUM(o.total_price_cent_amount) / 100.0                AS gmv
FROM orders o
WHERE o.order_state = 'Confirmed'
  AND o.created_at >= CURRENT_DATE - INTERVAL '30 days'
GROUP BY 1
ORDER BY 1;
Average order value by week and currencyPostgreSQL

AOV at the order grain, split by currency to stay honest.

SELECT
  date_trunc('week', o.created_at) AS week,
  o.currency_code                  AS currency,
  COUNT(*)                         AS orders,
  ROUND((SUM(o.total_price_cent_amount) / 100.0) / NULLIF(COUNT(*), 0), 2) AS aov
FROM orders o
WHERE o.order_state = 'Confirmed'
GROUP BY 1, 2
ORDER BY 1;
Top products by revenuePostgreSQL

Units and gross revenue by product over 90 days.

SELECT
  li.name_en                        AS product,
  SUM(li.quantity)                  AS units,
  SUM(li.total_price_cent_amount) / 100.0 AS gross_revenue
FROM order_line_items li
JOIN orders o ON o.id = li.order_id
WHERE o.order_state = 'Confirmed'
  AND o.created_at >= CURRENT_DATE - INTERVAL '90 days'
GROUP BY li.name_en
ORDER BY gross_revenue DESC
LIMIT 20;
Repeat-purchase ratePostgreSQL

Share of customers with two or more paid orders.

WITH customer_orders AS (
  SELECT customer_id, COUNT(*) AS paid_orders
  FROM orders
  WHERE order_state = 'Confirmed'
    AND customer_id IS NOT NULL
  GROUP BY customer_id
)
SELECT
  ROUND(100.0 * COUNT(*) FILTER (WHERE paid_orders >= 2)
    / NULLIF(COUNT(*), 0), 2) AS repeat_purchase_rate_pct
FROM customer_orders;

What are common mistakes when analyzing commercetools in Metabase?

Reporting centAmount as whole currency.→ Divide by the currency's fractionDigits, or revenue is off by 100×.
Summing across currencies without converting.→ Split by currency or convert to a reporting currency first.
Reporting off raw nested JSON.→ Flatten line items, money, and custom fields into clean tables.
Averaging line-item prices for AOV.→ Compute AOV at the order grain, or multi-item baskets skew the number.
Treating MCP answers as governed reporting.→ Use MCP for live exploration; build warehouse-backed dashboards for anything people depend on.

Related analytics

Related integrations

FAQ

Does Metabase connect natively to commercetools?
No. Metabase reads SQL databases and warehouses. Sync commercetools into a database first (the Export API, GraphQL/HTTP API, or dlt), then connect Metabase to that database.
Is the commercetools MCP server official?
Yes. commercetools provides an official Commerce MCP for carts, orders, and project resources, plus a Knowledge MCP for docs and API access. Both authenticate with API client credentials and scoped access.
How do I quickly load commercetools data without a warehouse?
Export a CSV from commercetools and run `mb upload csv --file data.csv` with the Metabase CLI. It creates a table and a model you can build questions on right away. You'll need an uploads database enabled under Admin → Settings → Uploads. Refresh later with `mb upload replace`, or move to the pipeline route when you need history.
How do I handle commercetools money and currencies?
Money is stored as a centAmount with a currencyCode and fractionDigits. Normalize the amount using fractionDigits, keep the currency, and either convert to a reporting currency or split metrics by currency.