Skip to main content
RapidDev - Software Development Agency
stripe-guide

How to export transactions from Stripe

Export transactions from Stripe using the Dashboard (Payments → Export → CSV) or the API with stripe.balanceTransactions.list() for programmatic access. Dashboard exports handle date ranges and column selection in a few clicks. The API approach lets you automate recurring exports and build custom reports with exact filters.

What you'll learn

  • How to export transactions as CSV from the Stripe Dashboard
  • How to pull transaction data via the API with date filters
  • How to paginate through large datasets for complete exports
  • How to format exported data for accounting tools
Book a free consultation
4.9Clutch rating
600+Happy partners
17+Countries served
190+Team members
Beginner5 min read10 minutesStripe API v2024-12+, Node.js 18+, Stripe DashboardMarch 2026RapidDev Engineering Team
TL;DR

Export transactions from Stripe using the Dashboard (Payments → Export → CSV) or the API with stripe.balanceTransactions.list() for programmatic access. Dashboard exports handle date ranges and column selection in a few clicks. The API approach lets you automate recurring exports and build custom reports with exact filters.

Exporting Transaction Data from Stripe

Whether you need a monthly report for your accountant, a one-time audit export, or an automated data pipeline, Stripe provides multiple ways to get your transaction data out. The Dashboard CSV export is the fastest for manual, one-off reports. The API gives you full control over filters, formats, and automation. Balance transactions are the most comprehensive data source — they include payments, refunds, fees, payouts, and adjustments in a single timeline.

Prerequisites

  • A Stripe account with transaction history
  • Node.js 18 or newer installed (for API method)
  • Your Stripe secret key (sk_test_...) from Dashboard → Developers → API keys
  • Access to the Stripe Dashboard with at least read permissions

Step-by-step guide

1

Export via the Stripe Dashboard

Go to Payments in the left sidebar, use the date filter at the top to select your range, then click the Export button (download icon). Choose your columns and format (CSV). Stripe generates the file and emails you a download link for large exports.

Expected result: A CSV file downloads (or a link is emailed) containing payment data for the selected date range.

2

Export balance transactions via API

Use stripe.balanceTransactions.list() to fetch all balance transactions. These include charges, refunds, payouts, fees, and adjustments. Filter by date range using created parameters.

typescript
1const stripe = require('stripe')(process.env.STRIPE_SECRET_KEY);
2
3const transactions = await stripe.balanceTransactions.list({
4 created: {
5 gte: Math.floor(new Date('2025-01-01').getTime() / 1000),
6 lte: Math.floor(new Date('2025-01-31').getTime() / 1000),
7 },
8 limit: 100,
9});
10
11for (const txn of transactions.data) {
12 console.log(
13 txn.id,
14 txn.type,
15 txn.amount / 100,
16 txn.fee / 100,
17 txn.net / 100,
18 txn.currency
19 );
20}

Expected result: A list of balance transactions for January 2025 with amounts, fees, and net values.

3

Paginate through all transactions

For large date ranges, use cursor-based pagination with starting_after to retrieve every transaction.

typescript
1async function exportAllTransactions(startDate, endDate) {
2 const allTransactions = [];
3 let hasMore = true;
4 let startingAfter = undefined;
5
6 while (hasMore) {
7 const batch = await stripe.balanceTransactions.list({
8 created: {
9 gte: Math.floor(new Date(startDate).getTime() / 1000),
10 lte: Math.floor(new Date(endDate).getTime() / 1000),
11 },
12 limit: 100,
13 starting_after: startingAfter,
14 });
15
16 allTransactions.push(...batch.data);
17 hasMore = batch.has_more;
18 if (batch.data.length > 0) {
19 startingAfter = batch.data[batch.data.length - 1].id;
20 }
21 }
22
23 return allTransactions;
24}

Expected result: All transactions for the date range are collected into a single array.

4

Format as CSV for accounting

Convert the transaction data into CSV format for import into accounting tools like QuickBooks, Xero, or Excel.

typescript
1const fs = require('fs');
2
3function transactionsToCSV(transactions) {
4 const header = 'ID,Type,Amount,Fee,Net,Currency,Created\n';
5 const rows = transactions.map((txn) =>
6 [
7 txn.id,
8 txn.type,
9 (txn.amount / 100).toFixed(2),
10 (txn.fee / 100).toFixed(2),
11 (txn.net / 100).toFixed(2),
12 txn.currency,
13 new Date(txn.created * 1000).toISOString(),
14 ].join(',')
15 );
16 return header + rows.join('\n');
17}
18
19const csv = transactionsToCSV(transactions.data);
20fs.writeFileSync('stripe-export.csv', csv);

Expected result: A stripe-export.csv file is written with formatted transaction data.

Complete working example

