# settle

URL: /business/nouns/entry/settle · Id: `verb:Entry.settle` · Call: `await $.Entry.settle({ … })` (SDK) or the `do` tool at `https://api.sb/mcp`. Inputs says what to pass, Outputs what returns, When it waits who approves.

> Settle nets a Period’s intercompany Entries between two Companies into one transfer through Stripe and reconciles both sides.

Settle nets a [Period](/business/nouns/period)’s intercompany [Entries](/business/nouns/entry) between two [Companies](/business/nouns/company) into one transfer through Stripe and reconciles both sides.

## Inputs
| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `period` | [Period](/business/nouns/period) | Yes | The closed Period whose intercompany pairs settle. |
| `from` | [Company](/business/nouns/company) | Yes | The Company that owes the net amount. |
| `to` | [Company](/business/nouns/company) | Yes | The Company that receives it. |

## Outputs
| Output | Type | Required | Description |
| --- | --- | --- | --- |
| `transaction` | [Transaction](/business/nouns/transaction) | Yes | The one transfer that settles every pair. |
| `entry` | [Entry](/business/nouns/entry) | Yes | The intercompany Entry, now settled. |

## Effects
- Emits [`Entry.settled`](/business/events/Entry.settled).
- Performed by the [Treasurer](/agents/finance/treasurer).
- One-way (money): it waits out its delay window, and runs in the `send` and `do` modes.
- Runs monthly, once both Companies have closed the Period.
- Links every settled pair to the Transaction that settled it.

## Refuses when
| Check | Error | Fix | Then call |
| --- | --- | --- | --- |
| The key is valid, but its scopes do not allow this operation. | [`forbidden`](/code/api/errors/forbidden) | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | [Entry.settle](/business/nouns/entry/settle) |

## When it waits
| Gate | Default |
| --- | --- |
| Decision class | Medium: one-way, bounded (money) |
| [Delay window](/systems/trust-and-governance/controls/one-way-windows) | 1 business hour, in which a watcher can pause, redirect or cancel it; then it runs. |
| Limit | The spend [Limit](/business/nouns/limit) of the [Permission](/business/nouns/permission) or [Mandate](/business/nouns/mandate) it runs under. |
| Over the Limit | It waits `pending` for an [Approval](/business/nouns/approval) from the [Founder](/agents/founding/founder). Approved, it runs; refused, it ends `refused` with [`limit-exceeded`](/code/api/errors/limit-exceeded); unanswered by its deadline, it ends `canceled`. |

## Example

**Ask**

```text
Settle the latest entry with a period and a company and a company.
```

**API**

```bash
curl -X POST https://api.sb/patentpad.com/entries/settle \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"period":"period_1","from":"company_1","to":"company_1"}'
```

```json
{
  "api": "https://api.sb/patentpad.com",
  "transaction": {
    "$id": "https://api.sb/patentpad.com/transactions/transaction_1",
    "$type": "Transaction",
    "kind": "charge",
    "amount": {
      "amount": 499,
      "currency": "USD"
    }
  },
  "entry": {
    "$id": "https://api.sb/patentpad.com/entries/entry_1",
    "$type": "Entry",
    "account": "cash",
    "amount": {
      "amount": 499,
      "currency": "USD"
    },
    "direction": "debit",
    "startup": "startup_1"
  },
  "action": {
    "$id": "https://api.sb/patentpad.com/actions/action_1",
    "operation": "Entry.settle",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/patentpad.com/actions/action_1"
  }
}
```

**SDK**

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

const { transaction, entry } = await $.Entry.settle({ period: 'period_1', from: 'company_1', to: 'company_1' })
```

**CLI**

```bash
npx startup-builder do Entry.settle --json '{"period":"period_1","from":"company_1","to":"company_1"}'
```

**MCP**

```json
{
  "name": "do",
  "arguments": {
    "code": "return await $.Entry.settle({ period: 'period_1', from: 'company_1', to: 'company_1' })"
  }
}
```