Stripe Connect and the Charges API

Learn how Connect lets you make charges and issue transfers for connected accounts. Stripe fees are determined by how you configure these options.

Connect supports three approaches to creating payments for a connected account. For more information about the different types of Connect charges, see the documentation on choosing an approach. Stripe fees are determined by how you configure these options.

This page explains only how to make calls to the Charges API for connected accounts. Check the linked pages for more information about calls to other APIs for related operations.

Direct charges

To create a direct charge on the connected account, create a Charge object and add the Stripe-Account header with a value of the connected account ID:

curl https://api.stripe.com/v1/charges \ -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \ -d amount=1000 \ -d currency=usd \ -d source=tok_visa \ -H "Stripe-Account: {{CONNECTED_STRIPE_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' charge = Stripe::Charge.create({ amount: 1000, currency: "usd", source: "tok_visa", }, stripe_account: "{{CONNECTED_STRIPE_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' charge = stripe.Charge.create( amount=1000, currency="usd", source="tok_visa", stripe_account="{{CONNECTED_STRIPE_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'); $charge = \Stripe\Charge::create([ "amount" => 1000, "currency" => "usd", "source" => "tok_visa", ], ["stripe_account" => "{{CONNECTED_STRIPE_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"; Map<String, Object> params = new HashMap<>(); params.put("amount", 1000); params.put("currency", "usd"); params.put("source", "tok_visa"); RequestOptions requestOptions = RequestOptions.builder().setStripeAccount({{CONNECTED_STRIPE_ACCOUNT_ID}}).build(); Charge charge = Charge.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 charge = await stripe.charges.create({ amount: 1000, currency: "usd", source: "tok_visa", }, { stripe_account: "{{CONNECTED_STRIPE_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.ChargeParams{ Amount: stripe.Int64(1000), Currency: stripe.String(string(stripe.CurrencyUSD)), } params.SetStripeAccount("{{CONNECTED_STRIPE_ACCOUNT_ID}}") params.SetSource("tok_visa") ch, _ := charge.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 service = new ChargeService(); var createOptions = new ChargeCreateOptions { Amount = 1000, Currency = "usd", Source = "tok_visa", } var requestOptions = new RequestOptions(); requestOptions.StripeAccount = "{{CONNECTED_STRIPE_ACCOUNT_ID}}"; service.Create(createOptions, requestOptions);

This example uses a test tokentok_visa—but you could tokenize a test card using Stripe.js and Elements instead.

For a more detailed walkthrough, see the documentation on how to accept a payment.

Collect application fees on direct charges

With Connect, your platform can take an application fee on direct charges. To assess an application fee on a charge, pass an optional application_fee_amount value as a positive integer:

curl https://api.stripe.com/v1/charges \ -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \ -d amount=1000 \ -d currency=usd \ -d source=tok_visa \ -d application_fee_amount=123 \ -H "Stripe-Account: {{CONNECTED_STRIPE_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' charge = Stripe::Charge.create({ amount: 1000, currency: "usd", source: "tok_visa", application_fee_amount: 123, }, stripe_account: "{{CONNECTED_STRIPE_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' charge = stripe.Charge.create( amount=1000, currency="usd", source="tok_visa", application_fee_amount=123, stripe_account="{{CONNECTED_STRIPE_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'); $charge = \Stripe\Charge::create([ "amount" => 1000, "currency" => "usd", "source" => "tok_visa", "application_fee_amount" => 123, ], ["stripe_account" => "{{CONNECTED_STRIPE_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"; Map<String, Object> params = new HashMap<>(); params.put("amount", 1000); params.put("currency", "usd"); params.put("source", "tok_visa"); params.put("application_fee_amount", 123); RequestOptions requestOptions = RequestOptions.builder().setStripeAccount({{CONNECTED_STRIPE_ACCOUNT_ID}}).build(); Charge charge = Charge.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 charge = await stripe.charges.create({ amount: 1000, currency: "usd", source: "tok_visa", application_fee_amount: 123, }, { stripe_account: "{{CONNECTED_STRIPE_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.ChargeParams{ Amount: stripe.Int64(1000), Currency: stripe.String(string(stripe.CurrencyUSD)), ApplicationFeeAmount: stripe.Int64(123), } params.SetStripeAccount("{{CONNECTED_STRIPE_ACCOUNT_ID}}") params.SetSource("tok_visa") ch, _ := charge.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 service = new ChargeService(); var createOptions = new ChargeCreateOptions { Amount = 1000, Currency = "usd", Source = "tok_visa", ApplicationFeeAmount = 123, } var requestOptions = new RequestOptions(); requestOptions.StripeAccount = "{{CONNECTED_STRIPE_ACCOUNT_ID}}"; service.Create(createOptions, requestOptions);

