Account
An Account is a ledger account in a Startup’s chart of accounts; a cash Account is held at one place, such as Treasury.
Properties
| Property | Type | Required | Description |
|---|---|---|---|
class | string | required | One of cash, asset, receivable, liability, equity, revenue, or expense. |
heldAt | string | One of payments, cards, treasury, bank, or company (a share of the holding Company’s cash): where a cash Account is held. | |
balance | money | Computed on read from Entries; never stored. | |
pending | money | Computed: money on its way in that has not settled yet. | |
payoutSchedule | string | One of daily, weekly, monthly, or manual: when the payments balance pays out. |
Object
{
"$id": "https: //api.sb/ routewise.dev/ accounts/ account_1",
"$type": "Account",
"class": "cash",
"heldAt": "payments",
"balance": {
"amount": 25,
"currency": "USD"
},
"pending": {
"amount": 25,
"currency": "USD"
},
"payoutSchedule": "daily"
}Relationships
- An Account has many Entries: each Entry posts to one Account, and an Account’s balance is the sum of its Entries.
entries, inversepostsTo.
Verbs
getReturns one Account by id.GET /{namespace}/accounts/{id}listReturns Accounts, newest first, one page at a time.GET /{namespace}/accountspayoutPayout sends available cash from the payments balance to the owner’s bank and lists every Transaction the payout carries.POST /{namespace}/accounts/{account}/payoutsweepSweep moves cash between two cash Accounts of the same owner, once or on a standing rule, within the Treasurer’s Limit.POST /{namespace}/accounts/{from}/sweep
An Account is kept forever and never edited: it has no update or delete.
Permissions
Which Access level may call each Verb. One-way Verbs wait their delay window.
| Operation | owner | admin | member | viewer |
|---|---|---|---|---|
Account.get | Yes | Yes | Yes | Yes |
Account.list | Yes | Yes | Yes | Yes |
Account.payout | Yes | No | No | No |
Account.sweep | Yes | Yes | Yes | No |
Stripe
Treasury FinancialAccount (treasury.financial_account), for an Account whose heldAt is treasury. The source of truth is Stripe: db.sb mirrors it, written only from Stripe’s webhooks.
| Property | Stripe field | Source of truth |
|---|---|---|
balance | balance.cash | Stripe |
pending | balance.inbound_pending | Stripe |
Call it
Sweep my account.Example
A tutoring Startup keeps $3,000 of reserve cash in an Account of class cash held at treasury. Its balance is the sum of the Entries posted to it, and each week the Treasurer checks it against the figure Stripe reports.