# Account

URL: /business/nouns/account · Id: `noun: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.

An Account is a ledger account in a [Startup](/business/nouns/startup)’s chart of accounts; a cash Account is held at one place, such as Treasury.

## Properties
| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `class` | `string` | Yes | One of `cash`, `asset`, `receivable`, `liability`, `equity`, `revenue`, or `expense`. |
| `heldAt` | `string` | No | One of `payments`, `cards`, `treasury`, `bank`, or `company` (a share of the holding Company’s cash): where a cash Account is held. |
| `balance` | `money` | No | Computed on read from Entries; never stored. |
| `pending` | `money` | No | Computed: money on its way in that has not settled yet. |
| `payoutSchedule` | `string` | No | One 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
- <a id="rel-entries"></a>An Account **has** many [Entries](/business/nouns/entry): each [Entry](/business/nouns/entry) posts to one Account, and an Account’s balance is the sum of its Entries. `entries`, inverse [`postsTo`](/business/nouns/entry#rel-posts-to).

## Verbs
| Verb | Description | Subject | Event | Class |
| --- | --- | --- | --- | --- |
| [Account.payout](/business/nouns/account/payout) | Payout sends available cash from the payments balance to the owner’s bank and lists every Transaction the payout carries. | [Treasurer](/agents/finance/treasurer) | [`Account.paidOut`](/business/events/Account.paidOut) | One-way (money): `send`, `do` |
| [Account.sweep](/business/nouns/account/sweep) | Sweep moves cash between two cash Accounts of the same owner, once or on a standing rule, within the Treasurer’s Limit. | [Treasurer](/agents/finance/treasurer) | [`Account.swept`](/business/events/Account.swept) | Two-way: `try`, `send`, `do` |
| <a id="get"></a>[Account.get](/business/nouns/account/get) | Returns one Account by id. Inherited from [Noun](/business/nouns/noun). | None. | None. | Read: `try`, `do` |
| <a id="list"></a>[Account.list](/business/nouns/account/list) | Returns Accounts, newest first, one page at a time. Inherited from [Noun](/business/nouns/noun). | None. | None. | Read: `try`, `do` |

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

**Ask**

```text
Sweep my account.
```

**API**

```bash
curl -X POST https://api.sb/ledgerlark.com/accounts/account_1/sweep \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"to":"account_1"}'
```

```json
{
  "api": "https://api.sb/ledgerlark.com",
  "account": {
    "$id": "https://api.sb/ledgerlark.com/accounts/account_1",
    "$type": "Account",
    "class": "cash"
  },
  "transaction": {
    "$id": "https://api.sb/ledgerlark.com/transactions/transaction_1",
    "$type": "Transaction",
    "kind": "charge",
    "amount": {
      "amount": 400,
      "currency": "USD"
    }
  },
  "action": {
    "$id": "https://api.sb/ledgerlark.com/actions/action_1",
    "operation": "Account.sweep",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/ledgerlark.com/actions/action_1"
  }
}
```

**SDK**

```ts
import { $ } from 'startup-builder'

const { account, transaction } = await $.Account.sweep({ from: 'account_1', to: 'account_1' })
```

**CLI**

```bash
npx startup-builder do Account.sweep --json '{"from":"account_1","to":"account_1"}'
```

**MCP**

```json
{
  "name": "do",
  "arguments": {
    "code": "return await $.Account.sweep({ from: 'account_1', to: 'account_1' })"
  }
}
```

## 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](/business/nouns/entry) posted to it, and each week the [Treasurer](/agents/finance/treasurer) checks it against the figure Stripe reports.