More information about direct charges

For information about other aspects of direct charges, including transfer availability and refunds, see the main page about this charge type.

Destination charges

To create a destination charge, specify the ID of the connected account that should receive the funds as the value of the transfer_data[destination] parameter:

curl https://api.stripe.com/v1/charges \ -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \ -d amount=1000 \ -d currency=usd \ -d source=tok_visa \ -d "transfer_data[destination]"="{{CONNECTED_STRIPE_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' charge = Stripe::Charge.create({ amount: 1000, currency: "usd", source: "tok_visa", transfer_data: { destination: "{{CONNECTED_STRIPE_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' charge = stripe.Charge.create( amount=1000, currency="usd", source="tok_visa", transfer_data={ "destination": "{{CONNECTED_STRIPE_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'); $charge = \Stripe\Charge::create([ "amount" => 1000, "currency" => "usd", "source" => "tok_visa", "transfer_data" => [ "destination" => "{{CONNECTED_STRIPE_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"; Map<String, Object> params = new HashMap<>(); params.put("amount", 1000); params.put("currency", "usd"); params.put("source", "tok_visa"); Map<String, Object> transferDataParams = new HashMap<>(); transferDataParams.put("destination", "{{CONNECTED_STRIPE_ACCOUNT_ID}}"); params.put("transfer_data", transferDataParams); Charge charge = Charge.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 charge = await stripe.charges.create({ amount: 1000, currency: "usd", source: "tok_visa", transfer_data: { destination: "{{CONNECTED_STRIPE_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.ChargeParams{ Amount: stripe.Int64(1000), Currency: stripe.String(string(stripe.CurrencyUSD)), TransferData: &stripe.DestinationParams{ Destination: stripe.String("{{CONNECTED_STRIPE_ACCOUNT_ID}}"), }, } params.SetSource("tok_visa") ch, _ := charge.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 service = new ChargeService(); var createOptions = new ChargeCreateOptions { Amount = 1000, Currency = "usd", Source = "tok_visa", TransferData = new ChargeTransferDataOptions { Destination = "{{CONNECTED_STRIPE_ACCOUNT_ID}}", }, } service.Create(createOptions);

This example uses a test tokentok_visa—but you could tokenize a test card using Stripe.js and Elements instead.

For a more detailed walkthrough, see the documentation on how to accept a payment.

Collect fees on destination charges with application_fee_amount

When creating destination charges with an application_fee_amount, the full charge amount is immediately transferred from the platform to the transfer_data[destination] account after the charge is captured. The application_fee_amount (capped at the full amount of the charge) is then transferred back to the platform.

curl https://api.stripe.com/v1/charges \ -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \ -d amount=1000 \ -d currency=usd \ -d source=tok_visa \ -d application_fee_amount=123 \ -d "transfer_data[destination]"="{{CONNECTED_STRIPE_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' charge = Stripe::Charge.create({ amount: 1000, currency: "usd", source: "tok_visa", application_fee_amount: 123, transfer_data: { destination: "{{CONNECTED_STRIPE_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' charge = stripe.Charge.create( amount=1000, currency="usd", source="tok_visa", application_fee_amount=123, transfer_data={ "destination": "{{CONNECTED_STRIPE_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'); $charge = \Stripe\Charge::create([ "amount" => 1000, "currency" => "usd", "source" => "tok_visa", "application_fee_amount" => 123, "transfer_data" => [ "destination" => "{{CONNECTED_STRIPE_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"; Map<String, Object> params = new HashMap<>(); params.put("amount", 1000); params.put("currency", "usd"); params.put("source", "tok_visa"); params.put("application_fee_amount", 123); Map<String, Object> transferDataParams = new HashMap<>(); transferDataParams.put("destination", "{{CONNECTED_STRIPE_ACCOUNT_ID}}"); params.put("transfer_data", transferDataParams); Charge charge = Charge.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 charge = await stripe.charges.create({ amount: 1000, currency: "usd", source: "tok_visa", application_fee_amount: 123, transfer_data: { destination: "{{CONNECTED_STRIPE_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.ChargeParams{ Amount: stripe.Int64(1000), Currency: stripe.String(string(stripe.CurrencyUSD)), ApplicationFeeAmount: stripe.Int64(123), TransferData: &stripe.DestinationParams{ Destination: stripe.String("{{CONNECTED_STRIPE_ACCOUNT_ID}}"), }, } params.SetSource("tok_visa") ch, _ := charge.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 service = new ChargeService(); var createOptions = new ChargeCreateOptions { Amount = 1000, Currency = "usd", Source = "tok_visa", ApplicationFeeAmount = 123, TransferData = new ChargeTransferDataOptions { Destination = "{{CONNECTED_STRIPE_ACCOUNT_ID}}", }, } service.Create(createOptions);

