Setting up Stripe Connect (provider payouts)
Providers get paid for card jobs through Stripe Connect Express accounts. Stripe handles identity checks, bank details and payouts; the app opens Stripe's own onboarding form.
Use test mode (sk_test_…, pk_test_…) until you go live. Never put live keys in the repository, CI or a demo.
If you'd rather pay providers yourself (bank transfer, etc.), leave Connect off. The payout step in the app is then hidden, and providers see "Paid by the platform".
1. Turn on Connect in Stripe
- In the Stripe Dashboard switch to Test mode.
- Go to Connect → Get started and choose Platform or marketplace.
- Under Connect → Settings:
- Account types: enable Express.
- Branding: your app name, icon and brand color. Providers see these on Stripe's onboarding pages.
- Platform profile: describe what providers do and how they get paid (Stripe asks before you can create accounts).
- Countries: the countries your providers live in.
- Copy the secret key and publishable key from Developers → API keys.
2. Add the webhook endpoint for connected accounts
Payout status changes arrive as account.updated events from the providers' accounts, so this endpoint must listen to connected accounts, not your own account.
- Developers → Webhooks → Add endpoint.
- URL:
https://YOUR-API-DOMAIN/api/v1/webhooks/stripe/connect - Listen to: Events on Connected accounts.
- Events:
account.updated. - Save, then copy the endpoint's Signing secret (
whsec_…).
3. Fill in the admin settings
Admin → Settings → Business
- Country: new Stripe accounts are created in this country (ISO code, e.g.
US,GB,ID).
Admin → Settings → Integrations → Stripe
- Publishable key and Secret key (test keys while developing). Test connection checks the secret key.
- Connect webhook signing secret: the
whsec_…from step 2. - Stripe Connect payouts: on.
The app's GET /api/v1/config then reports features.payouts: true.
4. How onboarding works
- The provider taps Set up payouts. It is on step 5 of the application, on Earnings, and in the banner on the provider dashboard.
- The app calls
POST /api/v1/provider/stripe/onboarding-link. The first time, the API creates the Express account with thetransferscapability and saves its id on the provider. It returns a one-time Stripe link. - The link opens in an in-app browser tab (Custom Tabs / SFSafariViewController).
- When the provider finishes, Stripe sends them to
/payouts/return, a page that tells them to go back to the app.- If the link expired, Stripe uses
/payouts/refresh/{provider}, a signed URL valid for a day, which makes a fresh link.
- If the link expired, Stripe uses
- When the app comes back to the front, it calls
GET /api/v1/provider/stripe/status. That call reads the account from Stripe and savespayouts_enabled. - Stripe also sends
account.updatedwhenever the account changes, for example when verification finishes later. The webhook updatespayouts_enabledthe same way.
payouts_enabled is true only when Stripe says both details_submitted and payouts_enabled.
Once payouts are active, Open Stripe dashboard (POST /api/v1/provider/stripe/dashboard-link) lets providers see their balance, payouts and bank account.
Admins see each provider's payout status on the provider page: not set up, onboarding not finished, or ready.
5. Testing in test mode
- In Stripe's test onboarding form, use the test values Stripe shows: phone
000 000 0000, SMS code000000, test bank account and routing numbers, and000-00-0000for SSN in the US. - To send a test webhook locally, use the Stripe CLI:
stripe listen --forward-connect-to localhost:8000/api/v1/webhooks/stripe/connectand put thewhsec_…it prints in the Connect webhook secret setting.
Errors the app may see
| Code | Meaning |
|---|---|
PAYOUTS_DISABLED (503) |
Connect is off or no secret key is set. |
PAYOUTS_NOT_SET_UP (409) |
Dashboard link asked before an account exists. |
PAYMENT_PROVIDER_ERROR (502) |
Stripe refused or didn't answer. Details are in the API log. |