Before a business can accept payments, it needs a connected account — its own payment account, where it is the merchant of record. Onboarding is a three-step flow.
1. Create the connected account
curl https://payments.leffelconsulting.com/v1/onboarding/account \
-H "X-Api-Key: lc_live_XXXXXXXXXXXXXXXXXXXX" \
-H "Content-Type: application/json" \
-d '{ "email": "owner@acme.com", "country": "US" }'
This is idempotent — calling it again returns the existing account. The response includes the
stripeAccountId (acct_…) and the current onboardingStatus.
2. Send the merchant through hosted onboarding
Generate a hosted onboarding link and redirect the merchant to it. They complete identity and bank details with the processor — no sensitive data touches your systems.
curl https://payments.leffelconsulting.com/v1/onboarding/account-link \
-H "X-Api-Key: lc_live_XXXXXXXXXXXXXXXXXXXX" \
-H "Content-Type: application/json" \
-d '{
"refreshUrl": "https://acme.com/onboard/refresh",
"returnUrl": "https://acme.com/onboard/done"
}'
The url in the response is where you send the merchant. refreshUrl is used if the link expires;
returnUrl is where they land when finished.
3. Confirm they can accept charges
Onboarding status moves through these states:
| Status | Meaning |
|---|---|
not_started | No account yet. |
pending | Account created, identity/bank details incomplete. |
charges_only | Can accept charges; payouts not yet enabled. |
enabled | Fully enabled — charges and payouts. |
restricted | Disabled by the processor; see requirements. |
Check status on demand, or keep it fresh automatically via the account.updated
callback:
curl https://payments.leffelconsulting.com/v1/onboarding/status \
-H "X-Api-Key: lc_live_XXXXXXXXXXXXXXXXXXXX"
Note
Wait until chargesEnabled is true before creating payments for that
merchant. Use POST /v1/onboarding/refresh to pull the latest state immediately instead
of waiting for a webhook.
Next: Accept an online payment.