# Put money into the business

URL: /start/guides/put-money-into-the-business · Id: `guide:put-money-into-the-business`

> Say "put $500 into the business" and your agent moves it from your own bank into the card balance or operating, before the Startup earns anything.

Before the first sale, the [Startup](/business/nouns/startup)'s money comes from you. The bank you connected at the claim is yours, so cash moved from it into the business is your money going in.

Needs: [Claim the business and connect your bank](/systems/finance/claim-and-connect-your-bank)

**Before real money moves**

- Asks you first: No. Your agent does this unless you set a rule; past one of its [Limits](/business/nouns/limit), it waits for your [Approval](/business/nouns/approval). [Approvals](/agents/approvals) has the rules.
- You leave the chat: Never, once the Startup is claimed. Before the claim: once, at Stripe, to confirm who you are and add the bank account payouts land in.

## What you get
- 1 transfer from your bank, landed in up to five business days (Transaction)
- 2 lines in your books: cash out of the bank account, into the business account (Entry)

## Your agent does
**For agents**

- Guide: `guide:put-money-into-the-business`. Page: [/start/guides/put-money-into-the-business.md](/start/guides/put-money-into-the-business.md).
- Approval: within the seat’s Permissions and Limits. Past a Limit, or where a seat rule below names the class, the call waits `pending` for the founder’s Approval.
- Leaves the chat: never.
- Needs first: [Claim the business and connect your bank](/systems/finance/claim-and-connect-your-bank).
- Run: call the steps in order, each through the API, CLI, MCP or SDK tab below; a later step passes the `$id` an earlier one returns. Each value marked example is the sample business’s: pass the founder’s own.
- Retry: each write sends the Idempotency-Key `put-money-into-the-business-<the Startup's domain>-<run>-<step>` (`put-money-into-the-business-leaseline.app-$RUN-1` for step 1 of the worked example), in the API and CLI as a header or flag and in the SDK as `{ idempotencyKey }`. Mint `run` once per founder request (`RUN=$(uuidgen)`, `crypto.randomUUID()`): the same ask made again later is a new request with a new run, so it runs again. After a timeout, rerun with the same run: api.sb returns each finished step's first Action and runs nothing twice.
- Retry in MCP: the `do` call carries `idempotencyKey: "put-money-into-the-business-<the Startup's domain>-<run>"`, and each write inside sends it plus `-<n>`, its call number. Rerun the same code with the same key after a timeout: finished calls return their first Action, and only the rest run.
- Lookups: a `find:` reads the two newest matches and stops to ask the founder when there is not exactly one, so no write acts on a guessed record.

| Step | Verb | Inputs (type, required, this guide’s value) | Returns |
| --- | --- | --- | --- |
| 1 | [`Account.sweep`](/business/nouns/account/sweep) (`verb:Account.sweep`) | `from` Account (an id), required: the `$id` of the one Account `Account.list` returns for `where: heldAt = bank`; ask the founder unless exactly one matches; `to` Account (an id), required: the `$id` of the one Account `Account.list` returns for `where: heldAt = cards`; ask the founder unless exactly one matches; `amount` money: example `{"amount":500,"currency":"USD"}` | `account` Account, `transaction` Transaction |

Returns: the last call answers with `account`, `transaction` and its `action`, whose `status` is `done`, `pending` (waiting on an Approval or a Worker), `failed`, `canceled` or `refused`:

```json
{
  "api": "https://api.sb/leaseline.app",
  "account": {
    "$id": "https://api.sb/leaseline.app/accounts/acct_nV4f0K7dTw",
    "$type": "Account"
  },
  "transaction": {
    "$id": "https://api.sb/leaseline.app/transactions/txn_XoxtZe3CQI",
    "$type": "Transaction",
    "amount": {
      "amount": 500,
      "currency": "USD"
    }
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Account.sweep",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}
```

Next: offer “Put it in operating instead”, or “Add $200 every month”.

Calls: `Account.sweep`

Ask:

```text
Put $500 into the business.
Add money from my bank.
Fund the card balance from my bank.
```

API:

