With Connect, you can create payment links for connected accounts, optionally taking fees in the process.
You can create payment links for payments to connected accounts. Payment links support all charge types and allow your platform to take an application fee.
Create a payment link using direct charges
In the Dashboard, open the Payment Links page and click + New.
On the Payment page tab, select an existing product or click + Add a new product.
On the Payment page tab, use the Options and Advanced options to customize the payment link.
On the After payment tab, select Split the payment with a connected account. Then select the connected account and enter the application fee amount. For single payments, the fee is a fixed amount. For recurring payments, the fee is a percentage.
Click Create link.
When a customer buys a product through this payment link, the connected account receives the payment minus any application fee, which goes to your platform balance.
When you use direct charges, the connected account is responsible for the cost of the Stripe fees, refunds, and chargebacks.
Create a payment link using destination charges
In the Dashboard, open the Payment Links page and click + New.
On the Payment page tab, select an existing product or click + Add a new product.
On the Payment page tab, use the Options and Advanced options to customize the payment link.
On the After payment tab, select Split the payment with a connected account. Then select the connected account and enter the application fee amount. For single payments, the fee is a fixed amount. For recurring payments, the fee is a percentage. The application fee should be large enough to cover the Stripe fees that your platform pays. Leave Make payment on behalf of selected account unchecked.
Click Create link.
When a customer buys a product through this payment link, the platform receives the payment. The funds then automatically transfer to the connected account minus any application fee, which remains in your platform balance.
When creating destination charges with a payment link, the payment page uses your platform’s brand settings. See the Customize branding section for more information.
Create a payment link using destination charges and on_behalf_of
In the Dashboard, open the Payment Links page and click + New.
On the Payment page tab, select an existing product or click + Add a new product.
On the Payment page tab, use the Options and Advanced options to customize the payment link.
On the After payment tab, select Split the payment with a connected account and select the correct connected account.
Under How much should your business keep?, enter an amount for the application fee. For single payments, the fee is a fixed amount. For recurring payments, the fee is a percentage.
Select Make payment on behalf of selected account to specify the connected account as the settlement merchant.
Click Create link.
Create a payment using separate charges and transfers
If you want to explicitly control the transfer of funds to connected accounts, for example when splitting funds from a single payment between multiple connected accounts, you can create a payment link using separate charges and transfers. These payments don’t automatically transfer any funds to connected accounts.
In the Dashboard, open the Payment Links page and click + New.
On the Payment page tab, select an existing product or click + Add a new product.
On the Payment page tab, use the Options and Advanced options to customize the payment link.
On the After payment tab, leave Split the payment with a connected account unselected.
Click Create link.
When you’re ready to pay your connected account, go to the Balance section of the connected account’s details page and click Send funds.
Enter an amount to transfer to the connected account. To charge an application fee, reduce the transfer amount by the amount of the fee.
Fulfill orders placed through payment links
After an end user pays through a payment link you need to enable your connected accounts to handle any fulfillment necessary.
Then create an HTTP endpoint on your server to monitor for completed payments. Make sure to replace the endpoint secret key (whsec_...) in the example with your key.
server.rb
Ruby
Python
PHP
Java
Node.js
Go
.NET
No results
# Using Sinatra.require'sinatra'require'stripe'
set :port,4242# Set your secret key. Remember to switch to your live secret key in production.# See your keys here: https://dashboard.stripe.com/apikeysStripe.api_key =
'sk_test_BQokikJOvBiI2HlWgH4olfQ2'
# If you are testing your webhook locally with the Stripe CLI you# can find the endpoint's secret by running `stripe listen`# Otherwise, find your endpoint's secret in your webhook settings in# the Developer Dashboard
endpoint_secret ='whsec_...'
post '/webhook'do
payload = request.body.read
sig_header = request.env['HTTP_STRIPE_SIGNATURE']
event =nil# Verify webhook signature and extract the event.# See https://stripe.com/docs/webhooks#verify-events for more information.begin
event =Stripe::Webhook.construct_event(
payload, sig_header, endpoint_secret
)rescueJSON::ParserError=> e
# Invalid payload.
status 400returnrescueStripe::SignatureVerificationError=> e
# Invalid Signature.
status 400returnendif event['type']=='checkout.session.completed'
session = event['data']['object']
connected_account_id = event['account']
handle_completed_checkout_session(connected_account_id, session)end
status 200enddefhandle_completed_checkout_session(connected_account_id, session)# Fulfill the purchase
puts 'Connected account ID: '+ connected_account_id
puts session.to_s
end