Native Accounting Engine

DoorStax includes a full double-entry accounting engine with chart of accounts, journal entries, financial reports, and trust accounting compliance.

Overview

Every financial event in DoorStax (rent payments, expenses, payouts, refunds) automatically creates balanced double-entry journal entries. Nothing is ever deleted — corrections are made via compensating reversals. The ledger is the single source of truth for all financial reporting.

Double-Entry

Every transaction has balanced debits and credits. Validated at the engine level.

Auto-Seeded

35 default chart-of-accounts entries bootstrap on first PM financial event.

Trust Compliant

Trust account balance verification ensures security deposit liability matching.

Chart of Accounts

Each PM gets a default chart of accounts with 35 pre-configured entries across 5 standard account types:

  • Assets (1000-1499) — Operating Bank, Trust Bank, A/R Tenants, A/R Owners, Security Deposit Escrow, Undeposited Funds, Prepaid Expenses
  • Liabilities (2000-2499) — A/P, Security Deposits Held, Owner Funds Payable, Tenant Prepaid Rent, Accrued Expenses
  • Equity (3000-3499) — Owner Equity, Retained Earnings
  • Revenue (4000-4999) — Rent Revenue, Late Fees, Application Fees, Management Fees, Processing Fees, Pet Fees, Parking Income, Laundry Income
  • Expenses (5000-5999) — R&M, Utilities, Insurance, Taxes, Landscaping, Cleaning, Legal, Marketing, Admin, Processing, Bank Fees

Auto-Entry Triggers

Six journal entry templates fire automatically on specific events:

typescript
// Fires when a rent payment is marked COMPLETED
journalRentPayment({
  pmId, paymentId, amount, convenienceFee, date,
  propertyId, tenantId, unitId, ownerId
})
// Creates:
//   DR 1300 Undeposited Funds  (amount + fee)
//   CR 4000 Rent Revenue        (amount)
//   CR 4400 Processing Fee      (fee, if any)

// Fires when a property expense is created
journalExpense({
  pmId, expenseId, amount, date, propertyId, isPaid
})
// Creates:
//   DR 5000 Repairs & Maintenance
//   CR 2000 Accounts Payable  (or 1000 Bank if paid)

// Fires when an owner payout is marked PAID
journalOwnerPayout({
  pmId, payoutId, amount, managementFee, ownerId
})
// Creates:
//   DR 2200 Owner Funds Payable
//   CR 1000 Operating Bank
//   CR 4300 Management Fee Income

All triggers include deduplication guards (by source + sourceId) and auto-seed the chart of accounts on first use. Triggers are non-blocking — accounting errors never fail the primary operation.

API Endpoints

Accounts & Journal Entries

  • GET /api/accounting/accounts — List all accounts (auto-seeds on first call)
  • POST /api/accounting/accounts — Create custom account
  • GET /api/accounting/accounts/[id] — Account detail with recent journal lines
  • PUT /api/accounting/accounts/[id] — Update account
  • GET /api/accounting/journal-entries — List with filters (period, source, type, property)
  • POST /api/accounting/journal-entries — Create manual journal entry (validated)
  • GET /api/accounting/journal-entries/[id] — Full entry with lines
  • POST /api/accounting/journal-entries/[id] — Reverse entry (action: reverse)
  • GET /api/accounting/periods — List all accounting periods
  • POST /api/accounting/periods — Close or lock a period

Financial Reports

  • GET /api/accounting/trial-balance — Balanced check with all accounts
  • GET /api/accounting/reports/profit-loss — P&L with property/owner filters
  • GET /api/accounting/reports/balance-sheet — Assets = Liabilities + Equity at point in time
  • GET /api/accounting/reports/cash-flow — Bank account movements
  • GET /api/accounting/reports/general-ledger — Per-account transaction log with running balance
  • GET /api/accounting/reports/rent-roll — All units with tenant, rent, occupancy
  • GET /api/accounting/trust — Trust account balance verification

Trust Accounting

The trust account verification endpoint ensures your Trust Bank balance (1010) equals the sum of:

  • Security Deposits Held (2100)
  • Owner Funds Payable (2200)
  • Tenant Prepaid Rent (2300)

This is critical for legal compliance in most US states. The API returns a variance flag if the balances don't match.