Skip to content

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

PropertyTypeRequiredDescription
classstringrequiredOne of cash, asset, receivable, liability, equity, revenue, or expense.
heldAtstringOne of payments, cards, treasury, bank, or company (a share of the holding Company’s cash): where a cash Account is held.
balancemoneyComputed on read from Entries; never stored.
pendingmoneyComputed: money on its way in that has not settled yet.
payoutSchedulestringOne of daily, weekly, monthly, or manual: when the payments balance pays out.

Object

JSON
{
  "$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, inverse postsTo.

Verbs

  1. getReturns one Account by id.
    GET /{namespace}/accounts/{id}readNo Event
  2. listReturns Accounts, newest first, one page at a time.
    GET /{namespace}/accountsreadNo Event
  3. payoutPayout sends available cash from the payments balance to the owner’s bank and lists every Transaction the payout carries.
    POST /{namespace}/accounts/{account}/payoutdoAccount.paidOut
  4. sweepSweep 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}/sweepdoAccount.swept

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.

Operationowneradminmemberviewer
Account.getYesYesYesYes
Account.listYesYesYesYes
Account.payoutYesNoNoNo
Account.sweepYesYesYesNo

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.

PropertyStripe fieldSource of truth
balancebalance.cashStripe
pendingbalance.inbound_pendingStripe

Call it

Text
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.