Skip to content

Pay out to my bank

Say "send everything available to the bank now" and get a payout from the payments balance, after its delay window, with every charge it carries listed.

Send available cash from the payments balance to your bank. A payout is one-way, so it waits its delay window before it leaves.

Needs Open a bank account

What you get

  • 1payout of everything available, sent to your bank after its delay windowTransaction
  • 1list of every charge, refund and fee the payout carriesTransaction
  • 2lines in your books: cash out of the payments balance, into the bankEntry

Your agent does

Account.payout
You, to your agent

Send everything available to the bank now.

Pay out to my bank.

Move my Stripe balance to the bank.

# Look up the Account: Account.list
ACCOUNT=$(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')

# Account.payout
curl -X POST https://api.sb/leaseline.app/accounts/$ACCOUNT/payout \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY"
import { $ } from 'startup-builder'

const [account] = await $.Account.list({ where: 'heldAt = payments', limit: 1 })
await $.Account.payout({ account: account.$id })
ACCOUNT=$(npx startup-builder do Account.list --json '{"where":"heldAt = payments","limit":1}' | jq -r '.accounts[0]["$id"] | split("/") | last')
npx startup-builder do Account.payout --json '{"account":"'"$ACCOUNT"'"}'
{
  "name": "do",
  "arguments": {
    "code": "const [account] = await $.Account.list({ where: 'heldAt = payments', limit: 1 })\nreturn await $.Account.payout({ account: account.$id })"
  }
}

Change it

  • Pay out weekly instead of daily.
  • Send $2,000 now and keep the rest.
  • Send it within minutes instead.

Under the hood

Systems
Treasury, Ledger
Nouns
Account, Transaction, Entry
Events
Account.paidOut
Stripe objects
Balance, Payout

Account.payout runs on the Account's payoutSchedule, daily by default; a call sends one now, and schedule changes the rhythm. instant sends it 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.