Razorpay × Metabase

How to build Razorpay payment dashboards in Metabase

Razorpay processes your payments across UPI, cards, netbanking, and wallets, and handles settlements, refunds, and subscriptions. Metabase is where you turn that into shared, trustworthy dashboards for volume, success rate, refunds, and settlement. This guide covers two complementary paths: a lightweightMCP + CLI route that pulls live data with the Razorpay MCP server and loads a CSV into Metabase with the Metabase CLI for quick analysis, and a durable pipeline route that syncs Razorpay into a database so you can build volume, success-rate, and settlement dashboards anyone can read.

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

How do you connect Razorpay to Metabase?

Most teams combine both routes: use the Razorpay MCP server and Metabase CLI route to pull live data and stand up a quick analysis, and the pipeline route for the revenue dashboards finance depends on.

1 · MCP + CLI route (AI-assisted)

Live data in, quick analysis out

Pair the official Razorpay MCP server (to look up live payments, orders, and settlements) 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 "which payments failed in the last hour?"
  • Loading a Razorpay CSV export into Metabase in seconds
  • Spot-checks and one-off analyses without a warehouse
Trade-offs
  • Great for exploration, not governed financial reporting
  • Use read-only Razorpay API keys so analysis can't trigger writes
  • CSV uploads are snapshots — refresh or move to the pipeline for history
2 · Pipeline route (warehouse-backed)

Durable dashboards with history

Sync Razorpay via its APIs (Payments, Orders, Settlements) or settlement reports into a database, then point Metabase at it.

Best for
  • Captured-volume, success-rate, and settlement dashboards finance relies on
  • Refund, dispute, and subscription trends over time
  • Joining payments with orders, product, and support data
Trade-offs
  • Requires a destination database and a sync to maintain
  • Fees and settlement timing affect net — model them explicitly
  • Reconcile against Razorpay Dashboard before anyone trusts the numbers

What can you analyze from Razorpay data in Metabase?

  • Captured volume — gross processed volume and transaction count
  • Payment success rate — captured ÷ attempted, by method
  • Net revenue — what lands after Razorpay fees
  • Refunds and disputes — leakage and chargeback pressure
  • Settlements — timing and net amounts deposited
  • Subscriptions and MRR — if you use Razorpay Subscriptions

Which Razorpay dashboards should you build in Metabase?

For: Founders, finance

Volume & net revenue

Captured volume and what lands after fees.

  • Captured volume and count by day (line)
  • Net revenue after Razorpay fees (line)
  • Gross vs. net by month (dual bar)
  • Average transaction value (number)
For: Finance, ops

Success & failures

How reliably payments go through.

  • Payment success rate by day (line)
  • Failures by error reason (bar)
  • Success rate by method (UPI, cards, netbanking) (bar)
  • Failures by bank/issuer (table)
For: Finance, leadership

Refunds, disputes & settlements

Leakage and cash landing in your account.

  • Refund rate and refunded amount (number + line)
  • Disputes/chargebacks by month (bar)
  • Settlements and settlement timing (table)
  • Fees as a share of volume (line)
For: Growth, RevOps

Subscriptions & MRR

Recurring revenue from Razorpay Subscriptions.

  • MRR and active subscriptions (number + trend)
  • MRR movement: new, renewal, churn (waterfall)
  • Revenue churn rate (line)
  • Renewals due in the next 30 days (table)

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

Pair the Razorpay MCP server with the Metabase CLI for fast, hands-on analysis. Razorpay ships a first-party MCP server that looks up live payments, orders, and settlements; the Metabase CLI's upload command loads a CSV into Metabase and creates a ready-to-query table and model. For analysis, scope the Razorpay API keys to read-only.

Example workflow

  • Ask the Razorpay MCP which payments failed in the last hour, or pull an order's payments and refunds.
  • Export the payments, settlements, and refunds you want to keep as CSVs.
  • Run mb upload csv to load them into Metabase as tables and models, then build questions and dashboards on top.

Be honest about the limits

  • The Razorpay MCP is great for live lookups — not for scheduled or audited financial reporting.
  • A CSV upload is a point-in-time snapshot; volume and success-rate trends still need a warehouse sync, or refresh with mb upload replace.
  • Scope the Razorpay API keys to read-only so analysis can't trigger writes.
  • mb upload csv needs an uploads database configured under Admin → Settings → Uploads.

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

Razorpay MCPofficial

Local
@razorpay/mcp-server (npm) via NPX
Remote
Connected via the mcp-remote bridge
Auth
RAZORPAY_KEY_ID + RAZORPAY_KEY_SECRET
Transport
Local stdio (or remote via bridge)

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)
ClaudeClaude Code CLI
# Razorpay (local NPX server)
claude mcp add razorpay \
  --env RAZORPAY_KEY_ID=<YOUR_KEY_ID> \
  --env RAZORPAY_KEY_SECRET=<YOUR_KEY_SECRET> \
  -- npx -y @razorpay/mcp-server@latest
