Guide
Stripe Analytics Pipeline with BigQuery
Build a three-layer Stripe analytics pipeline in about 20 minutes. Initialize the stripe-bigquery template, ingest Stripe billing data, model MRR, publish revenue reports, and serve a dashboard locally.
The whole project is one command. Run it, point your coding agent at the Bruin MCP, and it can configure and run everything itself.
$ bruin init stripe-bigqueryThree ways to go from here:
- Self-service it. Let the agent configure and run the whole thing, and ask it questions as you go.
- Follow this tutorial. Slower, and it explains why each setting matters - the part an agent will not guess for you.
- Hand the tutorial to the agent. Point it at this page and have it work through the steps with you.
The template README is the short reference for everything it ships.
What
Build a working Stripe analytics pipeline in BigQuery from a template, then put a dashboard on top of it. You will end up with 19 assets across three layers and four report tables you can query or chart.
stripe_raw- six Stripe resources loaded byingestr: customers, products, prices, subscriptions, subscription items, and invoicesstripe_stage- nine typed models, including an accumulating daily MRR snapshotstripe_reports- MRR by customer, MRR movements, subscription KPIs, and invoice billingsdashboards/- a Dashboards as Code file you serve locally onlocalhost:8321
Everything here runs on open-source CLIs on your own machine. The only costs are your BigQuery storage and query usage.
How
bruin init stripe-bigquery writes the whole project. You then run one layer at a time, check the data after each one, serve the dashboard with the dac CLI, and finish by using a coding agent to add your own reports.
The template targets BigQuery, but the models are ordinary SQL. Moving them to Snowflake, Databricks, ClickHouse, Redshift, or Postgres is a refactor, not a rewrite - the last step covers the prompt that does it.
Before you start
- A Stripe secret key (
sk_test_...orsk_live_...) - A Google Cloud project with BigQuery enabled and a service account JSON key that can create datasets and tables
- Git installed
- A coding agent such as Claude Code, Cursor, or Codex for the last step
Guide overview
- 1Set Up Your EnvironmentInstall the Bruin CLI and DAC, connect the Bruin MCP, and initialize the template in a Git repo.
- 2Run the Ingestion LayerLoad six Stripe resources into BigQuery with ingestr, then verify the raw data three ways.
- 3Run the Staging LayerBuild nine conformed models: typing, flattened metadata, joined prices, MRR rules, and daily snapshots.
- 4Run the Reports LayerPublish MRR, movement, KPI, and invoice-billing reports, then validate the whole pipeline.
- 5Serve the Dashboard LocallyValidate, check, and serve the DAC billing dashboard on localhost against your own warehouse.
- 6Extend It With an AgentAdd reports, customize the dashboard, port the models to another warehouse, and choose a deployment.
Frequently asked questions
How do I load Stripe data into BigQuery?
Use the open-source Bruin CLI. Run `bruin init stripe-bigquery` to scaffold the project, add your Stripe secret key and a BigQuery service account key, then run the ingestion layer. Under the hood ingestr loads six Stripe resources - customers, products, prices, subscriptions, subscription items, and invoices - into a `stripe_raw` dataset. No custom extraction code is needed.How do I calculate MRR from Stripe data?
The staging layer models an accumulating daily MRR snapshot from your Stripe subscriptions and subscription items, and the reports layer turns it into MRR by customer, MRR movements (new, expansion, contraction, churn), subscription KPIs, and invoice billings. You get the metric definitions as version-controlled SQL you can read and change, rather than a fixed number in a dashboard.What does the finished Stripe pipeline contain?
19 assets across three layers plus four report tables: `stripe_raw` (six ingested Stripe resources), `stripe_stage` (nine typed models including the daily MRR snapshot), and `stripe_reports` (MRR by customer, MRR movements, subscription KPIs, and invoice billings). A Dashboards as Code file serves a billing dashboard locally on localhost:8321.Is this Stripe analytics tutorial free?
Yes. It runs entirely on open-source CLIs on your own machine and no Bruin account is required. The only costs are your own BigQuery storage and query usage and, if you use the optional final step, the tokens your coding agent consumes.Can I use a warehouse other than BigQuery?
Yes. The template targets BigQuery, but the models are ordinary SQL, so moving them to Snowflake, Databricks, ClickHouse, Redshift, or Postgres is a refactor rather than a rewrite. The final step includes the agent prompt that ports the models for you.How long does it take, and can I use Stripe test data?
About 21 minutes across six steps. You can use either a test key (`sk_test_...`) or a live key (`sk_live_...`); test mode works fine for following along without touching production billing data.
Resources
Get help & contribute