Automated Monthly P&L
Purpose
An automatically-generated monthly profit & loss statement, reconciling internal records against Paddle and hosting costs — not just a dashboard number, an actual reconciled report.
Formula
Revenue: Platform fees collected (from internal platform_fees table)
Costs: Paddle processing fees
+ Hosting/infra costs
+ AI/token costs (AI / Token Usage Tracking)
+ Other SaaS costs (Clerk, monitoring, etc.)
P&L = Revenue − Costs
New Cost Line: Paddle's Own Processing Fees (gap closed 2026-08-04)
Every prior split-math example (Commission Engine, Money Flow) modeled only SellVia's 2% platform fee — Paddle's own processing fee (roughly 2.9% + $0.30 per charge, varies by card/region) was never accounted for anywhere until now. This comes out of SellVia's revenue, not the customer's or merchant's side of the split — actual margin per sale is thinner than the 2% figure alone suggests. This report is where that gets made visible and tracked properly.
Data Sources and Automation Level
| Source | Pulled via | Automation |
|---|---|---|
| Platform fee revenue | Internal platform_fees table | Fully automatic |
| Paddle processing fees | Paddle's Balance Transactions API (fee field per transaction) | Fully automatic |
| Hosting costs | Hosting provider's billing API, where available (e.g. DigitalOcean exposes one; a bare Hetzner box may not cleanly) | Automatic where supported, manual entry fallback otherwise |
| AI/token costs | Internal ai_usage_events table | Fully automatic |
| Other SaaS (Clerk, monitoring, etc.) | Most providers don't expose billing APIs | Manual monthly entry — realistic limitation, not a gap to pretend away |
Process (Celery scheduled job, monthly)
- On the 1st of each month, job runs for the prior month
- Pull Paddle Balance Transactions for the period (revenue + Paddle's fees)
- Reconcile against internal
sales/platform_feesrecords first (extends 05. Payments → Reconciliation — the existing fraud/discrepancy check now also feeds this report) — the P&L should never be built on unreconciled numbers - Pull hosting costs (API where available, manual entry table otherwise)
- Sum AI/token costs from
ai_usage_events - Compute and store the P&L as a row in a new
monthly_pnl_reportstable - Surface in the Admin dashboard (10. Operations → Admin Panel, 11. Analytics → Dashboards)
Manual Cost Entry (for the non-API-able sources)
A simple Admin-only form/table for entering monthly costs that can't be pulled automatically (Clerk subscription, monitoring tools, etc.) — not full automation, but keeps the P&L complete rather than silently missing real costs just because they're harder to fetch programmatically.
Open Questions
- Exact hosting provider choice (Hetzner vs. DigitalOcean, still open per 06. Infrastructure → Hosting Strategy) determines how much of the hosting line can actually be automated — worth weighing billing-API support as a real factor in that decision, not just price/region
- Whether the report needs to be finalized/locked once generated (so historical P&L doesn't silently change if a late-arriving adjustment comes in) — recommend a "finalized" flag with a separate adjustment entry for anything discovered after the fact, rather than editing a closed month in place
Update (2026-08-23): Paddle Removed, Swich Confirmed, Pakistan/PKR Only
Founder decisions, full reasoning in 02. Architecture Decision Log. Every "Paddle" above means Swich now:
- Formula: "Paddle processing fees" → "Swich processing fees." Same principle (a real cost line separate from SellVia's 2% platform fee) — exact rate unconfirmed pending a real Swich signup conversation, so the "roughly 2.9% + $0.30 per charge" figure above is Paddle's, not a verified Swich number; don't carry it forward as an estimate.
- Data source table: "Paddle's Balance Transactions API (
feefield per transaction)" → Swich's equivalent transaction/fee API — exact endpoint unconfirmed. monthly_pnl_reports.paddle_fees_centsis renamedswich_fees_cents(03. Table Specifications, updated same date).- "Other SaaS (Clerk, monitoring, etc.)" — Clerk itself is stale here too, unrelated to this update: auth switched to Ory Kratos back on 2026-08-04 (02. Architecture Decision Log); this line should read "Ory Kratos (if paid tier), monitoring, etc."
- Currency: PKR only, not USD — all figures in this report are PKR.