To provide a better reporting experience, an application fee object is created once the application fee is collected. Use the amount property on the application fee object for reporting. You can then access these objects with the Application Fees endpoint.

Collect fees on destination charges with transfer_data[amount]

You can also take a fee by using transfer_data[amount].

The transfer_data[amount] is a positive integer reflecting the amount of the charge to be transferred to the transfer_data[destination]. You subtract your platform’s fees from the charge amount, then pass the result of this calculation as the transfer_data[amount]:

curl https://api.stripe.com/v1/charges \ -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \ -d amount=1000 \ -d currency=usd \ -d source=tok_visa \ -d "transfer_data[amount]"=877 \ -d "transfer_data[destination]"="{{CONNECTED_STRIPE_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' charge = Stripe::Charge.create({ amount: 1000, currency: "usd", source: "tok_visa", transfer_data: { amount: 877, destination: "{{CONNECTED_STRIPE_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' charge = stripe.Charge.create( amount=1000, currency="usd", source="tok_visa", transfer_data={ "amount": 877, "destination": "{{CONNECTED_STRIPE_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'); $charge = \Stripe\Charge::create([ "amount" => 1000, "currency" => "usd", "source" => "tok_visa", "transfer_data" => [ "amount" => 877, "destination" => "{{CONNECTED_STRIPE_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"; Map<String, Object> params = new HashMap<>(); params.put("amount", 1000); params.put("currency", "usd"); params.put("source", "tok_visa"); Map<String, Object> transferDataParams = new HashMap<>(); transferDataParams.put("amount", 877); transferDataParams.put("destination", "{{CONNECTED_STRIPE_ACCOUNT_ID}}"); params.put("transfer_data", transferDataParams); Charge charge = Charge.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 charge = await stripe.charges.create({ amount: 1000, currency: "usd", source: "tok_visa", transfer_data: { amount: 877, destination: "{{CONNECTED_STRIPE_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.ChargeParams{ Amount: stripe.Int64(1000), Currency: stripe.String(string(stripe.CurrencyUSD)), TransferData: &stripe.DestinationParams{ Amount: stripe.Int64(877), Destination: stripe.String("{{CONNECTED_STRIPE_ACCOUNT_ID}}"), }, } params.SetSource("tok_visa") ch, _ := charge.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 service = new ChargeService(); var createOptions = new ChargeCreateOptions { Amount = 1000, Currency = "usd", Source = "tok_visa", TransferData = new ChargeTransferDataOptions { Amount = 877, Destination = "{{CONNECTED_STRIPE_ACCOUNT_ID}}", }, } service.Create(createOptions);

More information about destination charges

For information about other aspects of destination charges, including transfer availability and refunds, see the main page about this charge type.

Separate charges and transfers

To create a charge and set up the associated transfer, create a transfer_group and assign the charge to the transfer_group.