Cursor~/.cursor/mcp.json or .cursor/mcp.json (local server)
{
  "mcpServers": {
    "razorpay": {
      "command": "npx",
      "args": ["-y", "@razorpay/mcp-server@latest"],
      "env": {
        "RAZORPAY_KEY_ID": "<YOUR_KEY_ID>",
        "RAZORPAY_KEY_SECRET": "<YOUR_KEY_SECRET>"
      }
    }
  }
}

Generate API keys in the Razorpay Dashboard under Settings → API Keys, and use test-mode keys to validate first. Razorpay also documents a remote MCP connected through the mcp-remote bridge — check their Cursor docs for the current endpoint.

TerminalLoad a Razorpay 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 Razorpay CSV export — creates a table AND a model
mb upload csv --file razorpay-payments.csv --collection root

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

The Metabase CLI stores its credentials securely after mb auth login.

Verify before shipping: confirm an uploads database is enabled under Admin → Settings → Uploads (Metabase docs) and the current Razorpay MCP setup in the Razorpay MCP docs. Scope the API keys to read-only for analysis work.

Can you generate a Razorpay dashboard with AI?

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

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

Goal: Help founders and finance leaders understand captured volume, net revenue,
payment success, refunds, disputes, settlements, and (if used) subscriptions/MRR
from Razorpay data.

Step 1 — Find or load the data:
- First, check what already exists in Metabase (search for Razorpay tables and
  models). If durable Razorpay 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 the Razorpay MCP server using read-only API
  keys: payments, orders, settlements, refunds, disputes, and subscriptions.
  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:
Do not assume exact table names. Map the available raw tables into these
analytical concepts where possible: Payments, Orders, Settlements, Refunds,
Disputes, Customers, and Subscriptions. Inspect the actual tables and column
names first.

Important:
- Build on whatever data is present; don't claim Metabase connects natively to
  Razorpay — it reads a database or CLI-uploaded tables.
- Separate gross captured volume from net revenue (after Razorpay fees and tax).
- Compute payment success rate as captured ÷ attempted, and segment by method
  (UPI, cards, netbanking, wallets).
- If Razorpay Subscriptions are used, compute MRR from active subscriptions.
- Report in INR (or your settlement currency); note the currency.
- Only build a card if its underlying column/metric exists in the data.
- A single CSV is a point-in-time snapshot: volume and success-rate trends need
  history, so build trend cards only if a warehouse sync or multiple uploads
  provide it.

Dashboard title: Razorpay Payments Overview

Sections:
1. Executive summary (KPI cards): Captured volume; Net revenue; Success rate;
   Refund rate; Dispute rate; Average transaction value.
2. Volume & net revenue: Volume by day; Gross vs. net; Average transaction
   value.
3. Success & failures: Success rate; Failures by reason; Success by method.
4. Refunds, disputes & settlements: Refund rate; Disputes by month; Settlement
   timing; Fees as a share of volume.
5. Subscriptions & MRR (if used): MRR movement; Active subscriptions; Revenue
   churn.

Filters: Method, Currency, Order/product, Date range.

Reuse the models Metabase auto-created from uploaded CSVs, or (for a warehouse)
create reusable models: modeled_razorpay_payments, modeled_razorpay_settlements,
and (if used) modeled_razorpay_mrr.

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. Reconcile totals against
Razorpay Dashboard. Keep it practical, dense, and executive-readable. Avoid
vanity metrics.

How do you build the Razorpay → Metabase pipeline?

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

No paid tool required. A fully free stack: a small dlt or hand-written script (extract) → a free Postgres database like Neon or Supabase (load) → a scheduler such as GitHub Actions cron (host) → Metabase (visualize). For hosting and scheduling details, see our data pipeline guide.

Connector options

  • Razorpay APIs (free, first-party) — Payments, Orders, Settlements, Refunds, and Subscriptions APIs into your own pipeline.
  • Webhooks (free, events) — stream payment and settlement events into a table for near-real-time dashboards.
  • Settlement reports (free, CSV) — periodic settlement and transaction reports for batch loads when an API pipeline is overkill.

Notes

  • Land raw tables first, then build clean models on top.
  • Razorpay timestamps are Unix epochs — convert with to_timestamp() once in a model.
  • Amounts are in the smallest currency unit (paise) — divide in a model layer.
  • Separate fees and refunds so net revenue is accurate.

How should you model Razorpay data in Metabase?

Core tables

