Bruin Academy

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.

Skip ahead

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-bigquery

Three 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 by ingestr: customers, products, prices, subscriptions, subscription items, and invoices
  • stripe_stage - nine typed models, including an accumulating daily MRR snapshot
  • stripe_reports - MRR by customer, MRR movements, subscription KPIs, and invoice billings
  • dashboards/ - a Dashboards as Code file you serve locally on localhost: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_... or sk_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

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.

Get help & contribute

Sign up to our newsletter

Practical updates on open-source data pipelines, AI analysts, governance, and what we are shipping at Bruin.

The signup form is hosted by Brevo. Accept cookies to load it.