# How to Automate Stripe Revenue Reports using the API

- Tool: API Automations
- Difficulty: Beginner
- Fix time: 15-30 minutes
- Compatibility: Stripe account with live mode access; secret key (sk_live_*) required; no additional API plan needed
- Last updated: May 2026

## TL;DR

Automate Stripe revenue reports by calling POST /v1/reporting/report_runs to generate async financial summaries, then GET /v1/balance_transactions with date filters for real-time data. Stripe's Reporting API produces CSV files for activity summaries, payout reconciliation, and balance changes. Key limit: 100 req/sec in live mode, 25 req/sec in test mode. Always verify you're using live mode keys, not test keys.

## Best practices

- Always divide amounts by 100 when displaying — Stripe returns amounts in smallest currency units (cents for USD)
- Use the Reporting API for periodic reports and balance_transactions for real-time dashboards — they serve different use cases
- Implement idempotency by storing the report run ID — if the script crashes after requesting a report, retrieve the existing run instead of creating a new one
- Filter balance transactions by type (charge, refund, payout) separately to build a proper P&L breakdown
- Test your automation in test mode using sk_test_* keys before running against live data
- Store downloaded report CSVs in S3 or Google Cloud Storage for audit trails
- Set up the REPORT_PROCESSING_FINISHED webhook to get notified when large reports complete instead of polling

## Frequently asked questions

### Is the Stripe Reporting API free?

Yes. The Reporting API is available to all Stripe accounts at no additional charge. You only pay Stripe's standard processing fees (2.9% + $0.30 per transaction). The API itself, including report runs and balance transaction queries, has no separate cost.

### What's the difference between balance_transactions and the Reporting API?

GET /v1/balance_transactions returns individual transaction records in real-time and is ideal for custom aggregations and live dashboards. The Reporting API generates pre-built financial summaries (activity, payouts, balance changes) as CSV files asynchronously — better for periodic reports, bookkeeping exports, and large date ranges. For most revenue reporting use cases, the Reporting API is cleaner.

### What happens when I hit the rate limit?

Stripe returns a 429 Too Many Requests error. The response may include a Retry-After header indicating how long to wait. In the Stripe SDK, RateLimitError is thrown. Implement exponential backoff: wait 1s after the first 429, then 2s, 4s, 8s. For reporting workloads, you rarely hit the 100 req/sec live mode limit — it's more likely in test mode (25 req/sec).

### Why is my revenue report showing test mode data instead of real payments?

This is the most common Stripe reporting mistake. Test mode and live mode are completely isolated — they have separate API keys, separate customers, and separate transactions. Verify you're using sk_live_* (not sk_test_*) for production data. Check the livemode field in any Stripe response: true means live data, false means test data.

### How far back can I pull historical revenue data?

The Stripe API has no enforced historical limit — you can query balance transactions from the day your account was created. However, very large date ranges (years of data) should use the Reporting API's itemized report types rather than paginating balance_transactions directly, since the latter can take many minutes with thousands of pages.

### Can I automate sending revenue reports to email or Google Sheets?

Yes. After downloading the CSV via the Reporting API, parse it and send via SendGrid or Resend (email) or append rows via the Google Sheets API. For Slack, POST to an incoming webhook URL with a formatted message. The complete Python script in this guide includes Slack integration as an example.

### Can RapidDev help build a custom Stripe revenue dashboard?

Yes. RapidDev has built 600+ apps including billing dashboards, investor reporting tools, and multi-payment-processor analytics platforms. If you need a custom Stripe reporting solution beyond what the standard API offers, get a free consultation at rapidevelopers.com.

---

Source: https://www.rapidevelopers.com/api-automations/how-to-automate-stripe-revenue-reports-using-the-api
© RapidDev — https://www.rapidevelopers.com/api-automations/how-to-automate-stripe-revenue-reports-using-the-api
