Skip to content

Account methods: payout, sweep

The Account Verbs payout, sweep as typed SDK methods, with inputs, result, refusals and an example.

Reference for Account, one group of Account methods.

Account.payout

Payout sends available cash from the payments balance to the owner’s bank and lists every Transaction the payout carries. Verb page.

TypeScript
interface AccountVerbs {
  payout(input: AccountPayoutInput, options?: SB.CallOptions): SB.Call<AccountPayoutOutput>
}

Emits Account.paidOut.

Inputs

InputTypeRequiredDescription
accountAccountrequiredThe payments balance: the cash Account held at payments.
amountmoneyHow much to send. Defaults to everything available.
instantbooleanTrue to send it within minutes to an eligible debit card or bank, for Stripe’s instant payout cost.
schedulestringSets the Account’s payoutSchedule from now on, in place of sending a payout now.

Returns

OutputTypeRequiredDescription
accountAccountrequiredThe payments balance after the payout.
transactionTransactionrequiredThe payout, a Transaction of kind payout.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operation.forbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.None.

Example

TypeScript
import { $ } from 'startup-builder'

const { account, transaction } = await $.Account.payout({ account: 'acct_nV4f0K7dTw' })

Account.sweep

Sweep moves cash between two cash Accounts of the same owner, once or on a standing rule, within the Treasurer’s Limit. Verb page.

TypeScript
interface AccountVerbs {
  sweep(input: AccountSweepInput, options?: SB.CallOptions): SB.Call<AccountSweepOutput>
}

Emits Account.swept.

Inputs

InputTypeRequiredDescription
fromAccountrequiredThe cash Account the money leaves.
toAccountrequiredThe cash Account it lands in.
amountmoneyHow much to move. Leave it out and set keep to move everything above a floor.
keepmoneyLeave this much in from and move the rest.
repeatstringTurns the move into a standing rule that sweeps on this schedule.

Returns

OutputTypeRequiredDescription
accountAccountrequiredThe to Account, with the money landed.
transactionTransactionrequiredThe move, reconciled on both Accounts.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operation.forbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.None.

Example

TypeScript
import { $ } from 'startup-builder'

const { account, transaction } = await $.Account.sweep({ from: 'acct_nV4f0K7dTw', to: 'acct_nV4f0K7dTw' })