6 min read

How to Track Revenue Reporting in Stripe

You need visibility into your Stripe revenue—not just for accounting, but for understanding business health and growth. Stripe gives you several tools to track this: the Dashboard for quick snapshots, the API for programmatic queries, and webhooks for real-time updates. The challenge is knowing which approach fits your use case.

View Revenue in the Stripe Dashboard

The quickest way to see your revenue is through the Stripe Dashboard, which gives you a visual overview without writing code.

Open the Payments overview

Log into your Stripe account and navigate to Dashboard > Payments. You'll see your revenue graph and a summary of successful charges, refunds, and failed payments.

Filter your report by date range

Click the date filter at the top right to select a custom range—last 7 days, month, quarter, or custom dates. The revenue graph updates instantly to show only transactions in that window.

Export data programmatically with invoices

Instead of exporting CSVs manually, you can fetch all paid invoices directly from the Stripe API. Filter by date range and sum the totals for an automated revenue report.

javascript
const stripe = require('stripe')(process.env.STRIPE_SECRET_KEY);

const invoices = await stripe.invoices.list({
  limit: 100,
  status: 'paid',
  created: {
    gte: Math.floor(new Date('2026-01-01') / 1000),
    lte: Math.floor(new Date('2026-03-26') / 1000),
  },
});

const totalRevenue = invoices.data.reduce((sum, invoice) => {
  return sum + invoice.amount_paid;
}, 0);

console.log(`Total invoiced revenue: ${totalRevenue}`);
Fetch paid invoices in bulk—faster than exporting CSVs manually
Tip: Use the Status filter to exclude draft or uncollectible invoices. The Dashboard counts them initially, but you want to track *paid* revenue only.

Query Revenue Programmatically with the Stripe API

When you need to calculate revenue in real time or integrate it into your app, use the Stripe API to fetch charges, invoices, or balance transactions.

Fetch charges from a specific period

Use the Charges API to retrieve a list of successful charges. Filter by creation date to get charges from a specific period. Each charge object includes the amount, currency, status, and payment_method_details.

javascript
const stripe = require('stripe')(process.env.STRIPE_SECRET_KEY);

const charges = await stripe.charges.list({
  limit: 100,
  created: {
    gte: Math.floor(Date.now() / 1000) - 2592000, // 30 days ago
  },
});

const totalRevenue = charges.data.reduce((sum, charge) => {
  return sum + (charge.paid ? charge.amount : 0);
}, 0);

console.log(`Total revenue (in cents): ${totalRevenue}`);
Amount is returned in cents, so divide by 100 to get dollars

Break down revenue by payment method

To see revenue split between card, ACH, and other payment types, check the charge.payment_method_details object. Group results by payment_method_details.type to track which methods drive the most revenue.

Handle pagination for large datasets

The Charges API returns up to 100 results per request. If you have thousands of charges, use the starting_after parameter to page through without hitting rate limits.

javascript
let allCharges = [];
let hasMore = true;
let lastChargeId = null;

while (hasMore) {
  const batch = await stripe.charges.list({
    limit: 100,
    starting_after: lastChargeId,
    created: { gte: 1609459200 }, // Jan 1, 2021
  });

  allCharges = allCharges.concat(batch.data);
  hasMore = batch.has_more;
  if (batch.data.length > 0) {
    lastChargeId = batch.data[batch.data.length - 1].id;
  }
}
Pagination lets you safely process millions of charges
Watch out: Don't forget about refunds. A charge.refunded flag tells you if it was fully refunded, but check charge.amount_refunded for partial refunds and net revenue.

Track Revenue Changes with Webhooks

For real-time revenue tracking, webhooks let you react instantly when a payment succeeds or fails, without polling the API repeatedly.

Create a webhook endpoint in your server

Set up a POST endpoint that listens for Stripe events. This endpoint will receive webhook payloads whenever a payment event occurs. Make sure it's publicly accessible and can handle Stripe's retry logic.

Register the endpoint in Stripe

Go to Settings > Webhooks in your Stripe Dashboard. Click Add endpoint and paste your server URL. Select the events you want to listen to: charge.succeeded, charge.failed, and charge.refunded are the key ones for revenue tracking.

Verify and process webhook payloads

Inside your endpoint, use the Stripe SDK to verify the webhook signature. This confirms the request came from Stripe, not a third party. Then extract the charge object and log it to your database.

javascript
const express = require('express');
const stripe = require('stripe')(process.env.STRIPE_SECRET_KEY);
const app = express();

app.post('/webhook', express.raw({type: 'application/json'}), async (req, res) => {
  const sig = req.headers['stripe-signature'];

  let event;
  try {
    event = stripe.webhooks.constructEvent(
      req.body,
      sig,
      process.env.STRIPE_WEBHOOK_SECRET
    );
  } catch (err) {
    return res.status(400).send(`Webhook Error: ${err.message}`);
  }

  if (event.type === 'charge.succeeded') {
    const charge = event.data.object;
    console.log(`Payment received: ${charge.id}, ${charge.amount} ${charge.currency}`);
    // Save to your database here
  }

  res.json({received: true});
});
Always verify the signature—anyone can POST to your endpoint
Tip: Webhooks can retry multiple times if your server fails. Return a 2xx status code quickly, then process the charge asynchronously to avoid timeout errors.

Common Pitfalls

  • Forgetting that Stripe amounts are in cents (e.g., $10.00 = 1000). Divide by 100 before displaying or storing in your database.
  • Not accounting for refunds when calculating revenue. A charge might succeed initially but get fully or partially refunded days later.
  • Including test mode charges in your revenue reports. Always filter by mode: 'production' or verify charges are from live keys.
  • Assuming webhooks arrive in order or at least once. Build idempotency into your webhook handler using charge IDs as deduplication keys.

Wrapping Up

Tracking revenue in Stripe is straightforward once you pick the right tool: use the Dashboard for quick checks, the API for programmatic access, and webhooks for real-time alerts. Combine these approaches—query historical data via the API, react to new payments via webhooks, and validate totals in the Dashboard. If you want to track this automatically across tools, Product Analyst can help.

Track these metrics automatically

Product Analyst connects to your stack and surfaces the insights that matter.

Try Product Analyst — Free