```bash
# Look up the Account: Account.list
RUN=$(uuidgen)  # once per request; reuse it only to retry this request
FROM_MATCHES=$(curl "https://api.sb/leaseline.app/accounts?where=heldAt%20%3D%20bank&limit=2" \
  -H "Authorization: Bearer $SB_TOKEN")
[ "$(echo "$FROM_MATCHES" | jq '.accounts | length')" = 1 ] || { echo "Ask the founder which Account"; exit 1; }
FROM=$(echo "$FROM_MATCHES" | jq -r '.accounts[0]["$id"] | split("/") | last')

# Look up the Account: Account.list
TO_MATCHES=$(curl "https://api.sb/leaseline.app/accounts?where=heldAt%20%3D%20cards&limit=2" \
  -H "Authorization: Bearer $SB_TOKEN")
[ "$(echo "$TO_MATCHES" | jq '.accounts | length')" = 1 ] || { echo "Ask the founder which Account"; exit 1; }
TO=$(echo "$TO_MATCHES" | jq -r '.accounts[0]["$id"] | split("/") | last')

# Account.sweep
curl -X POST https://api.sb/leaseline.app/accounts/$FROM/sweep \
  -H "Authorization: Bearer $SB_TOKEN" \
  -H "Idempotency-Key: put-money-into-the-business-leaseline.app-$RUN-1" \
  -H "Content-Type: application/json" \
  -d '{"to":"'"$TO"'","amount":{"amount":500,"currency":"USD"}}'
```

CLI:

```bash
RUN=$(uuidgen)  # once per request; reuse it only to retry this request
FROM_MATCHES=$(npx startup-builder do Account.list --data '{"where":"heldAt = bank","limit":2}' --json)
[ "$(echo "$FROM_MATCHES" | jq '.accounts | length')" = 1 ] || { echo "Ask the founder which Account"; exit 1; }
FROM=$(echo "$FROM_MATCHES" | jq -r '.accounts[0]["$id"] | split("/") | last')
TO_MATCHES=$(npx startup-builder do Account.list --data '{"where":"heldAt = cards","limit":2}' --json)
[ "$(echo "$TO_MATCHES" | jq '.accounts | length')" = 1 ] || { echo "Ask the founder which Account"; exit 1; }
TO=$(echo "$TO_MATCHES" | jq -r '.accounts[0]["$id"] | split("/") | last')
npx startup-builder do Account.sweep --data '{"from":"'"$FROM"'","to":"'"$TO"'","amount":{"amount":500,"currency":"USD"}}' --idempotency-key put-money-into-the-business-leaseline.app-$RUN-1
```

MCP:

```json
{
  "name": "do",
  "arguments": {
    "code": "const fromMatches = await $.Account.list({ where: 'heldAt = bank', limit: 2 })\nif (fromMatches.length !== 1) throw new Error(`Ask the founder which Account: ${fromMatches.length} match`)\nconst [from] = fromMatches\nconst toMatches = await $.Account.list({ where: 'heldAt = cards', limit: 2 })\nif (toMatches.length !== 1) throw new Error(`Ask the founder which Account: ${toMatches.length} match`)\nconst [to] = toMatches\nreturn await $.Account.sweep({ from: from.$id, to: to.$id, amount: { amount: 500, currency: 'USD' } })",
    "idempotencyKey": "put-money-into-the-business-leaseline.app-<run>"
  }
}
```

SDK:

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

const run = crypto.randomUUID() // once per request; reuse it only to retry this request
const fromMatches = await $.Account.list({ where: 'heldAt = bank', limit: 2 })
if (fromMatches.length !== 1) throw new Error(`Ask the founder which Account: ${fromMatches.length} match`)
const [from] = fromMatches
const toMatches = await $.Account.list({ where: 'heldAt = cards', limit: 2 })
if (toMatches.length !== 1) throw new Error(`Ask the founder which Account: ${toMatches.length} match`)
const [to] = toMatches
await $.Account.sweep({ from: from.$id, to: to.$id, amount: { amount: 500, currency: 'USD' } }, { idempotencyKey: `put-money-into-the-business-leaseline.app-${run}-1` })
```

## Change it
- Put it in operating instead.
- Add $200 every month.

## Under the hood
- Systems: [Treasury](/systems/treasury), [Ledger](/systems/ledger)
- Nouns: [Account](/business/nouns/account), [Transaction](/business/nouns/transaction), [Entry](/business/nouns/entry)
- Events: [`Account.swept`](/business/events/Account.swept), [`Transaction.reconciled`](/business/events/Transaction.reconciled)
- Stripe objects: `Treasury InboundTransfer`, `Issuing Balance`, `Treasury FinancialAccount`

[`Account.sweep`](/business/nouns/account/sweep) moves cash between two [Accounts](/business/nouns/account) of the same owner. From your bank it lands in up to five business days, as an inbound transfer the [Ledger](/systems/ledger) matches on both statements. Money in the card balance pays for [Cards](/business/nouns/card) and ad spend; money in operating pays [Bills](/business/nouns/bill).