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.
- Posting date is in an open accounting period
- Company is active and not in lockdown
- All referenced accounts exist
- All accounts allow the posting type (e.g. expense accounts cannot receive a credit-only posting in some configurations)
- Debit total equals credit total exactly (Decimal arithmetic, no float comparison)
- Currency is the company’s functional currency or has a valid exchange rate row
- Cost center references resolve
- Project references resolve
- Tax codes resolve
- Reference document exists if specified
- No conflicting concurrent transaction (FK and uniqueness checks)
- Final balance check after the write (running totals stay consistent)
The pipeline runs inside a single SQLite transaction with BEGIN ... COMMIT. 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, typically months or quarters, are closed when you say so.
“Close Q1.”
Once closed, no further postings to that period are allowed. The pipeline’s step 1 catches them. Re-opening is rare and usually an auditor finding.
“Reopen Q1, the auditor found an adjustment.”
The reopen requires an explicit reason and is logged.
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, general ledger by account, and the journal register.
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>
close-accounting-period period="2026-Q1" reason="Q1 close"
reopen-accounting-period period="2026-Q1" reason="auditor adjustment"
trial-balance / balance-sheet / profit-and-loss / cash-flow-statement
ar-aging / ap-aging / gl-by-account / journal-register