startConnectOnboarding
Client function: create (or reuse) the builder's Stripe Connect Express account and get an onboarding link.
import { startConnectOnboarding } from 'flowstack-sdk'Non-React client function. Creates the Connect Express account if needed and returns a one-time onboarding URL — redirect the builder there. Stripe returns them to return_url on completion or refresh_url if the link expires. POST /billing/connect/onboard.
Signature
startConnectOnboarding(credentials, urls, config?): Promise<ApiResponse<{ url: string; stripe_account_id: string }>>Parameters
| Param | Type | Notes | Description |
|---|---|---|---|
credentials | FlowstackCredentials | required | The builder's (app owner's) credentials. |
urls | { return_url: string; refresh_url: string } | required | Where Stripe sends the builder after onboarding completes (return_url) or when the link expires (refresh_url). |
config | FlowstackClientConfig | since 0.2.9 | Client config (baseUrl, tenantId as needed). |
Returns
| Field | Type | Description |
|---|---|---|
| — | Promise<ApiResponse<{ url: string; stripe_account_id: string }>> | The onboarding link to redirect to, plus the account id. |
Examples
Kick off onboarding
const res = await startConnectOnboarding(credentials, {
return_url: `${location.origin}/earnings?onboarded=1`,
refresh_url: `${location.origin}/earnings?retry=1`,
});
if (res.ok) window.location.href = res.data.url;NoteOnboarding links are single-use and short-lived. After the builder returns, call
getConnectStatus to confirm payouts_enabled before enabling payout UI.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
getConnectStatus · requestBuilderPayout
Source: src/api/client.ts (Builder Earnings, P0-152) · Also available in llms-full.txt and registry.json.