Skip to content
Sign in
An image of the Stripe logo
/
Create account
Sign in
Home
Payments
Finance automation
Banking as a service
Developer tools
No-code
All products
Home
Payments
Finance automation
Home
Payments
Finance automation
Banking as a service
Developer tools
Overview
Get started
About Stripe payments
Start an integration
Payment Links
Checkout
Web Elements
Mobile Elements
Payment scenarios
During the payment
After the payment
Add payment methods
More payment scenarios
Faster checkout with Link
Other Stripe products
Connect
    Overview
    Get started
    Customize your Connect integration
    Collect payments then pay out
    Enable other businesses to accept payments directly
    Pay out money
    Explore Connect
    Onboard your accounts
    Choose your account type
    Standard
    Express
    Custom
    Update accounts
    Service agreement types
    Payment methods
    Account capabilities
    Handle verification with the API
    Additional Verifications
    Update verified info
    Migrate to Stripe
    Connect embedded components
    Getting started
    Supported components
    Customization
    Accept payments
    Create a charge
    Create a payments page
    Create payment links with Connect
    Connect integration guide
    Dynamic payment methods
    Set statement descriptors
    Connect platforms using the Payment Methods API
    Create subscriptions
    Create invoices
    Debit Express and Custom connected accounts
    Pay out
    Set bank and debit card payouts
    Bank accounts and debit cards
    Manage payout schedule
    Manual payouts
    Payout reversals
    Payout statement descriptors
    Alternative Currency Payouts
    Instant Payouts
    Cross-border payouts
    Crypto payouts
    Manage funds
    Add money to your platform balance
    Account balance
    Handle multiple currencies
    Manage accounts
    Best practices
    Listen for updates
    Dashboard account management
    Understanding risk offerings
    Platform controls for Standard accounts
    Make API calls for connected accounts
    Set MCCs
    Testing
    Payment Method Configurations API
    Migrate to Payment Method Configurations API
    Multiple payment method configurations
    Manage tax forms
    Overview
    Get started with tax reporting
    1099 Tax Support and Communication Guide
    Tax form settings
    Calculation methods
    Identity information on tax forms
    File tax forms
    File tax forms with states
    Identify forms with missing information
    Update and create tax forms
    Deliver tax forms
    Deliver tax forms with Stripe Express
    Correct tax forms
    Split tax forms
    Tax year changeover
    What's new for tax year 2023
Terminal
Radar
Financial Connections
Crypto
Identity
Climate
Resources
About the APIs
Implementation guides
Regulation support
Testing
Connect
·
HomePaymentsConnect

Enable other businesses to accept payments directly

Facilitate direct payments between other businesses and their own customers.

This guide covers letting your users accept payments, moving a portion of your users’ earnings into your balance, and paying out the remainder to your users’ bank accounts. To illustrate these concepts, we’ll use an example platform that lets businesses build their own online stores.

Prerequisites

  1. Register your platform.
  2. Add business details to activate your account.
  3. Complete your platform profile.
  4. Customize your brand settings. Connect onboarding requires that you add a business name, icon, and brand color.

Set up Stripe
Server-side

Install Stripe’s official libraries so you can access the API from your application:

Command Line
# Available as a gem sudo gem install stripe
Gemfile
# If you use bundler, you can add this line to your Gemfile gem 'stripe'

Create a connected account

When a user (seller or service provider) signs up on your platform, create a user Account (referred to as a connected account) so you can accept payments and move funds to their bank account. Connected accounts represent your user in Stripe’s API and help facilitate the collection of onboarding requirements so Stripe can verify the user’s identity. In our store builder example, the connected account represents the business setting up their Internet store.

Screenshot of Connect Onboarding form

Create a connected Standard account and prefill information

Use the /v1/accounts API to create a Standard account and set type to standard in the account creation request.

Command Line
curl https://api.stripe.com/v1/accounts \ -u "
sk_test_4eC39HqLyjWDarjtT1zdp7dc
:"
\ -d type=standard

If you’ve already collected information for your connected accounts, you can prefill that information on the account object. You can prefill any account information, including personal and business information, external account information, and more.

