# Entry

URL: /business/nouns/entry · Id: `noun:entry`

> An Entry is one line of a double-entry posting: an amount to one account in the chart of accounts, caused by one Event.

An Entry is one line of a double-entry posting: an amount to one account in the chart of accounts, caused by one [Event](/business/nouns/event).

## Properties
| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `account` | `string` | Yes | The code of the account in the chart of accounts, such as revenue or cash. |
| `amount` | `money` | Yes | The amount and currency. |
| `direction` | `string` | Yes | One of `debit` or `credit`. |
| `startup` | [Startup](/business/nouns/startup) | Yes | The Startup whose books the Entry belongs to. |
| `counterparty` | [Startup](/business/nouns/startup) | No | The sibling Startup on the other side of an intercompany Entry; empty for outside parties. |

## Object
```json
{
  "$id": "https://api.sb/tutorloop.com/entries/entry_1",
  "$type": "Entry",
  "account": "cash",
  "amount": {
    "amount": 60,
    "currency": "USD"
  },
  "direction": "debit",
  "startup": "startup_1",
  "counterparty": "startup_1"
}
```

## Relationships
- <a id="rel-caused-by"></a>An Entry **is caused by** one [Event](/business/nouns/event): every ledger Entry traces to the one [Event](/business/nouns/event) that caused it, such as `Order.paid`. `causedBy`, inverse [`causes`](/business/nouns/event#rel-causes).
- <a id="rel-falls-in"></a>An Entry **falls in** one [Period](/business/nouns/period): an Entry posts to the month its [Event](/business/nouns/event) happened; closing the [Period](/business/nouns/period) locks it. `fallsIn`, inverse [`entries`](/business/nouns/period#rel-entries).
- <a id="rel-posts-to"></a>An Entry **posts to** one [Account](/business/nouns/account): each Entry posts to one [Account](/business/nouns/account), and an Account’s balance is the sum of its Entries. `postsTo`, inverse [`entries`](/business/nouns/account#rel-entries).
- <a id="rel-reconciled-by"></a>An Entry **is reconciled by** many [Transactions](/business/nouns/transaction): the ledger Entries the [Transaction](/business/nouns/transaction) settles, matched during reconciliation. `reconciledBy`, inverse [`reconciles`](/business/nouns/transaction#rel-reconciles).

## Verbs
| Verb | Description | Subject | Event | Class |
| --- | --- | --- | --- | --- |
| [Entry.post](/business/nouns/entry/post) | Post records a manual Entry pair that no Verb caused, once a second Role approves it. | [Finance Lead](/agents/finance/finance-lead) | [`Entry.posted`](/business/events/Entry.posted) | One-way: `send`, `do` |
| [Entry.settle](/business/nouns/entry/settle) | Settle nets a Period’s intercompany Entries between two Companies into one transfer through Stripe and reconciles both sides. | [Treasurer](/agents/finance/treasurer) | [`Entry.settled`](/business/events/Entry.settled) | One-way (money): `send`, `do` |
| <a id="get"></a>[Entry.get](/business/nouns/entry/get) | Returns one Entry by id. Inherited from [Noun](/business/nouns/noun). | None. | None. | Read: `try`, `do` |
| <a id="list"></a>[Entry.list](/business/nouns/entry/list) | Returns Entries, newest first, one page at a time. Inherited from [Noun](/business/nouns/noun). | None. | None. | Read: `try`, `do` |

An Entry 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` |
| --- | --- | --- | --- | --- |
| `Entry.get` | Yes | Yes | Yes | Yes |
| `Entry.list` | Yes | Yes | Yes | Yes |
| `Entry.post` | Yes | No | No | No |
| `Entry.settle` | Yes | No | No | No |

## Call it

**Ask**

```text
Post the latest entry.
```

**API**

```bash
curl -X POST https://api.sb/kilnbakery.com/entries/post \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"debit":"Example debit","credit":"Example credit","amount":{"amount":9,"currency":"USD"},"memo":"Example memo"}'
```

```json
{
  "api": "https://api.sb/kilnbakery.com",
  "entry": {
    "$id": "https://api.sb/kilnbakery.com/entries/entry_1",
    "$type": "Entry",
    "account": "cash",
    "amount": {
      "amount": 9,
      "currency": "USD"
    },
    "direction": "debit",
    "startup": "startup_1"
  },
  "action": {
    "$id": "https://api.sb/kilnbakery.com/actions/action_1",
    "operation": "Entry.post",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/kilnbakery.com/actions/action_1"
  }
}
```

**SDK**

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

const entry = await $.Entry.post({ debit: 'Example debit', credit: 'Example credit', amount: { amount: 9, currency: 'USD' }, memo: 'Example memo' })
```

**CLI**

```bash
npx startup-builder do Entry.post --json '{"debit":"Example debit","credit":"Example credit","amount":{"amount":9,"currency":"USD"},"memo":"Example memo"}'
```

**MCP**

```json
{
  "name": "do",
  "arguments": {
    "code": "return await $.Entry.post({ debit: 'Example debit', credit: 'Example credit', amount: { amount: 9, currency: 'USD' }, memo: 'Example memo' })"
  }
}
```

## Example
A $49 payment posts two Entries: $49 to cash and $49 to revenue. The `Invoice.paid` Event causes both.