Skip to content
Create account
or
Sign in
The Stripe Docs logo
/
Ask AI
Create account
Sign in
Get started
Payments
Finance automation
Platforms and marketplaces
Money management
Developer tools
Get started
Payments
Finance automation
Get started
Payments
Finance automation
Platforms and marketplaces
Money management
Overview
Get started with Connect
Integration fundamentals
Example integrations
Onboard accounts
    Choose your onboarding configuration
      Stripe-hosted onboarding
      Embedded onboarding
      API onboarding
    Account capabilities
    Required verification information
    Service agreement types
    Additional Verifications
    Networked onboarding
    Migrate to Stripe
Configure account Dashboards
Accept payments
Pay out to accounts
Manage your Connect platform
Tax forms for your Connect platform
Work with connected account types
HomePlatforms and marketplacesOnboard accountsChoose your onboarding configuration

API onboarding

Build your own onboarding flow using Stripe's APIs.

Copy page

With API onboarding, you use the Accounts API to build an onboarding flow, reporting functionality, and communication channels for your users. Stripe can be completely invisible to the account holder. However, your platform is responsible for all interactions with your accounts and for collecting all the information needed to verify them.

Additional responsibilities

With API onboarding, your custom flow must meet all legal and regulatory requirements in the regions where you do business. You must also commit resources to track changes to those requirements and collect updated information on an ongoing basis, at least once every six months. If you want to implement a customized onboarding flow, Stripe strongly recommends that you use embedded onboarding.

Establish requirements

The following factors affect the onboarding requirements for your connected accounts:

  • The origin country of the connected accounts
  • The service agreement type applicable to the connected accounts
  • The capabilities requested for the connected accounts
  • The business_type (for example, individual or company) and company.structure (for example, public_corporation or private_partnership)

Use the interactive form to see how changing these factors affects the requirements.

Requirements form

Create forms to collect information
Client-side

As a best practice, organize the required parameters into logical groupings or forms in your onboarding flow. You might wish to encode a mapping between the Stripe parameters and the logical groupings. Suggested logical groupings for parameters are shown in the first column of the example requirements table.

After you encode the required parameters into your application, generate UIs for the parameters corresponding to these requirements. For each parameter, design a UI form that includes:

  • Parameter label, localized to each supported country and language
  • Parameter description, localized to each supported country and language
  • Parameter input fields with data validation logic and document uploading where required

It’s important to architect your application logic to account for the possibility of additional parameters in the future. For example, Stripe might introduce new parameters, new verifications, or new thresholds that you must incorporate into your onboarding flows over time.

Changing any of the factors that determine your connected accounts’ requirements means you must also adjust your collection forms to handle the changed requirements. Country and service agreement type are immutable, while capabilities and business type are mutable.

  • To change an immutable field, create a new connected account with the new values to replace the existing account.
  • To change a mutable field, update the connected account.

Include the Stripe Terms of Service Agreement

Your connected accounts must accept Stripe’s terms of service before they can activate. You can wrap Stripe’s terms of service in your own terms of service.

Create a connected account
Server-side

Create an Account where your platform is liable for negative balances, Stripe collects fees from your platform account, and your connected accounts don’t have access to a Stripe-hosted Dashboard. Request any capabilities that your connected accounts need. Prefill the business type and any other available information matching your requirements.

Alternatively, you can create a connected account with type set to custom and desired capabilities.

If you don’t specify the country and service type agreement, they’re assigned the following default values:

  • The country defaults to the same country as your platform.
  • The service type agreement (tos_acceptance.service_agreement) defaults to full.
Command Line
cURL
curl https://api.stripe.com/v1/accounts \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ -d "controller[losses][payments]"=application \ -d "controller[fees][payer]"=application \ -d "controller[stripe_dashboard][type]"=none \ -d "controller[requirement_collection]"=application \ -d "capabilities[card_payments][requested]"=true \ -d "capabilities[transfers][requested]"=true \ -d business_type=individual \ -d country=US

Determine the information to collect
Server-side

As the platform, you must decide if you want to collect the required information from your connected accounts up front or incrementally. Up-front onboarding collects the eventually_due requirements for the account, while incremental onboarding only collects the currently_due requirements.

Onboarding typeAdvantages
Up-front
  • Normally requires only one request for all information
  • Avoids the possibility of payout and processing issues due to missed deadlines
  • Exposes potential risk early when accounts refuse to provide information
Incremental
  • Accounts can onboard quickly because they don’t have to provide as much information

To determine whether to use up-front or incremental onboarding, review the requirements for your connected accounts’ locations and capabilities. While Stripe tries to minimize any impact to connected accounts, requirements might change over time.

For connected accounts where you’re responsible for requirement collection, you can customize the behavior of future requirements using the collection_options parameter. To collect the account’s future requirements, set collection_options.future_requirements to include.

To implement your onboarding strategy, inspect the requirements hash of the connected account you created. The requirements hash provides a complete list of the information you must collect to activate the connected account.

  • For incremental onboarding, inspect the currently_due hash in the requirements hash and build an onboarding flow that only collects those requirements.
  • For up-front onboarding, inspect thecurrently_due and eventually_due hashes in the requirements hash, and build an onboarding flow that collects those requirements.
{ ... "requirements": { "alternatives": [], "current_deadline": null, "currently_due": [ "business_profile.product_description", "business_profile.support_phone", "business_profile.url", "external_account", "tos_acceptance.date", "tos_acceptance.ip" ], "disabled_reason": "requirements.past_due", "errors": [], "eventually_due": [ "business_profile.product_description", "business_profile.support_phone", "business_profile.url", "external_account", "tos_acceptance.date", "tos_acceptance.ip" ], "past_due": [], "pending_verification": [] }, ... }

