Skip to main content
More Core documentation

Accounting basics in ERPClaw

How the chart of accounts, journal entries, and GL posting work in ERPClaw. Double-entry, immutable submitted entries, the 12-step validation pipeline.

ERPClaw is a double-entry accounting system at its core. Every business document (invoice, payment, payroll run, stock transfer, payout) eventually produces general-ledger entries. This page covers the data model and the rules.

Chart of accounts

The default install seeds a US-style chart of accounts with 94 accounts grouped by type:

  • Assets: 1000-1999 (cash, AR, inventory, fixed assets)
  • Liabilities: 2000-2999 (AP, accrued expenses, payroll liabilities, deferred revenue)
  • Equity: 3000-3999 (retained earnings, common stock, owner draws)
  • Revenue: 4000-4999 (sales, service, other income)
  • Expenses: 5000-9999 (COGS, payroll, rent, utilities, depreciation, etc.)

You can customise the chart at any time.

“Add a Marketing expense account, number 5500.”

“Rename it to Paid Marketing.”

The chart supports parent-child hierarchy (so subtotals roll up cleanly) and multi-company (each company has its own set of accounts). Account numbers are unique per company.

Journal entries

A journal entry is a set of debits and credits that must balance. Total debits must equal total credits.

“Post 1,000 dollars of cash against sales, dated 15 April.”

Submitting runs the 12-step validation pipeline (see below). On success the entry is locked. There is no update-journal-entry after submit. To correct a mistake, post a reversing entry. Immutability after submit is the rule.

The 12-step validation pipeline

Every GL posting passes through this pipeline before it commits. Any failure rolls back the entire transaction; partial writes are impossible.

  1. Debit total equals credit total exactly (Decimal arithmetic, no float comparison)
  2. Every account exists, is a posting (not group) account, and is not disabled
  3. Every account belongs to the company being posted to
  4. No account is frozen
  5. Receivable lines name a customer; payable lines name a supplier or employee
  6. Income and expense lines carry a cost center
  7. Opening entries use balance sheet accounts only
  8. Cost centers exist, are not groups, and belong to the company
  9. The posting date falls in an open fiscal year
  10. The posting date is after the company’s accounts freeze date (unless your role is allowed to post there)
  11. Zero-amount lines are dropped, and what remains must still balance
  12. Budget check: a posting that exceeds a budget warns or stops, depending on how the budget is set

The pipeline runs inside a single database transaction (SQLite or PostgreSQL). If any step fails, the transaction rolls back and you get a clean JSON error.

How invoices post to GL

When you submit a sales invoice, the GL posting is automatic. A $1,000 invoice for one item in inventory posts like this.

Account Debit Credit
Accounts Receivable $1,000.00
Sales Revenue $1,000.00
Cost of Goods Sold $400.00
Inventory $400.00

ERPClaw handles the COGS posting automatically based on the item’s costing method (FIFO or weighted average). The invoice voucher links to the four GL entries, so audit trail is one click.

You can name products the way you would say them out loud. Ask to “invoice 20 Brake Pad Sets” and ERPClaw resolves the loose, plural phrasing to the stored product (“Brake Pad Set”), so you do not have to match the exact name on file.

When the customer pays, the second pair of entries follows.

Account Debit Credit
Cash $1,000.00
Accounts Receivable $1,000.00

The AR balance reduces. The trial balance stays balanced. Recording the payment also marks the invoice paid and clears its outstanding balance, so the invoice no longer shows as owing.

Closing a period

Periods are closed when you say so. For a month or quarter, set the accounts freeze date; for the year, close the fiscal year, which posts the closing entry to retained earnings.

“Freeze the books through 31 March.”

“Close fiscal year 2025.”

After that, postings dated inside the frozen or closed range are refused (steps 9 and 10 of the pipeline). Re-opening is rare and usually an auditor finding.

“Reopen fiscal year 2025, the auditor found an adjustment.”

Reopening reverses the closing entry and is written to the audit log.

Multi-currency

ERPClaw supports multi-currency. Each company has a functional currency (the currency the books are kept in). Foreign-currency invoices and payments stay in the transaction currency end to end; the books reflect the actual currency the transaction occurred in. See the multi-currency plan for the current rollout state.

Reports

Ask for any of these by name: trial balance, balance sheet, profit and loss, cash flow statement, AR aging, AP aging, the general ledger (filtered by account if you like), and the list of journal entries.

All reports are exact down to the cent (Decimal arithmetic, no float rounding errors).

What is next

  • Purchasing, purchase orders, goods receipt, vendor invoices, payments.
  • Install guide, get to a working ERPClaw in 5 minutes.
  • Stripe docs, payment integration that posts directly to your GL.

Reference: the actions behind this page

You never have to type these. They are what ERPClaw runs when you ask, and they are here for anyone calling the API or MCP surface directly, or reading a log.

add-account name="Marketing" parent="Expenses" account_number=5500
update-account id=<id> name="Paid Marketing"
list-accounts
add-journal-entry posting_date=2026-04-15 entries='[
  {"account": "Cash", "debit": 1000.00},
  {"account": "Sales", "credit": 1000.00}
]'
submit-journal-entry id=<id>
update-company id=<id> accounts_frozen_till_date=2026-03-31
close-fiscal-year fiscal_year_id=<id> closing_account_id=<retained earnings> posting_date=2025-12-31
reopen-fiscal-year fiscal_year_id=<id>
trial-balance / balance-sheet / profit-and-loss / cash-flow
ar-aging / ap-aging / general-ledger account_id=<id> / list-journal-entries