Connect Onboarding doesn’t ask for the prefilled information. However, it does ask the account holder to confirm the prefilled information before accepting the Connect service agreement.

When testing your integration, prefill account information using test data.

Create an account link

You can create an account link by calling the Account Links API with the following parameters:

  • account
  • refresh_url
  • return_url
  • type = account_onboarding
Command Line
curl https://api.stripe.com/v1/account_links \ -u "
sk_test_4eC39HqLyjWDarjtT1zdp7dc
:"
\ -d account=
{{CONNECTED_ACCOUNT_ID}}
\ --data-urlencode refresh_url="https://example.com/reauth" \ --data-urlencode return_url="https://example.com/return" \ -d type=account_onboarding

Redirect your user to the account link URL

The response to your Account Links request includes a value for the key url. Redirect to this link to send your user into the flow. Account Links are temporary and are single-use only because they grant access to the connected account user’s personal information. Authenticate the user in your application before redirecting them to this URL. If you want to prefill information, you must do so before generating the account link. After you create the account link for a Standard account, you won’t be able to read or write information for the account.

Security tip

Don’t email, text, or otherwise send account link URLs outside of your platform application. Instead, provide them to the authenticated account holder within your application.

Handle the user returning to your platform

Connect Onboarding requires you to pass both a return_url and refresh_url to handle all cases where the user is redirected to your platform. It’s important that you implement these correctly to provide the best experience for your user.

Note

You can use HTTP for your return_url and refresh_url while in test mode (for example, to test with localhost), but live mode only accepts HTTPS. Be sure to swap testing URLs for HTTPS URLs before going live.

return_url

Stripe issues a redirect to this URL when the user completes the Connect Onboarding flow. This doesn’t mean that all information has been collected or that there are no outstanding requirements on the account. This only means the flow was entered and exited properly.

No state is passed through this URL. After a user is redirected to your return_url, check the state of the details_submitted parameter on their account by doing either of the following:

  • Listening to account.updated webhooks
  • Calling the Accounts API and inspecting the returned object

refresh_url

Your user is redirected to the refresh_url in these cases:

  • The link is expired (a few minutes went by since the link was created)
  • The user already visited the link (the user refreshed the page or clicked back or forward in the browser)
  • Your platform is no longer able to access the account
  • The account has been rejected

Your refresh_url should trigger a method on your server to call Account Links again with the same parameters, and redirect the user to the Connect Onboarding flow to create a seamless experience.

Handle users that haven’t completed onboarding

If a user is redirected to your return_url, they might not have completed the onboarding process. Use the /v1/accounts endpoint to retrieve the user’s account and check for charges_enabled. If the account isn’t fully onboarded, provide UI prompts to allow the user to continue onboarding later. The user can complete their account activation through a new account link (generated by your integration). To see if they’ve completed the onboarding process, check the state of the details_submitted parameter on their account.

Enable payment methods

View your payment methods settings and enable the payment methods you want to support. Card payments are enabled by default but you can enable and disable payment methods as needed. This guide assumes Bancontact, credit cards, EPS, giropay, iDEAL, Przelewy24, SEPA Direct Debit, and Sofort are enabled.

Before the payment form is displayed, Stripe evaluates the currency, payment method restrictions, and other parameters to determine the list of supported payment methods. Payment methods that increase conversion and that are most relevant to the currency and customer’s location are prioritized. Lower priority payment methods are hidden in an overflow menu.

Beta

Embedding a payment method settings component into your website allows your users to manage their payment methods directly in your dashboard. If you’re interested in this, sign in to learn more and request access to the Connect embedded payment method settings component beta.

If you don’t have a Stripe account, you can register now.

Accept a payment

Embed Stripe Checkout as a payment form directly on your website or redirect users to a Stripe-hosted page to accept payments. Checkout supports multiple payment methods and automatically shows the most relevant ones to your customer You can also use the Payment Element, a prebuilt UI component that is embedded as an iframe in your payment form, to accept multiple payment methods with a single frontend integration.

Create a Checkout Session Client-side Server-side

A Checkout Session controls what your customer sees in the embeddable payment form such as line items, the order amount and currency, and acceptable payment methods. When performing direct charges, Checkout uses the connected account’s branding settings. See the Customize branding section for more information.

