Skip to main content
All operations require customer-dashboard authentication, not a Portal buyer token. See access and identifiers. These operations affect the customer’s merchant connection, not their subscription billing. Connection flows are for the account owner, not for linking a payout destination on somebody else’s behalf.

Create or resume onboarding

POST /api/stripe/connect
Request
Response (200)
Uses an existing linked account when it can be verified; otherwise, if no account is linked, creates a Standard account and stores its ID. Open the returned onboarding URL. For connecting an already-existing but unlinked Stripe account, use OAuth below. Errors: 400 invalid input, 401 unauthenticated, 403 non-self request, 404 missing customer, 409 existing connection cannot be verified, or 500 provider failure. A 409 is not permission to automatically replace the merchant account; resolve the connection with support.

Start existing-account OAuth

POST /api/stripe/oauth-start Send a valid redirect_uri URL registered for the integration’s Stripe OAuth flow.
Request
Response (200)
Navigate to the returned URL unchanged. After Stripe redirects back, retain its code and state for completion. State is scoped to the signed-in customer and expires after 30 minutes. Errors: 400 invalid URI, 401 unauthenticated, 403 disallowed delegated access, 409 an account is already linked, and 503 existing-account connection unavailable.

Complete existing-account OAuth

POST /api/stripe/oauth-complete Required code is 1-200 characters; required state is 1-2000 characters. Use the exact callback values and the same customer identity.
Request
Response (200)
Exchanges the one-use code, verifies provider mode, and saves the merchant connection. Email and name may be null. Errors: 400 invalid input/code exchange or wrong provider mode, 401 unauthenticated, 403 expired/mismatched state or disallowed access, 409 an account is already linked (including a concurrent connection), and 500 failure to save/retrieve the connection.

Refresh account status

GET /api/stripe/account-status No query fields. Reads the signed-in customer’s linked account from Stripe and can update saved onboarding flags.
Response (200)
With no linked account:
Response (200, no connection)
If Stripe cannot be reached or the account cannot be retrieved, the endpoint returns the saved ID/flags with stale: true and omits the display fields. Do not interpret stale data as fresh confirmation of capability or as evidence the account was deleted. Missing authentication returns 401.

Create a payouts session

GET /api/stripe/create-payouts-session Required query accountId is the signed-in customer’s linked Stripe account ID.
Response (200)
Despite using GET, this creates a Stripe Account Session for embedded payout components, including instant/standard payouts, payout schedule editing, and external-account collection. It does not itself request a payout. Keep the returned secret private and do not cache/share this response. Errors use error: 400 missing/invalid account ID, 401 unauthenticated, 403 account does not belong to the caller, and 500 provider failure.