Stop Paying $20/mo to Clean Sales CSVs: Building a CSP-Locked Offline Converter for Gumroad, Stripe & Patreon
DEV Community

Stop Paying $20/mo to Clean Sales CSVs: Building a CSP-Locked Offline Converter for Gumroad, Stripe & Patreon

If you sell digital products across Gumroad, Stripe, Patreon, and Etsy, bookkeeping at tax time is weirdly painful. You usually end up choosing between:

  • Paying $15-$30/month forever for a SaaS bookkeeping connector just to import a few dozen monthly rows.
  • Wrestling with broken Excel formulas every quarter - or uploading private revenue exports to random online CSV tools.

So I built CreatorCSV Local: a zero-dependency, single-file HTML tool locked down with Content-Security-Policy: default-src 'none' that reconciles multi-platform creator sales CSVs completely offline and exports ready-to-import CSVs for QuickBooks Online, Xero, and Wave.

You can test the live browser-local Gumroad demo right now (no signup, zero network calls): Live 1-Click Offline Demo (GitHub Pages)

Here are the four real-world bookkeeping edge cases I had to handle in pure JavaScript while building it.

1. The Stripe Balance CSV "Double-Counting" Trap

If you export Balance Transactions from Stripe and blindly sum the Amount column, your accounting software will end up completely wrong - because Stripe mixes customer charges and bank transfer payout rows in the same CSV! A bank payout is an internal balance transfer, not negative revenue.

Excluding rows where Type === "payout" (and surfacing a clear warning count so the user can audit what was filtered) prevents silent double-counting:

for (let i = 0; i < rows.length; i++) {
  const r = rows[i];
  const txType = typeCol ? String(r[typeCol] || "").toLowerCase() : "";
  // Stripe balance transactions include bank payouts (transfers, not revenue)
  if (txType === "payout") {
    payoutSkipped += 1;
    continue;
  }
  const gross = parseNumber(grossCol ? r[grossCol] : 0);
  const fee = Math.abs(parseNumber(feeCol ? r[feeCol] : 0));
  const net = netCol && r[netCol] !== "" ? parseNumber(r[netCol]) : gross - fee;
  // ...
}

Similarly, on Gumroad, refunded purchases can still show a positive Price ($) while carrying Refunded = true. Catching that flag explicitly avoids overstating gross sales:

const refunded = refundedCol && /^(true|yes|1)$/i.test(String(r[refundedCol] || "").trim());
if (refunded && gross > 0) {
  warnings.push(`Gumroad row ${i + 2} is flagged Refunded=true; excluded as $0 net revenue.`);
}

2. Historical FX Conversion on Weekends & Bank Holidays

When a customer buys your product in EUR or GBP on a Sunday, official central-bank daily FX tables don't have a row for that date. A clean offline pattern is to look up the exact ISO date first, and if missing, walk backward up to 10 calendar days to pick up the previous business day's rate - while recording the exact rate source (FX prev-day(2026-02-10)) in the exported ledger so your CPA can verify every single row:

export function lookupFxRate(dateIso, fromCurrency, fxConfig = {}) {
  const base = String(fxConfig.baseCurrency || "USD").toUpperCase();
  const cur = String(fromCurrency || base).toUpperCase();
  if (cur === base) return { rate: 1, source: base };
  const table = fxConfig.fxRates && fxConfig.fxRates[cur];
  if (table && table.size > 0 && /^\d{4}-\d{2}-\d{2}$/.test(dateIso)) {
    if (table.has(dateIso)) return { rate: table.get(dateIso), source: `FX(${dateIso})` };
    const [y, m, d] = dateIso.split("-").map(Number);
    const dt = new Date(Date.UTC(y, m - 1, d));
    for (let offset = 1; offset <= 10; offset++) {
      const prev = new Date(dt.getTime() - offset * 86400000);
      const key = `${prev.getUTCFullYear()}-${String(prev.getUTCMonth() + 1).padStart(2, "0")}-${String(prev.getUTCDate()).padStart(2, "0")}`;
      if (table.has(key)) return { rate: table.get(key), source: `FX prev-day(${key})` };
    }
  }
  // Falls back to user-configured fixed rates if no FX CSV is uploaded
  // ...
}

3. QuickBooks vs. Xero vs. Wave: Subtle CSV Format Differences

Even after splitting Gross Revenue and Platform Fees into separate accounting lines (so you don't accidentally book net payout as gross income), each major accounting app expects a different CSV dialect.

Software Expected Header Date Format Sign Convention QuickBooks Online (4-col) Date,Description,Credit,Debit MM/DD/YYYY Positive in Credit, fees in Debit Xero Bank Statement *Date,*Amount,Payee,Description,Reference,Cheque Number YYYY-MM-DD Signed *Amount (fees negative) Wave Accounting Date,Description,Amount YYYY-MM-DD Signed Amount (fees negative)

Generating all three (plus a full audit ledger with FX sources) from a single normalized buildAccountingLines() pipeline keeps totals reconciled to the cent across every export.

4. Locking Financial Data Locally with CSP: default-src 'none'

Revenue CSVs contain customer emails, order IDs, and income figures. Rather than asking creators to trust a backend privacy policy, the entire app is compiled into one static HTML file with:

<meta http-equiv="Content-Security-Policy" content="default-src 'none'; script-src 'unsafe-inline'; style-src 'unsafe-inline'; img-src data:; base-uri 'none'; form-action 'none';" >

The browser itself blocks every network request - no fetch, no XMLHttpRequest, no third-party CDN, no analytics beacons. Double-click the .html file on Windows, macOS, or Linux in airplane mode and it works identically.

Try the Free Demo

(Full disclosure: The live demo handles Gumroad sales CSVs for free. If you also need Patreon, Stripe payout deduplication, Etsy, a Universal Custom Column Mapper for Ko-fi/Lemon Squeezy, Multi-Currency historical FX CSVs, and 1-click QuickBooks/Xero/Wave exports in a downloadable offline .html file, CreatorCSV Local Pro is available for a one-time $29 on Gumroad. Disclaimer: This is strictly a local CSV formatting utility, not tax or accounting advice. Parts of the drafting and test scaffolding were assisted by AI tools and verified with automated tests.)

Which platform's sales CSV has given you the biggest headache at tax time? Drop it in the comments - I'm always looking for weird CSV edge cases to handle cleanly!

Read on DEV Community ↗ ← Back to News

Comments

No comments yet. Start the discussion.