requestBuilderPayout
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
| Param | Type | Notes | Description |
|---|---|---|---|
credentials | FlowstackCredentials | required | The builder's (app owner's) credentials. |
config | FlowstackClientConfig | since 0.2.9 | Client config (baseUrl, tenantId as needed). |
Returns
| Field | Type | Description |
|---|---|---|
| — | 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 enabledWarningFiat (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.