Docs / wallet / requestBuilderPayout

requestBuilderPayout

utilitysince 0.2.9not for built apps

Client function: withdraw the builder's available fiat balance to their connected Stripe account.

import { requestBuilderPayout } from 'flowstack-sdk'

Non-React client function. Transfers the entire available fiat balance (fiat payouts drain the whole balance — no partial amounts) to the builder's Connect account. Requires payouts_enabled (see getConnectStatus) and available_cents ≥ min_payout_cents (see getBuilderEarnings). POST /billing/builder/payout.

Signature

requestBuilderPayout(credentials, config?): Promise<ApiResponse<{ paid_cents: number; stripe_transfer_id: string; payout_id: string }>>

Parameters

ParamTypeNotesDescription
credentialsFlowstackCredentialsrequiredThe builder's (app owner's) credentials.
configFlowstackClientConfigsince 0.2.9Client config (baseUrl, tenantId as needed).

Returns

FieldTypeDescription
Promise<ApiResponse<{ paid_cents: number; stripe_transfer_id: string; payout_id: string }>>The amount transferred and the Stripe transfer/payout ids.

Examples

Withdraw
const res = await requestBuilderPayout(credentials);
if (res.ok) console.log(`Paid $${(res.data.paid_cents / 100).toFixed(2)}`);
else console.error(res.error); // e.g. below minimum, payouts not enabled
WarningFiat (Stripe-rail) only, and it drains the FULL available balance. AGENT-rail earnings settle on-chain to the payout wallet instead — see BuilderEarnings.rails.agent and the set_payout_wallet action.
WarningBuilder/owner operation — call with the builder's credentials from a dashboard/console context, not from inside a generated app's end-user runtime. builtAppSafe is false.

See also

getBuilderEarnings · getConnectStatus · startConnectOnboarding

Source: src/api/client.ts (Builder Earnings, P0-152) · Also available in llms-full.txt and registry.json.