export-transactions.js
1const fs = require('fs');
2const stripe = require('stripe')(process.env.STRIPE_SECRET_KEY);
3
4async function exportTransactions(startDate, endDate, outputFile) {
5 const allTransactions = [];
6 let hasMore = true;
7 let startingAfter = undefined;
8
9 const gte = Math.floor(new Date(startDate).getTime() / 1000);
10 const lte = Math.floor(new Date(endDate).getTime() / 1000);
11
12 while (hasMore) {
13 const batch = await stripe.balanceTransactions.list({
14 created: { gte, lte },
15 limit: 100,
16 starting_after: startingAfter,
17 });
18
19 allTransactions.push(...batch.data);
20 hasMore = batch.has_more;
21 if (batch.data.length > 0) {
22 startingAfter = batch.data[batch.data.length - 1].id;
23 }
24 }
25
26 // Build CSV
27 const header = 'ID,Type,Description,Amount,Fee,Net,Currency,Created\n';
28 const rows = allTransactions.map((txn) =>
29 [
30 txn.id,
31 txn.type,
32 `"${(txn.description || '').replace(/"/g, '""')}"`,
33 (txn.amount / 100).toFixed(2),
34 (txn.fee / 100).toFixed(2),
35 (txn.net / 100).toFixed(2),
36 txn.currency.toUpperCase(),
37 new Date(txn.created * 1000).toISOString(),
38 ].join(',')
39 );
40
41 fs.writeFileSync(outputFile, header + rows.join('\n'));
42 console.log(`Exported ${allTransactions.length} transactions to ${outputFile}`);
43}
44
45// Usage: export January 2025 transactions
46exportTransactions('2025-01-01', '2025-01-31', 'stripe-jan-2025.csv')
47 .catch(console.error);

Common mistakes when exporting transactions from Stripe

Why it's a problem: Using charges.list instead of balanceTransactions.list for financial reporting

How to avoid: Balance transactions include fees, refunds, and payouts — not just charges. They give you the complete financial picture needed for accounting.

Why it's a problem: Forgetting to paginate and only getting the first 100 results

How to avoid: Always check has_more and use starting_after to paginate. A single list call returns at most 100 items.

Why it's a problem: Not converting timestamps from Unix to human-readable dates

How to avoid: Stripe timestamps are Unix seconds. Use new Date(txn.created * 1000).toISOString() to convert.

Best practices

  • Use balance transactions for accounting — they include fees, refunds, and net amounts in one view
  • Always paginate with starting_after for complete exports, especially for date ranges with many transactions
  • Convert amounts from cents to dollars (divide by 100) before writing to CSV
  • Include the transaction type column to distinguish charges, refunds, payouts, and adjustments
  • Schedule automated exports using a cron job or scheduled serverless function
  • Store exports in a secure location — transaction data contains sensitive financial information
  • Use Stripe's Sigma or Data Pipeline products for complex reporting needs beyond simple CSV exports

Still stuck?

Copy one of these prompts to get a personalized, step-by-step explanation.

ChatGPT Prompt

Write a Node.js script that exports all Stripe balance transactions for a given date range to a CSV file. Include ID, type, amount in dollars, fee, net, currency, and date columns. Handle pagination to get all results.

Stripe Prompt

Create an automated transaction export for my app. Add an endpoint that accepts start and end dates, fetches all Stripe balance transactions in that range with full pagination, and returns a downloadable CSV file.

Frequently asked questions

What data is included in a Stripe transaction export?

Balance transactions include the transaction ID, type (charge, refund, payout, etc.), amount, Stripe fee, net amount, currency, description, and creation date. Dashboard exports may include additional columns like customer email.

How far back can I export transactions?

Stripe retains all transaction data indefinitely. You can export from the very first transaction on your account up to the most recent.

Is there a limit on how many transactions I can export?

The Dashboard CSV export handles up to millions of rows but may take time for large exports. The API has no total limit — just paginate through all results 100 at a time.

Can I automate daily or monthly exports?

Yes. Use the API approach in a cron job or scheduled serverless function. Stripe also offers Data Pipeline as a paid add-on for automatic data syncing to your data warehouse.

What if I need a custom reporting dashboard for my Stripe data?

For businesses that need real-time dashboards, custom metrics, or automated reconciliation with accounting systems, the RapidDev team can build a tailored reporting solution on top of the Stripe API.

Do test mode transactions appear in exports?

Test and live mode data are completely separate. Toggle test mode in the Dashboard before exporting, or use your test secret key (sk_test_) with the API.

RapidDev

Talk to an Expert

Our team has built 600+ apps. Get personalized help with your project.

Book a free consultation

Need help with your project?

Our experts have built 600+ apps and can accelerate your development. Book a free consultation — no strings attached.

Book a free consultation

We put the rapid in RapidDev

Need a dedicated strategic tech and growth partner? Discover what RapidDev can do for your business! Book a call with our team to schedule a free, no-obligation consultation. We'll discuss your project and provide a custom quote at no cost.