Unlike destination charges and separate charges and transfers, users (connected accounts) are responsible for handling disputes on direct charges—it’s not the responsibility of the platform.

On your server, make the following call to the Stripe API. After creating a Checkout Session, redirect your customer to the URL returned in the response.

Command Line
curl https://api.stripe.com/v1/checkout/sessions \ -u "
sk_test_4eC39HqLyjWDarjtT1zdp7dc
:"
\ -H "Stripe-Account:
{{CONNECTED_ACCOUNT_ID}}
"
\ -d mode=payment \ -d "line_items[0][price]"=
{{PRICE_ID}}
\ -d "line_items[0][quantity]"=1 \ -d "payment_intent_data[application_fee_amount]"=123 \ --data-urlencode success_url="https://example.com/success" \ --data-urlencode cancel_url="https://example.com/cancel"
  • line_items - This argument represents items that your customer is purchasing and that will show up in the hosted user interface.
  • success_url - This argument redirects a user after they complete a payment.
  • cancel_url - This argument redirects a user after they click cancel.
  • Stripe-Account - This header indicates a direct charge for your connected account. With direct charges, the connected account is responsible for Stripe fees, refunds, and chargebacks. The connected account’s branding is used in Checkout, which allows their customers to feel like they’re interacting directly with the merchant instead of your platform.
  • (Optional) payment_intent_data[application_fee_amount] - This argument specifies the amount your platform plans to take from the transaction. After the payment is processed on the connected account, the application_fee_amount is transferred to the platform and the Stripe fee is deducted from the connected account’s balance.
Account creation flow

Handle post-payment events Server-side

Stripe sends a checkout.session.completed event when the payment completes. Use a webhook to receive these events and run actions, like sending an order confirmation email to your customer, logging the sale in a database, or starting a shipping workflow.

Listen for these events rather than waiting on a callback from the client. On the client, the customer could close the browser window or quit the app before the callback executes. Some payment methods also take 2-14 days for payment confirmation. Setting up your integration to listen for asynchronous events enables you to accept multiple payment methods with a single integration.

In addition to handling the checkout.session.completed event, we recommend handling two other events when collecting payments with Checkout:

EventDescriptionNext steps
checkout.session.completedThe customer has successfully authorized the payment by submitting the Checkout form.Wait for the payment to succeed or fail.
checkout.session.async_payment_succeededThe customer’s payment succeeded.Fulfill the purchased goods or services.
checkout.session.async_payment_failedThe payment was declined, or failed for some other reason.Contact the customer through email and request that they place a new order.

These events all include the Checkout Session object. After the payment succeeds, the underlying PaymentIntent status changes from processing to succeeded.

Testing

Test your account creation flow by creating accounts and using OAuth. Test your Payment methods settings for your connected accounts by logging into one of your test accounts and navigating to the Payment methods settings. Test your checkout flow with your test keys and a test account. You can use our test cards to test your payments flow and simulate various payment outcomes.

Payouts

By default, any charge that you create for a connected account accumulates in the connected account’s Stripe balance and is paid out on a daily rolling basis. Standard accounts manage their own payout schedules in their Dashboard.

See also

  • Manage connected accounts in the Dashboard
  • Issue refunds
  • Customize statement descriptors
  • Work with multiple currencies
Was this page helpful?
Need help? Contact Support.
Watch our developer tutorials.
Check out our product changelog.
Questions? Contact Sales.
Powered by Markdoc
You can unsubscribe at any time. Read our privacy policy.
On this page
Prerequisites
Set up Stripe
Create a connected account
Enable payment methods
Accept a payment
Testing
Payouts
See also
Products Used
Connect
Checkout
Elements
Stripe Shell
Test mode
Welcome to the Stripe Shell! Stripe Shell is a browser-based shell with the Stripe CLI pre-installed. Log in to your Stripe account and press Control + Backtick (`) on your keyboard to start managing your Stripe resources in test mode. - View supported Stripe commands: - Find webhook events: - Listen for webhook events: - Call Stripe APIs: stripe [api resource] [operation] (e.g., )
The Stripe Shell is best experienced on desktop.
$