# Budget

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

> A Budget is the amount a Startup plans to spend or earn on one account in one Period, read against actual Entries.

A Budget is the amount a [Startup](/business/nouns/startup) plans to spend or earn on one account in one [Period](/business/nouns/period), read against actual [Entries](/business/nouns/entry).

## Properties
| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `account` | `string` | Yes | The chart-of-accounts code it plans, such as `expense.ads`. |
| `period` | [Period](/business/nouns/period) | Yes | The Period it plans. |
| `amount` | `money` | Yes | The amount set for the account in the Period. |
| `actual` | `money` | No | What the Entries in the Period add up to so far. |

## Object
```json
{
  "$id": "https://api.sb/patentpad.com/budgets/budget_1",
  "$type": "Budget",
  "account": "expense.ads",
  "period": "period_1",
  "amount": {
    "amount": 499,
    "currency": "USD"
  },
  "actual": {
    "amount": 499,
    "currency": "USD"
  }
}
```

## Relationships
- <a id="rel-plans"></a>A Budget **plans** one [Period](/business/nouns/period): a Budget plans one [Period](/business/nouns/period), read beside the actual [Entries](/business/nouns/entry) that fall in it. `plans`, inverse [`budgets`](/business/nouns/period#rel-budgets).

## Verbs
| Verb | Description | Subject | Event | Class |
| --- | --- | --- | --- | --- |
| <a id="create"></a>[Budget.create](/business/nouns/budget/create) | Creates a Budget. Inherited from [Noun](/business/nouns/noun). | None. | `Budget.created` | Two-way: `try`, `send`, `do` |
| <a id="get"></a>[Budget.get](/business/nouns/budget/get) | Returns one Budget by id. Inherited from [Noun](/business/nouns/noun). | None. | None. | Read: `try`, `do` |
| <a id="list"></a>[Budget.list](/business/nouns/budget/list) | Returns Budgets, newest first, one page at a time. Inherited from [Noun](/business/nouns/noun). | None. | None. | Read: `try`, `do` |
| <a id="update"></a>[Budget.update](/business/nouns/budget/update) | Changes the given properties of a Budget. Inherited from [Noun](/business/nouns/noun). | None. | `Budget.updated` | Two-way: `try`, `send`, `do` |
| <a id="delete"></a>[Budget.delete](/business/nouns/budget/delete) | Deletes a Budget; its history is kept. Inherited from [Noun](/business/nouns/noun). | None. | `Budget.deleted` | One-way: `send`, `do` |

## Permissions
Which Access level may call each Verb. One-way Verbs wait their delay window.

| Operation | `owner` | `admin` | `member` | `viewer` |
| --- | --- | --- | --- | --- |
| `Budget.create` | Yes | Yes | Yes | No |
| `Budget.get` | Yes | Yes | Yes | Yes |
| `Budget.list` | Yes | Yes | Yes | Yes |
| `Budget.update` | Yes | Yes | Yes | No |
| `Budget.delete` | Yes | Yes | Yes | No |

## Call it

**Ask**

```text
Add a budget to ShiftNote with a period.
```

**API**

```bash
curl -X POST https://api.sb/shiftnote.app/budgets \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"account":"expense.ads","period":"period_1","amount":{"amount":79,"currency":"USD"}}'
```

```json
{
  "api": "https://api.sb/shiftnote.app",
  "budget": {
    "$id": "https://api.sb/shiftnote.app/budgets/budget_1",
    "$type": "Budget",
    "account": "expense.ads",
    "period": "period_1",
    "amount": {
      "amount": 79,
      "currency": "USD"
    }
  },
  "action": {
    "$id": "https://api.sb/shiftnote.app/actions/action_1",
    "operation": "Budget.create",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/shiftnote.app/actions/action_1"
  }
}
```

**SDK**

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

const budget = await $.Budget.create({ account: 'expense.ads', period: 'period_1', amount: { amount: 79, currency: 'USD' } })
```

**CLI**

```bash
npx startup-builder do Budget.create --json '{"account":"expense.ads","period":"period_1","amount":{"amount":79,"currency":"USD"}}'
```

**MCP**

```json
{
  "name": "do",
  "arguments": {
    "code": "return await $.Budget.create({ account: 'expense.ads', period: 'period_1', amount: { amount: 79, currency: 'USD' } })"
  }
}
```

## Example
A tutoring marketplace sets a $4,000 Budget on `expense.ads` for one month. By the 18th its [Entries](/business/nouns/entry) add up to $3,100, so `actual` reads $3,100 and the remaining $900 bounds the month's ad spend.