ConceptGrainKey columns
paymentsone row per paymentid, order_id, amount, fee, tax, status, method, created_at
ordersone row per orderid, amount, amount_paid, status, created_at
settlementsone row per settlementid, amount, fees, tax, status, created_at
refundsone row per refundid, payment_id, amount, status, created_at
disputesone row per disputeid, payment_id, amount, status, created_at
subscriptionsone row per subscriptionid, customer_id, plan_id, status, current_end

Modeling advice

  • Build a modeled_razorpay_payments view with gross, fee, and net per payment.
  • Define success rate on a consistent denominator (attempts vs. orders).
  • Segment by method — UPI, cards, and netbanking behave differently.
  • If you use Razorpay Subscriptions, build a monthly MRR model like any subscription tool.
  • Reconcile modeled volume and settlements against Razorpay Dashboard.

Which Razorpay metrics should you track in Metabase?

MetricDefinitionNotes
Captured volumeSum of captured payment amounts.Gross, before fees.
Payment success rateCaptured ÷ attempted payments.Segment by method.
Net revenueCaptured − fees − tax − refunds.What the business keeps.
Refund rateRefunds ÷ captured payments.By count or amount — label which.
Dispute rateDisputes ÷ payments.High rates risk penalties.
MRRActive subscriptions' normalized monthly amount.Only if Razorpay Subscriptions are used.

What SQL powers Razorpay dashboards in Metabase?

These assume the modeled tables above (PostgreSQL dialect, amounts in paise, epoch timestamps). Adjust identifiers to match your schema.

Daily volume and success ratePostgreSQL

Captured volume and how reliably payments go through.

SELECT
  date_trunc('day', to_timestamp(created_at))         AS day,
  COUNT(*)                                            AS payments,
  COUNT(*) FILTER (WHERE status = 'captured')         AS captured,
  ROUND(100.0 * COUNT(*) FILTER (WHERE status = 'captured')
    / NULLIF(COUNT(*), 0), 2)                         AS success_rate_pct,
  ROUND(SUM(amount) FILTER (WHERE status = 'captured') / 100.0, 2)
    AS captured_volume
FROM payments
WHERE to_timestamp(created_at) >= CURRENT_DATE - INTERVAL '30 days'
GROUP BY 1
ORDER BY 1;
Success rate by methodPostgreSQL

Compare UPI, cards, netbanking, and wallets.

SELECT
  method,
  COUNT(*)                                            AS attempts,
  ROUND(100.0 * COUNT(*) FILTER (WHERE status = 'captured')
    / NULLIF(COUNT(*), 0), 2)                         AS success_rate_pct
FROM payments
WHERE to_timestamp(created_at) >= CURRENT_DATE - INTERVAL '30 days'
GROUP BY method
ORDER BY attempts DESC;
Gross vs. net revenue by monthPostgreSQL

Net revenue is what lands after Razorpay fees.

SELECT
  date_trunc('month', to_timestamp(created_at))       AS month,
  ROUND(SUM(amount) / 100.0, 2)                       AS gross_volume,
  ROUND(SUM(fee) / 100.0, 2)                          AS fees,
  ROUND(SUM(amount - fee) / 100.0, 2)                 AS net_revenue
FROM payments
WHERE status = 'captured'
GROUP BY 1
ORDER BY 1;

What are common mistakes when analyzing Razorpay in Metabase?

Treating a live MCP lookup or a one-off CSV as governed financial reporting.→ Use the Razorpay MCP and CSV uploads for lookups and triage; build warehouse-backed Metabase dashboards for anything finance depends on.
Reporting gross without fees and refunds.→ Subtract Razorpay fees and refunds to see the net the business keeps.
Ignoring payment method.→ UPI, cards, and netbanking have very different success rates — always segment by method.
Leaving amounts in paise or times in epoch.→ Divide amounts and convert timestamps once in a model layer.
Never reconciling with Razorpay Dashboard.→ Sanity-check modeled volume and settlements against Razorpay's own reports before trusting them.

Related analytics

Related metrics

Related integrations

FAQ

Does Metabase connect natively to Razorpay?
No. Metabase reads SQL databases and warehouses. Sync Razorpay into a database first (its APIs, webhooks, or settlement reports), then connect Metabase to that database.
How do I quickly analyze Razorpay data without a warehouse?
Pull the objects you need with the Razorpay MCP server (use read-only API keys), export them to CSV, 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 improve payment success rate?
Start by measuring it per method (UPI, cards, netbanking, wallets) and per issuer. Razorpay's failure reasons tell you where declines cluster — surface them in a table so you can act.
Can I track subscription MRR from Razorpay?
Yes, if you use Razorpay Subscriptions. Model active subscriptions and plan prices into a monthly MRR table, the same way you would for any subscription billing tool.