Creating direct charges

    With Connect, you can make charges directly on the connected account and take fees in the process.

    Direct charges are recommended for Standard accounts. The connected account is responsible for Stripe fees, refunds, and chargebacks. For more information about the different types of Connect charges, see the documentation on choosing an approach.

    To create a direct charge on the connected account, provide the connected account ID as the value of the Stripe-Account header:

    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 change this 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 change this 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 change this 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 change this 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<String, Object>();
    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 change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    const stripe = require('stripe')('sk_test_4eC39HqLyjWDarjtT1zdp7dc');
    
    stripe.charges.create({
      amount: 1000,
      currency: "usd",
      source: "tok_visa",
    }, {
      stripe_account: "{{CONNECTED_STRIPE_ACCOUNT_ID}}",
    }).then(function(charge) {
      // asynchronously called
    });
    
    // Set your secret key: remember to change this 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")
    
    charge, err := charge.New(params)
    
    // Set your secret key: remember to change this 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.

    This example shows how to specify the connected account as part of the larger payment flow required by the new Payments APIs.

    curl https://api.stripe.com/v1/payment_intents \
      -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \
      -d "payment_method_types[]"=card \
      -d amount=1000 \
      -d currency=usd \
      -H "Stripe-Account: {{CONNECTED_STRIPE_ACCOUNT_ID}}"
    
    # Set your secret key: remember to change this to your live secret key in production
    # See your keys here: https://dashboard.stripe.com/account/apikeys
    Stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc'
    
    payment_intent = Stripe::PaymentIntent.create({
      payment_method_types: ['card'],
      amount: 1000,
      currency: 'usd',
    }, stripe_account: '{{CONNECTED_STRIPE_ACCOUNT_ID}}')
    
    # Set your secret key: remember to change this to your live secret key in production
    # See your keys here: https://dashboard.stripe.com/account/apikeys
    stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc'
    
    payment_intent = stripe.PaymentIntent.create(
      payment_method_types: ['card'],
      amount=1000,
      currency='usd',
      stripe_account='{{CONNECTED_STRIPE_ACCOUNT_ID}}',
    )
    
    // Set your secret key: remember to change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    \Stripe\Stripe::setApiKey('sk_test_4eC39HqLyjWDarjtT1zdp7dc');
    
    $payment_intent = \Stripe\PaymentIntent::create([
      'payment_method_types' => ['card'],
      'amount' => 1000,
      'currency' => 'usd',
    ], ['stripe_account' => '{{CONNECTED_STRIPE_ACCOUNT_ID}}']);
    
    // Set your secret key: remember to change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    Stripe.apiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc";
    
    ArrayList paymentMethodTypes = new ArrayList();
    paymentMethodTypes.add("card");
    
    Map<String, Object> params = new HashMap<String, Object>();
    params.put("payment_method_types", paymentMethodTypes);
    params.put("amount", 1000);
    params.put("currency", "usd");
    
    RequestOptions requestOptions = RequestOptions.builder().setStripeAccount({{CONNECTED_STRIPE_ACCOUNT_ID}}).build();
    PaymentIntent paymentIntent = PaymentIntent.create(params, requestOptions);
    
    // Set your secret key: remember to change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    const stripe = require('stripe')('sk_test_4eC39HqLyjWDarjtT1zdp7dc');
    
    stripe.paymentIntents.create({
      payment_method_types: ['card'],
      amount: 1000,
      currency: 'usd',
    }, {
      stripe_account: '{{CONNECTED_STRIPE_ACCOUNT_ID}}',
    }).then(function(paymentIntent) {
      // asynchronously called
    });
    
    // Set your secret key: remember to change this 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{
      PaymentMethodTypes: stripe.StringSlice([]string{
        "card",
      }),
      Amount: stripe.Int64(1000),
      Currency: stripe.String(string(stripe.CurrencyUSD)),
    }
    params.SetStripeAccount("{{CONNECTED_STRIPE_ACCOUNT_ID}}")
    pi, err := paymentintent.New(params)
    
    // Set your secret key: remember to change this 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 PaymentIntentService();
    var createOptions = new PaymentIntentCreateOptions
    {
      PaymentMethodTypes = new List<string>
      {
        "card",
      },
      Amount = 2000,
      Currency = "usd",
    };
    
    var requestOptions = new RequestOptions();
    requestOptions.StripeAccount = "{{CONNECTED_STRIPE_ACCOUNT_ID}}";
    service.Create(createOptions, requestOptions);
    

    For the complete flow, see the documentation on how to Accept a payment.

    Charges created directly on the connected account are reported only on that account; they aren’t shown in your platform’s Dashboard, exports, or other reporting, although you can always retrieve this information via the API.

    Collect application fees

    With Connect, your platform can take an application fee on direct charges and subscriptions. 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 change this 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 change this 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 change this 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 change this 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<String, Object>();
    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 change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    const stripe = require('stripe')('sk_test_4eC39HqLyjWDarjtT1zdp7dc');
    
    stripe.charges.create({
      amount: 1000,
      currency: "usd",
      source: "tok_visa",
      application_fee_amount: 123,
    }, {
      stripe_account: "{{CONNECTED_STRIPE_ACCOUNT_ID}}",
    }).then(function(charge) {
      // asynchronously called
    });
    
    // Set your secret key: remember to change this 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")
    
    charge, err := charge.New(params)
    
    // Set your secret key: remember to change this 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);
    
    curl https://api.stripe.com/v1/payment_intents \
      -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \
      -d "payment_method_types[]"=card \
      -d amount=1000 \
      -d currency=usd \
      -d application_fee_amount=123 \
      -H "Stripe-Account: {{CONNECTED_STRIPE_ACCOUNT_ID}}"
    
    # Set your secret key: remember to change this to your live secret key in production
    # See your keys here: https://dashboard.stripe.com/account/apikeys
    Stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc'
    
    payment_intent = Stripe::PaymentIntent.create({
      payment_method_types: ['card'],
      amount: 1000,
      currency: 'usd',
      application_fee_amount: 123,
    }, stripe_account: '{{CONNECTED_STRIPE_ACCOUNT_ID}}')
    
    # Set your secret key: remember to change this to your live secret key in production
    # See your keys here: https://dashboard.stripe.com/account/apikeys
    stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc'
    
    payment_intent = stripe.PaymentIntent.create(
      payment_method_types: ['card'],
      amount=1000,
      currency='usd',
      application_fee_amount=123,
      stripe_account='{{CONNECTED_STRIPE_ACCOUNT_ID}}',
    )
    
    // Set your secret key: remember to change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    \Stripe\Stripe::setApiKey('sk_test_4eC39HqLyjWDarjtT1zdp7dc');
    
    $payment_intent = \Stripe\PaymentIntent::create([
      'payment_method_types' => ['card'],
      'amount' => 1000,
      'currency' => 'usd',
      'application_fee_amount' => 123,
    ], ['stripe_account' => '{{CONNECTED_STRIPE_ACCOUNT_ID}}']);
    
    // Set your secret key: remember to change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    Stripe.apiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc";
    
    ArrayList paymentMethodTypes = new ArrayList();
    paymentMethodTypes.add("card");
    
    Map<String, Object> params = new HashMap<String, Object>();
    params.put("payment_method_types", paymentMethodTypes);
    params.put("amount", 1000);
    params.put("currency", "usd");
    params.put("application_fee_amount", 123);
    
    RequestOptions requestOptions = RequestOptions.builder().setStripeAccount({{CONNECTED_STRIPE_ACCOUNT_ID}}).build();
    PaymentIntent paymentIntent = PaymentIntent.create(params, requestOptions);
    
    // Set your secret key: remember to change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    const stripe = require('stripe')('sk_test_4eC39HqLyjWDarjtT1zdp7dc');
    
    stripe.paymentIntents.create({
      payment_method_types: ['card'],
      amount: 1000,
      currency: 'usd',
      application_fee_amount: 123,
    }, {
      stripe_account: '{{CONNECTED_STRIPE_ACCOUNT_ID}}',
    }).then(function(paymentIntent) {
      // asynchronously called
    });
    
    // Set your secret key: remember to change this 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{
      PaymentMethodTypes: stripe.StringSlice([]string{
        "card",
      }),
      Amount: stripe.Int64(1000),
      Currency: stripe.String(string(stripe.CurrencyUSD)),
      ApplicationFeeAmount: stripe.Int64(123),
    }
    params.SetStripeAccount("{{CONNECTED_STRIPE_ACCOUNT_ID}}")
    pi, err := paymentintent.New(params)
    
    // Set your secret key: remember to change this 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 PaymentIntentService();
    var createOptions = new PaymentIntentCreateOptions
    {
      PaymentMethodTypes = new List<string>
      {
        "card",
      },
      Amount = 2000,
      Currency = "usd",
      ApplicationFeeAmount = 123,
    };
    
    var requestOptions = new RequestOptions();
    requestOptions.StripeAccount = "{{CONNECTED_STRIPE_ACCOUNT_ID}}";
    service.Create(createOptions, requestOptions);
    

    Note the following limitations:

    • The value of application_fee_amount can be any positive number up to the amount of the charge.
    • There are no additional Stripe fees on the application fee itself.
    • The currency of application_fee_amount depends upon a few multiple currency factors.

    The resulting charge’s balance transaction includes a detailed fee breakdown of both the Stripe and application fees. To provide a better reporting experience, an application fee object is created once the 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.

    Earned application fees are added to your available account balance on the same schedule as funds from regular Stripe charges. Application fees are viewable in the Collected Fees section of the Dashboard.

    Flow of funds with fees

    When you specify an application fee on a charge, the fee amount is transferred to your platform’s Stripe account. When processing a charge directly on the connected account, the charge amount—less the Stripe fees and application fee—is deposited into the connected account. For example, if a charge of $10 with a $1.23 application fee is made (as in the example above), $1.23 is transferred to your platform account, and $8.18 ($10 - $0.59 - $1.23) is netted in the connected account (assuming standard U.S. Stripe fees).

    If you process payments in multiple currencies, you should also read how that is handled in Connect.

    Issue refunds

    Just as platforms can create charges on connected accounts, they can also create refunds of charges on connected accounts. To refund a charge on a connected account, perform a standard create refund request using your platform’s secret key while authenticated as the connected account.

    Application fees are not automatically refunded when issuing a refund. Your platform must explicitly refund the application fee or the connected user—the account on which the charge was created—loses that amount.

    You can refund an application fee by passing a refund_application_fee value of true in the refund request:

    curl https://api.stripe.com/v1/refunds \
      -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \
      -d charge="{CHARGE_ID}" \
      -d refund_application_fee=true \
      -H "Stripe-Account: {{CONNECTED_STRIPE_ACCOUNT_ID}}"
    
    # Set your secret key: remember to change this to your live secret key in production
    # See your keys here: https://dashboard.stripe.com/account/apikeys
    Stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc'
    
    refund = Stripe::Refund.create({
      charge: "{CHARGE_ID}",
      refund_application_fee: true,
    }, stripe_account: "{{CONNECTED_STRIPE_ACCOUNT_ID}}")
    
    # Set your secret key: remember to change this to your live secret key in production
    # See your keys here: https://dashboard.stripe.com/account/apikeys
    stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc'
    
    refund = stripe.Refund.create(
      charge="{CHARGE_ID}",
      refund_application_fee=True,
              stripe_account="{{CONNECTED_STRIPE_ACCOUNT_ID}}",
    )
    // Set your secret key: remember to change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    \Stripe\Stripe::setApiKey('sk_test_4eC39HqLyjWDarjtT1zdp7dc');
    
    $refund = \Stripe\Refund::create([
      "charge" => "{CHARGE_ID}",
      "refund_application_fee" => true,
    ], ["stripe_account" => "{{CONNECTED_STRIPE_ACCOUNT_ID}}"]);
    
    // Set your secret key: remember to change this 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<String, Object>();
    params.put("charge", "{CHARGE_ID}");
    params.put("refund_application_fee", true);
    
    RequestOptions requestOptions = RequestOptions.builder().setStripeAccount({{CONNECTED_STRIPE_ACCOUNT_ID}}).build();
    Refund refund = Refund.create(params, requestOptions);
    
    // Set your secret key: remember to change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    const stripe = require('stripe')('sk_test_4eC39HqLyjWDarjtT1zdp7dc');
    
    stripe.refunds.create({
      charge: "{CHARGE_ID}",
      refund_application_fee: true,
    }, {
      stripe_account: "{{CONNECTED_STRIPE_ACCOUNT_ID}}",
    }).then(function(refund) {
      // asynchronously called
    });
    
    // Set your secret key: remember to change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    stripe.Key = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"
    
    params := &stripe.RefundParams{
      Charge: stripe.String("{CHARGE_ID}"),
      RefundApplicationFee: stripe.Bool(true),
    }
    params.SetStripeAccount("{{CONNECTED_STRIPE_ACCOUNT_ID}}")
    refund, err := refund.New(params)
    

    By default, the entire charge is refunded, but you can create a partial refund by setting an amount value as a positive integer.

    If the refund results in the entire charge being refunded, the entire application fee is refunded. Otherwise, a proportional amount of the application fee is refunded.

    Alternatively, you can provide a refund_application_fee value of false and refund the application fee separately through the API.

    Further reading

    Discover what other Connect functionality is available.

    Was this page helpful?

    Thank you for helping improve Stripe's documentation. If you need help or have any questions, please consider contacting support.

    On this page