On The Ledger logo

The source of truth for modern financial systems

About How It Works

Guide

E-commerce

Handle orders, refunds, fees, payouts to merchants, and (optionally) inventory and COGS.

What is double-entry?

Double-entry keeps every money movement balanced: for every debit there’s a credit, and totals always match. Instead of one running total, you use multiple accounts (cash, revenue, payables, etc.) to show where money came from and where it went.

Why multiple accounts? They give clarity: cash up or down, revenue earned, liabilities owed, equity changing. Balancing debits and credits means you can trust the ledger—errors show up immediately, and you can prove history to teammates and auditors.

For a deeper dive, see Investopedia: Double-Entry Accounting.

Core accounts to set up

  • Cash / Processor Clearing (asset)
  • Accounts Receivable (asset) — if invoicing
  • Sales Revenue (income)
  • Sales Returns / Refunds (income contra)
  • Processor / Platform Fees (expense)
  • Payable to Merchant (liability) — if you remit to sellers
  • Inventory (asset) and COGS (expense) — optional if tracking stock

Examples

Order paid

Customer pays at checkout; processor holds cash briefly.

  • Debit Cash / Processor Clearing
  • Credit Sales Revenue

Processor/platform fee

Your cost or your platform fee.

  • Debit Processor Fees (expense)
  • Credit Cash / Processor Clearing

Payout to merchant

Remit collected funds.

  • Debit Payable to Merchant (liability)
  • Credit Cash / Processor Clearing

If you track the payable at order time, credit Payable to Merchant when the order is captured.

Refund to customer

Reverse part or all of a sale.

  • Debit Sales Returns (contra revenue) or Sales Revenue
  • Credit Cash / Processor Clearing

Reverse associated fees if applicable (Debit Fee Revenue or Credit Processor Fees).

Inventory + COGS (optional)

Record cost of goods when an order ships.

  • Debit COGS
  • Credit Inventory

On refund/return: Debit Inventory (if restocked), Credit COGS.

Gift card issued (liability)

Unredeemed value you owe.

  • Debit Cash
  • Credit Gift Card Liability

On redemption: Debit Gift Card Liability, Credit Revenue.

Checklist

  • Separate processor clearing from cash if funds settle later.
  • Track payables to merchants if you are a marketplace; they should reconcile to settlements.
  • For refunds, reverse both revenue and related fees/COGS as appropriate.