Handle liveness requirements

An account can have one or more Persons with a proof_of_liveness requirement. A proof_of_liveness requirement might require collection of an electronic ID credential such as MyInfo in Singapore, or by using Stripe Identity to collect a document or selfie. We recommend using Stripe-hosted or embedded onboarding to satisfy all variations of the proof_of_liveness requirement.

Stripe-hosted onboarding can complete all variations of proof_of_liveness requirements.

Create an Account Link using the connected account ID, and send the account to the url returned.

Command Line
cURL
curl https://api.stripe.com/v1/account_links \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ -d account=
{{CONNECTED_ACCOUNT_ID}}
\ --data-urlencode refresh_url="https://example.com/refresh" \ --data-urlencode return_url="https://example.com/return" \ -d type=account_onboarding \ -d "collection_options[fields]"=currently_due

The account receives a prompt to complete the proof_of_liveness requirement, along with any other currently due requirements. Listen to the account.updated event sent to your webhook endpoint to be notified when the account completes requirements and updates their information. After the account completes the requirement, the account is redirected to the return_url specified.

Update the connected account
Server-side

Update the Account object with new information as your connected account progresses through each step of the onboarding flow. That allows Stripe to validate the information as soon as it’s added. After Stripe confirms acceptance of our terms of service, any change to the Account triggers reverification. For example, if you change the connected account’s name and ID number, Stripe reruns verifications.

Command Line
cURL
curl https://api.stripe.com/v1/accounts/
{{CONNECTED_ACCOUNT_ID}}
\ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ --data-urlencode "business_profile[url]"="https://furever.dev" \ -d "tos_acceptance[date]"=1609798905 \ -d "tos_acceptance[ip]"="8.8.8.8"

When updating a connected account, you must handle any verification errors or HTTP error codes.

Handle verification errors
Server-side

When the connected account’s data is submitted, Stripe verifies it. This process might take minutes or hours, depending on the nature of the verification. During this process, the capabilities you requested have a status of pending.

Review status

You can retrieve the status of your connected account’s capabilities by:

  • Inspecting the Account object’s capabilities hash for the relevant capability.
  • Requesting capabilities directly from the Capabilities API and inspecting the status of the relevant capability.
  • Listening for account.updated events in your webhook endpoint and inspecting the capabilities hash for the relevant capability.

After verifications are complete, a capability becomes active and available to the connected account. Account verifications run continuously, and if a future verification fails, a capability can transition out of active. Listen for account.updated events to detect changes to capability states.

Confirm that your Connect integration is compliant and operational by checking that the account’s charges_enabled and payouts_enabled are both true. You can use the API or listen for account.updated events. For details on other relevant fields, check the account’s requirements hash. You can’t confirm the integration based on a single value because statuses can vary depending on the application and related policies.

  • charges_enabled confirms that your full charge path including the charge and transfer works correctly and evaluates if either card_payments or transfers capabilities are active.
  • payouts_enabled evaluates whether your connected account can pay out to an external account. Depending on your risk policies, you can allow your connected account to start transacting without payouts enabled. You must eventually enable payouts to pay your connected accounts.

You can use the following logic as a starting point for defining a summary status to display to your connected account.

Ruby
# Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys Stripe.api_key =
'sk_test_BQokikJOvBiI2HlWgH4olfQ2'
def account_state(account) reqs = account.requirements if reqs.disabled_reason && reqs.disabled_reason.include?("rejected") "rejected" elsif account.payouts_enabled && account.charges_enabled if reqs.pending_verification "pending enablement" elsif !reqs.disabled_reason && !reqs.currently_due if !reqs.eventually_due "complete" else "enabled" end else "restricted" end elsif !account.payouts_enabled && account.charges_enabled "restricted (payouts disabled)" elsif !account.charges_enabled && account.payouts_enabled "restricted (charges disabled)" elsif reqs.past_due "restricted (past due)" elsif reqs.pending_verification "pending (disabled)" else "restricted" end end accounts = Stripe::Account.list(limit: 10) accounts.each do |account| puts "#{account.id} has state: #{account_state(account)}" end

Note

You can’t use the API to respond to Stripe risk reviews. You can enable your connected accounts to respond using embedded components, Stripe-hosted onboarding, or remediation links. You can also use the Dashboard to respond to risk reviews on behalf of your connected accounts.

Listen to the account.updated event. If the account contains any currently_due fields when the current_deadline arrives, the corresponding functionality is disabled and those fields are added to past_due.

Create a form with clear instructions that the account can use to correct the information. Notify the account, then submit the corrected information using the Accounts API.

If you plan to create custom flows to handle all your verification errors:

  • Review the details regarding all possible verification errors and how to handle them.
  • Test verification states.
Was this page helpful?
YesNo
Need help? Contact Support.
Join our early access program.
Check out our changelog.
Questions? Contact Sales.
LLM? Read llms.txt.
Powered by Markdoc