Move money between accounts
Say "move $5,000 to the card balance" or "sweep everything over $20,000 to reserve" and the Treasurer moves it, once or on a standing rule.
Move cash between the Startup's own accounts, once or on a rule. Money to your bank goes out as a payout: pay out to your bank.
Needs Open a bank account · Open a bank account
What you get
- 1transfer between two of your cash accounts, matched on both statementsTransaction
- 1standing rule, when you ask for one, that moves cash on a scheduleAccount
- 2lines in your books: cash out of one account, into the otherEntry
Your agent does
Move $5,000 to the card balance.
Keep two weeks of card spend in the card balance.
Sweep everything over $20,000 to reserve every Friday.
# Look up the Account: Account.list
FROM= $(curl "https: //api.sb/ leaseline.app/ accounts? where= heldAt%20%3D%20payments& limit= 1" \
-H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" | jq -r '.accounts[0]["$id"] | split("/ ") | last')
# Look up the Account: Account.list
TO= $(curl "https: //api.sb/ leaseline.app/ accounts? where= heldAt%20%3D%20cards& limit= 1" \
-H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" | jq -r '.accounts[0]["$id"] | split("/ ") | last')
# Account.sweep
curl -X POST https: //api.sb/ leaseline.app/ accounts/ $FROM/ sweep \
-H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
-H "Content-Type: application/ json" \
-d '{"to": "'"$TO"'", "amount": {"amount": 5000, "currency": "USD"}}'
import { $ } from 'startup-builder'
const [from] = await $.Account.list({ where: 'heldAt = payments', limit: 1 })
const [to] = await $.Account.list({ where: 'heldAt = cards', limit: 1 })
await $.Account.sweep({ from: from.$id, to: to.$id, amount: { amount: 5000, currency: 'USD' } })
FROM= $(npx startup-builder do Account.list --json '{"where": "heldAt = payments", "limit": 1}' | jq -r '.accounts[0]["$id"] | split("/ ") | last')
TO= $(npx startup-builder do Account.list --json '{"where": "heldAt = cards", "limit": 1}' | jq -r '.accounts[0]["$id"] | split("/ ") | last')
npx startup-builder do Account.sweep --json '{"from": "'"$FROM"'", "to": "'"$TO"'", "amount": {"amount": 5000, "currency": "USD"}}'
{
"name": "do",
"arguments": {
"code": "const [from] = await $.Account.list({ where: 'heldAt = payments', limit: 1 })\nconst [to] = await $.Account.list({ where: 'heldAt = cards', limit: 1 })\nreturn await $.Account.sweep({ from: from.$id, to: to.$id, amount: { amount: 5000, currency: 'USD' } })"
}
}
Change it
- Do this every Monday.
- Keep $10,000 in operating and sweep the rest to reserve.
Under the hood
- Systems
- Treasury, Ledger
- Nouns
- Account, Transaction, Entry
- Events
Account.swept,Account.paidOut,Transaction.reconciled- Stripe objects
Balance,Issuing Balance,Treasury FinancialAccount,Treasury OutboundTransfer,Payout
Each place cash sits is an Account of class cash: the payments balance, the card balance, operating, reserve and your bank. Revenue in the payments balance pays for nothing until it moves, so a Startup whose agents run ads keeps the card balance topped up.
Account.sweep moves money between two Accounts you own, and never to your bank. From the payments balance to the card balance it lands at once; from a bank it takes up to five business days. A rule with keep holds a floor and moves the rest, such as $10,000 in operating and everything else to reserve.
Account.payout sends available cash to your bank. Payouts run daily by default; instant sends one within minutes for Stripe's instant payout cost, which posts as its own Entry. A payout the bank returns lands back in the payments balance with a Task to fix the bank details.