Charge on behalf of a connected account

As a marketplace business using Stripe Connect, you can use the Payment Intents API to create charges on behalf of connected accounts.

Stripe supports several approaches for creating charges on behalf of a connected account.

One approach is a direct charge, in which the connected account is responsible for the cost of the Stripe fees, refunds, and chargebacks. To perform a direct charge with a PaymentIntent, supply the ID of the connected account while creating the PaymentIntent:

curl https://api.stripe.com/v1/payment_intents \ -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \ -d amount=1099 \ -d currency=usd \ -d "payment_method_types[]"=card \ -H "Stripe-Account: {{CONNECTED_ACCOUNT_ID}}"
# Set your secret key. Remember to switch to your live secret key in production! # See your keys here: https://dashboard.stripe.com/account/apikeys Stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc' Stripe::PaymentIntent.create({ amount: 1099, currency: 'usd', payment_method_types: ['card'], }, { stripe_account: '{{CONNECTED_ACCOUNT_ID}}', })
# Set your secret key. Remember to switch to your live secret key in production! # See your keys here: https://dashboard.stripe.com/account/apikeys stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc' stripe.PaymentIntent.create( amount=1099, currency='usd', payment_method_types=['card'], stripe_account='{{CONNECTED_ACCOUNT_ID}}', )
// Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys \Stripe\Stripe::setApiKey('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); \Stripe\PaymentIntent::create([ 'amount' => 1099, 'currency' => 'usd', 'payment_method_types' => ['card'], ], [ 'stripe_account' => '{{CONNECTED_ACCOUNT_ID}}', ]);
// Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys Stripe.apiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"; PaymentIntentCreateParams params = PaymentIntentCreateParams.builder() .setAmount(1099L) .setCurrency("usd") .addPaymentMethodType("card") .build(); RequestOptions requestOptions = RequestOptions.builder() .setStripeAccount("{{CONNECTED_ACCOUNT_ID}}") .build(); PaymentIntent paymentIntent = PaymentIntent.create(params, requestOptions);
// Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys const stripe = require('stripe')('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); const paymentIntent = await stripe.paymentIntents.create({ amount: 1099, currency: 'usd', payment_method_types: ['card'], }, { stripeAccount: '{{CONNECTED_ACCOUNT_ID}}', });
// Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys stripe.Key = "sk_test_4eC39HqLyjWDarjtT1zdp7dc" params := &stripe.PaymentIntentParams{ Amount: stripe.Int64(1099), Currency: stripe.String(string(stripe.CurrencyUSD)), PaymentMethodTypes: stripe.StringSlice([]string{ "card", }), } params.SetStripeAccount("{{CONNECTED_ACCOUNT_ID}}") pi, _ := paymentintent.New(params)
// Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys StripeConfiguration.ApiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"; var options = new PaymentIntentCreateOptions { Amount = 1099, Currency = "usd", PaymentMethodTypes = new List<string> { "card", }, }; var requestOptions = new RequestOptions { StripeAccount = "{{CONNECTED_ACCOUNT_ID}}", }; var service = new PaymentIntentService(); service.Create(options, requestOptions);

Additionally, the Payment Intents API supports creating a transfer to a connected account automatically and setting a connected account as the business of record for the payment.

The transfer_data[destination] is the ID of the connected account that should receive the transfer.

The on_behalf_of parameter is the ID of the connected account to use as the business of record for the payment. When it is set, Stripe automatically:

  • Settles charges in the country of the specified account, thereby minimizing declines and avoiding currency conversions
  • Uses the fee structure for the connected account’s country
  • If the account is in a different country than the platform, the connected account’s address and phone number shows up on the customer’s credit card statement (as opposed to the platform’s)

The transfer_group parameter is propagated to all charges created by the PaymentIntent, and it behaves identically.

Finally, you may withhold an application fee by providing the application_fee_amount parameter:

