Ledger & settlement
The operator's view of the monetary ledger — chart of accounts, holds, reconciliation, and what a settlement problem looks like.
The operator's view of the monetary ledger — chart of accounts, holds, reconciliation, and what a settlement problem looks like.
Every monetary fact on the platform is a balanced ledger posting in nanodollars. Funding buckets, amount due, and the bill preview are views of the ledger, reconciled against it on a schedule. Stripe is the settlement rail: it collects and pays out, and its webhooks are idempotent ledger inputs — never direct balance mutations. Core is the single monetary writer for a subject.
| Account | Class | Meaning |
|---|---|---|
CashClearing | asset | Gross funds the rail has confirmed collected, less confirmed refunds or payouts. |
PrepaidLiability | liability | Rated-value obligation represented by every live bucket (prepaid, included, promo, referral). |
IncludedAllowanceContra | contra-revenue | Cost of included value a plan issued; unused expiry credits it back. |
PromoContra | contra-revenue | Cost of promotional value issued. |
ReferralContra | contra-revenue | Cost of referral value issued. |
UsageRevenue | revenue | Rated usage recognized from RatedCharge rows; prepaid breakage posts here with role BREAKAGE. |
RecurringRevenue | revenue | Recurring plan fees. |
RoundingDifference | contra / expense | Customer-favorable value dropped by rating-floor or settlement-quantum flooring. |
SettlementReceivable(rail) | asset | Exact amount due through a named rail after funding. |
TaxPayable(rail) | liability | Tax the rail collected and must remit; never rewrites local revenue. |
RefundsPayable | liability | Cash-backed value approved for return, not yet confirmed paid. |
WriteOff | expense | Uncollectible receivables, expired non-cash funding on refund, final dispute loss. |
One template per event type; every transaction balances to zero:
UsageRevenue.pending → available: the bucket is created pending on
checkout, funded (CashClearing ↔ PrepaidLiability) when the rail confirms
payment.RefundsPayable, non-cash restored if unexpired else WriteOff; a rail
payout later debits RefundsPayable, credits CashClearing.RoundingDifference.Rating corrections (late measurements, volume-tier reselection at window close) are correction transactions on the closed window, not refunds.
Scheduled reconciliation asserts, and alerts on:
sum(bucket balances) == ledger liability per subject and source kind;sum(RatedCharge) == revenue + contra postings;settlements × quantum;Nothing edits historical postings to make a predicate pass. Corrections are explicit balanced transactions after the discrepancy is understood.
| State | Scope | Effect | Cleared by |
|---|---|---|---|
SettlementAccount.state = RECONCILIATION_REQUIRED | one subject | Monetary admission denied for that subject; rating continues. | Scheduled reconciliation proving ledger, buckets, expected rail operations, and Stripe agree. |
SettlementHold(reason) | one rating window or event | Export for that window blocked; unrelated rating and admission continue. | The reason-specific reconciler (admission_bound_breached, accounting_divergence, quarantine, …). |
Triggers for RECONCILIATION_REQUIRED: a rail-initiated refund, dispute, or
early-fraud warning matching no expected local operation; a top-up success
after cancellation; a Stripe invoice that does not match its local export;
bucket/liability or rail/cash divergence.
Sequence gaps in the usage pipeline hold settlement, never rating: a quarantined event writes a terminal record that closes its hole; late events are correction transactions.
Stripe never rates usage, chooses funding, owns a balance, or mutates a bucket.
No subscriber balance and no meter lives in Stripe. invoice.upcoming is
never a monetary input. Only one webhook family is authoritative for each
transition (Checkout success for top-ups, invoice.paid for cash receipt,
refund.* for payouts, charge.dispute.* for disputes).
farthershore usage summary <business> and the
dashboard's usage and plans views (catalog and release, never subscriber
bills).Continue with Diagnose billing and usage.