# Create a Charge: curl https://api.stripe.com/v1/charges \ -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \ -d amount=10000 \ -d currency=usd \ -d source=tok_visa \ -d transfer_group="{ORDER10}" # Create a Transfer to a connected account (later): curl https://api.stripe.com/v1/transfers \ -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \ -d amount=7000 \ -d currency=usd \ -d destination="{{CONNECTED_STRIPE_ACCOUNT_ID}}" \ -d transfer_group="{ORDER10}" # Create a second Transfer to another connected account (later): curl https://api.stripe.com/v1/transfers \ -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \ -d amount=2000 \ -d currency=usd \ -d destination="{{OTHER_CONNECTED_STRIPE_ACCOUNT_ID}}" \ -d transfer_group="{ORDER10}"
# 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' # Create a Charge: charge = Stripe::Charge.create({ amount: 10000, currency: 'usd', source: 'tok_visa', transfer_group: '{ORDER10}', }) # Create a Transfer to a connected account (later): transfer = Stripe::Transfer.create({ amount: 7000, currency: 'usd', destination: '{{CONNECTED_STRIPE_ACCOUNT_ID}}', transfer_group: '{ORDER10}', }) # Create a second Transfer to another connected account (later): transfer = Stripe::Transfer.create({ amount: 2000, currency: 'usd', destination: '{{OTHER_CONNECTED_STRIPE_ACCOUNT_ID}}', transfer_group: '{ORDER10}', })
# 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' # Create a Charge: charge = stripe.Charge.create( amount=10000, currency='usd', source='tok_visa', transfer_group='{ORDER10}', ) # Create a Transfer to a connected account (later): transfer = stripe.Transfer.create( amount=7000, currency='usd', destination='{{CONNECTED_STRIPE_ACCOUNT_ID}}', transfer_group='{ORDER10}', ) # Create a second Transfer to another connected account (later): transfer = stripe.Transfer.create( amount=2000, currency='usd', destination='{{OTHER_CONNECTED_STRIPE_ACCOUNT_ID}}', transfer_group='{ORDER10}', )
// 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'); // Create a Charge: $charge = \Stripe\Charge::create([ 'amount' => 10000, 'currency' => 'usd', 'source' => 'tok_visa', 'transfer_group' => '{ORDER10}', ]); // Create a Transfer to a connected account (later): $transfer = \Stripe\Transfer::create([ 'amount' => 7000, 'currency' => 'usd', 'destination' => '{{CONNECTED_STRIPE_ACCOUNT_ID}}', 'transfer_group' => '{ORDER10}', ]); // Create a second Transfer to another connected account (later): $transfer = \Stripe\Transfer::create([ 'amount' => 2000, 'currency' => 'usd', 'destination' => '{{OTHER_CONNECTED_STRIPE_ACCOUNT_ID}}', 'transfer_group' => '{ORDER10}', ]);
// 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"; ChargeCreateParams params = ChargeCreateParams.builder() .setAmount(10000L) .setCurrency("usd") .setSource("tok_visa") .setTransferGroup("{ORDER10}") .build(); Charge charge = Charge.create(params); TransferCreateParams transferParams = TransferCreateParams.builder() .setAmount(7000L) .setCurrency("usd") .setDestination("{{CONNECTED_STRIPE_ACCOUNT_ID}}") .setTransferGroup("{ORDER10}") .build(); Transfer transfer = Transfer.create(transferParams); TransferCreateParams secondTransferParams = TransferCreateParams.builder() .setAmount(2000L) .setCurrency("usd") .setDestination("{{OTHER_CONNECTED_STRIPE_ACCOUNT_ID}}") .setTransferGroup("{ORDER10}") .build(); Transfer secondTransfer = Transfer.create(secondTransferParams);
// 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'); // Create a Charge: const charge = await stripe.charges.create({ amount: 10000, currency: 'usd', source: 'tok_visa', transfer_group: '{ORDER10}', }); // Create a Transfer to the connected account (later): const transfer = await stripe.transfers.create({ amount: 7000, currency: 'usd', destination: '{{CONNECTED_STRIPE_ACCOUNT_ID}}', transfer_group: '{ORDER10}', }); // Create a second Transfer to another connected account (later): const secondTransfer = await stripe.transfers.create({ amount: 2000, currency: 'usd', destination: '{{OTHER_CONNECTED_STRIPE_ACCOUNT_ID}}', transfer_group: '{ORDER10}', });
// 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" // Create a Charge: chargeParams := &stripe.ChargeParams{ Amount: stripe.Int64(10000), Currency: stripe.String(string(stripe.CurrencyUSD)), TransferGroup: stripe.String("{ORDER10}"), } params.SetSource("tok_visa") ch, _ := charge.New(chargeParams) // Create a Transfer to the connected account (later): transferParams := &stripe.TransferParams{ Amount: stripe.Int64(7000), Currency: stripe.String(string(stripe.CurrencyUSD)), Destination: stripe.String("{{CONNECTED_STRIPE_ACCOUNT_ID}}"), TransferGroup: stripe.String("{ORDER10}"), } tr, _ := transfer.New(transferParams) // Create a second Transfer to another connected account (later): secondTransferParams := &stripe.TransferParams{ Amount: stripe.Int64(2000), Currency: stripe.String(string(stripe.CurrencyUSD)), Destination: stripe.String("{{OTHER_CONNECTED_STRIPE_ACCOUNT_ID}}"), TransferGroup: stripe.String("{ORDER10}"), } secondTransfer, _ := transfer.New(secondTransferParams)
// 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"; // Create a Charge: var chargeOptions = new ChargeCreateOptions { Amount = 10000, Currency = "usd", TransferGroup = "{ORDER10}", }; var chargeService = new ChargeService(); var charge = chargeService.Create(chargeOptions); // Create a Transfer to the connected account (later): var transferOptions = new TransferCreateOptions { Amount = 7000, Currency = "usd", Destination = "{{CONNECTED_STRIPE_ACCOUNT_ID}}", TransferGroup = "{ORDER10}", }; var transferService = new TransferService(); var transfer = transferService.Create(transferOptions); // Create a second Transfer to another connected account (later): var secondTransferOptions = new TransferCreateOptions { Amount = 2000, Currency = "usd", Destination = "{{OTHER_CONNECTED_STRIPE_ACCOUNT_ID}}", TransferGroup = "{ORDER10}", }; var secondTransfer = transferService.Create(secondTransferOptions);