curl https://api.stripe.com/v1/payment_intents \ -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \ -d amount=1099 \ -d currency=usd \ -d "payment_method_types[]"=card \ -d application_fee_amount=200 \ -d on_behalf_of="{{CONNECTED_ACCOUNT_ID}}" \ -d "transfer_data[destination]"="{{CONNECTED_ACCOUNT_ID}}"
# Set your secret key. Remember to switch to your live secret key in production! # See your keys here: https://dashboard.stripe.com/account/apikeys Stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc' intent = Stripe::PaymentIntent.create({ amount: 1099, currency: 'usd', payment_method_types: ['card'], application_fee_amount: 200, on_behalf_of: '{{CONNECTED_ACCOUNT_ID}}', transfer_data: { destination: '{{CONNECTED_ACCOUNT_ID}}', }, })
# Set your secret key. Remember to switch to your live secret key in production! # See your keys here: https://dashboard.stripe.com/account/apikeys stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc' stripe.PaymentIntent.create( amount=1099, currency='usd', application_fee_amount=200, payment_method_types=['card'], on_behalf_of='{{CONNECTED_ACCOUNT_ID}}', transfer_data={ 'destination': '{{CONNECTED_ACCOUNT_ID}}', }, )
// Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys \Stripe\Stripe::setApiKey('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); \Stripe\PaymentIntent::create([ 'amount' => 1099, 'currency' => 'usd', 'application_fee_amount' => 200, 'payment_method_types' => ['card'], 'on_behalf_of' => '{{CONNECTED_ACCOUNT_ID}}', 'transfer_data' => [ 'destination' => '{{CONNECTED_ACCOUNT_ID}}', ], ]);
// Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys Stripe.apiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"; PaymentIntentCreateParams params = PaymentIntentCreateParams.builder() .setAmount(1099L) .setCurrency("usd") .addPaymentMethodType("card") .setOnBehalfOf("{{CONNECTED_ACCOUNT_ID}}") .setApplicationFeeAmount(200L) .setTransferData( PaymentIntentCreateParams.TransferData.builder() .setDestination("{{CONNECTED_ACCOUNT_ID}}") .build()) .build(); PaymentIntent paymentIntent = PaymentIntent.create(params);
// Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys const stripe = require('stripe')('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); const paymentIntent = await stripe.paymentIntents.create({ amount: 1099, currency: 'usd', payment_method_types: ['card'], application_fee_amount: 200, on_behalf_of: '{{CONNECTED_ACCOUNT_ID}}', transfer_data: { destination: '{{CONNECTED_ACCOUNT_ID}}', }, });
// Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys stripe.Key = "sk_test_4eC39HqLyjWDarjtT1zdp7dc" params := &stripe.PaymentIntentParams{ Amount: stripe.Int64(1099), Currency: stripe.String(string(stripe.CurrencyUSD)), PaymentMethodTypes: stripe.StringSlice([]string{ "card", }), OnBehalfOf: stripe.String("{{CONNECTED_ACCOUNT_ID}}"), ApplicationFeeAmount: stripe.Int64(200), TransferData: &stripe.PaymentIntentTransferDataParams{ Destination: stripe.String("{{CONNECTED_ACCOUNT_ID}}"), }, } pi, _ := paymentintent.New(params)
// Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys StripeConfiguration.ApiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"; var options = new PaymentIntentCreateOptions { Amount = 1099, Currency = "usd", PaymentMethodTypes = new List<string> { "card" }, ApplicationFeeAmount = 200, OnBehalfOf = "{{CONNECTED_ACCOUNT_ID}}", TransferData = new PaymentIntentTransferDataOptions { Destination = "{{CONNECTED_ACCOUNT_ID}}", }, }; var service = new PaymentIntentService(); service.Create(options);

Learn more about accepting marketplace payments in the Connect docs.

Was this page helpful?
Questions? Contact us.
Developer tutorials on YouTube.