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.
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.
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.
- 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
- 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
Durable dashboards with history
Sync Razorpay via its APIs (Payments, Orders, Settlements) or settlement reports into a database, then point Metabase at it.
- 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
- 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?
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)
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)
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)
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 csvto 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 csvneeds 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-remotebridge - 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)
# 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{
"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.
# 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.csvThe Metabase CLI stores its credentials securely after mb auth login.
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.
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.
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
| Concept | Grain | Key columns |
|---|---|---|
payments | one row per payment | id, order_id, amount, fee, tax, status, method, created_at |
orders | one row per order | id, amount, amount_paid, status, created_at |
settlements | one row per settlement | id, amount, fees, tax, status, created_at |
refunds | one row per refund | id, payment_id, amount, status, created_at |
disputes | one row per dispute | id, payment_id, amount, status, created_at |
subscriptions | one row per subscription | id, customer_id, plan_id, status, current_end |
Modeling advice
- Build a
modeled_razorpay_paymentsview 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?
| Metric | Definition | Notes |
|---|---|---|
| Captured volume | Sum of captured payment amounts. | Gross, before fees. |
| Payment success rate | Captured ÷ attempted payments. | Segment by method. |
| Net revenue | Captured − fees − tax − refunds. | What the business keeps. |
| Refund rate | Refunds ÷ captured payments. | By count or amount — label which. |
| Dispute rate | Disputes ÷ payments. | High rates risk penalties. |
| MRR | Active 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.
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;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;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;