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'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
What you get
- 1transfer from your bank, landed in up to five business daysTransaction
- 2lines in your books: cash out of the bank account, into the business accountEntry
Your agent does
You, to your agent
Put $500 into the business.
Add money from my bank.
Fund the card balance from my bank.
# 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"}}'
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
{
"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>"
}
}
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, Ledger
- Nouns
- Account, Transaction, Entry
- Events
Account.swept,Transaction.reconciled- Stripe objects
Treasury InboundTransfer,Issuing Balance,Treasury FinancialAccount
Account.sweep moves cash between two Accounts of the same owner. From your bank it lands in up to five business days, as an inbound transfer the Ledger matches on both statements. Money in the card balance pays for Cards and ad spend; money in operating pays Bills.