This example uses a test tokentok_visa—but you could tokenize a test card using Stripe.js and Elements instead.

For a more detailed walkthrough, see the documentation on how to accept a payment.

Using on_behalf_of with separate charges and transfers

With separate charges and transfers, by default:

  • Charges are settled in the platform’s country
  • The fee structure for the platform’s country is used
  • The platform’s information is displayed on the customer’s credit card statement

To use the connected account’s country, and to display their information instead, use the on_behalf_of argument.

curl https://api.stripe.com/v1/charges \ -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \ -d amount=1000 \ -d currency=usd \ -d source=tok_visa \ -d on_behalf_of="{{CONNECTED_STRIPE_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' charge = Stripe::Charge.create({ amount: 1000, currency: "usd", source: "tok_visa", on_behalf_of: "{{CONNECTED_STRIPE_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' charge = stripe.Charge.create( amount=1000, currency="usd", source="tok_visa", on_behalf_of="{{CONNECTED_STRIPE_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'); $charge = \Stripe\Charge::create([ "amount" => 1000, "currency" => "usd", "source" => "tok_visa", "on_behalf_of" => "{{CONNECTED_STRIPE_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"; Map<String, Object> params = new HashMap<>(); params.put("amount", 1000); params.put("currency", "usd"); params.put("source", "tok_visa"); params.put("on_behalf_of", "{{CONNECTED_STRIPE_ACCOUNT_ID}}"); Charge charge = Charge.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 charge = await stripe.charges.create({ amount: 1000, currency: "usd", source: "tok_visa", on_behalf_of: "{{CONNECTED_STRIPE_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.ChargeParams{ Amount: stripe.Int64(1000), Currency: stripe.String(string(stripe.CurrencyUSD)), OnBehalfOf: stripe.String("{{CONNECTED_STRIPE_ACCOUNT_ID}}"), } params.SetSource("tok_visa") ch, _ := charge.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 service = new ChargeService(); var createOptions = new ChargeCreateOptions { Amount = 1000, Currency = "usd", Source = "tok_visa", OnBehalfOf = "{{CONNECTED_STRIPE_ACCOUNT_ID}}", } service.Create(createOptions);

More information about separate charges and transfers

For information about other aspects of separate charges and transfers, including transfer availability and refunds, see the main page about this charge type.

Was this page helpful?
Questions? Contact us.
Developer tutorials on YouTube.
You can unsubscribe at any time. Read our privacy policy.