Create account
Sign in
Home
Payments
Business operations
Financial services
Developer tools
Security
All products
Home
Payments
Business operations
Home
Payments
Business operations
Financial services
Developer tools
Support
Overview
Overview
Get started
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
Service agreement types
Account capabilities
Accept payments
Create a charge
Create a payments page
Add payment methods
Set statement descriptors
Clone customers across accounts
Create a subscription
Debit connected accounts
Pay out
Set bank and debit card payouts
Bank accounts
Manage payout schedule
Manual payouts
Payout reversals
Instant Payouts
Cross-border payouts
Manage funds
Add money to your platform balance
Account balance
Handle other currencies
Manage accounts
Best practices
Listen for updates
Dashboard account management
Platform controls for Standard accounts
Make API calls for connected accounts
Set MCCs
Testing
Manage tax forms
Overview
Get started with tax reporting
Tax form settings
Calculation methods
File tax forms
File tax forms with states
Modify tax forms
Deliver tax forms
Tax reporting for Payable users
Testing
connect
·
HomePaymentsMultiparty payments

Creating subscriptions with Connect

With Connect, you can create subscriptions for connected accounts, optionally taking fees in the process.

You can now model subscriptions more flexibly using the Prices API. It replaces the Plans API and is backwards compatible to simplify your migration. If you're new to Stripe, learn how to create products and prices. If you already use the Plans API, learn how to update your integration.

Learn more about Connect

Don’t know much about Connect yet? Check out the overview.

Pricing

Subscription transactions are based on Billing pricing.

Through Connect, business models such as marketplaces and software platforms can use Stripe Billing to support recurring subscriptions. For example:

  • In addition to powering payments, software platforms can also create subscriptions for their end users.
  • Marketplaces may support subscription membership in addition to one time purchases.

You can create subscriptions for connected accounts, which supports several approaches for collecting payments. Subscriptions can be created directly on the connected account using direct charges, or on the platform with transfers to the connected account using destination charges. You can also take an application fee percentage on those subscription payments.

Restrictions

Using subscriptions with Connect has these restrictions:

  • Your platform can’t update or cancel a subscription that it did not create.
  • Your platform can’t add an application_fee_amount to an invoice that it didn’t create, nor to an invoice that contains invoice items the platform didn’t create.

Creating a subscription using direct charges

To create a subscription that directly charges on a connected account, make a create subscription call while authenticated as the connected account. For this to work, both the customer and the price must be defined on the connected account.

For an end-to-end example of how to implement a subscription signup and payment flow in your application, see the fixed-price guide.

curl Ruby Python PHP Java Node Go .NET
curl https://api.stripe.com/v1/subscriptions \ -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \ -d customer=cus_4fdAW5ftNQow1a \ -d "items[0][price]"=price_H1y51TElsOZjG \ -d "expand[]"="latest_invoice.payment_intent" \ -H "Stripe-Account: {{CONNECTED_STRIPE_ACCOUNT_ID}}"
curl https://api.stripe.com/v1/subscriptions \ -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \ -d customer=cus_4fdAW5ftNQow1a \ -d "items[0][price]"=price_H1y51TElsOZjG \ -d "expand[]"="latest_invoice.payment_intent" \ -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' subscription = Stripe::Subscription.create({ customer: "cus_4fdAW5ftNQow1a", items: [ { price: "price_H1y51TElsOZjG" } ], expand: ["latest_invoice.payment_intent"], }, 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' subscription = Stripe::Subscription.create({ customer: "cus_4fdAW5ftNQow1a", items: [ { price: "price_H1y51TElsOZjG" } ], expand: ["latest_invoice.payment_intent"], }, 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' subscription = stripe.Subscription.create( customer="cus_4fdAW5ftNQow1a", items=[ { "price": "price_H1y51TElsOZjG", }, ], expand=["latest_invoice.payment_intent"], 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' subscription = stripe.Subscription.create( customer="cus_4fdAW5ftNQow1a", items=[ { "price": "price_H1y51TElsOZjG", }, ], expand=["latest_invoice.payment_intent"], 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'); $subscription = \Stripe\Subscription::create([ "customer" => "cus_4fdAW5ftNQow1a", "items" => [ ["price" => "price_H1y51TElsOZjG"], ], "expand" => ["latest_invoice.payment_intent"], ], ["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'); $subscription = \Stripe\Subscription::create([ "customer" => "cus_4fdAW5ftNQow1a", "items" => [ ["price" => "price_H1y51TElsOZjG"], ], "expand" => ["latest_invoice.payment_intent"], ], ["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"; SubscriptionCreateParams params = SubscriptionCreateParams.builder() .setCustomer("cus_4fdAW5ftNQow1a") .addItem(SubscriptionCreateParams.Item.builder() .setPrice("price_H1y51TElsOZjG") .build()) .addExpand("latest_invoice.payment_intent") .build(); RequestOptions requestOptions = RequestOptions.builder().setStripeAccount({{CONNECTED_STRIPE_ACCOUNT_ID}}).build(); Subscription subscription = Subscription.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 Stripe.apiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"; SubscriptionCreateParams params = SubscriptionCreateParams.builder() .setCustomer("cus_4fdAW5ftNQow1a") .addItem(SubscriptionCreateParams.Item.builder() .setPrice("price_H1y51TElsOZjG") .build()) .addExpand("latest_invoice.payment_intent") .build(); RequestOptions requestOptions = RequestOptions.builder().setStripeAccount({{CONNECTED_STRIPE_ACCOUNT_ID}}).build(); Subscription subscription = Subscription.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'); const stripe = Stripe('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); const subscription = await stripe.subscriptions.create({ customer: "cus_4fdAW5ftNQow1a", items: [ { price: "price_H1y51TElsOZjG", }, ], expand: ["latest_invoice.payment_intent"], }, { stripeAccount: "{{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 const Stripe = require('stripe'); const stripe = Stripe('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); const subscription = await stripe.subscriptions.create({ customer: "cus_4fdAW5ftNQow1a", items: [ { price: "price_H1y51TElsOZjG", }, ], expand: ["latest_invoice.payment_intent"], }, { stripeAccount: "{{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.SubscriptionParams{ Customer: stripe.String("cus_4fdAW5ftNQow1a"), Items: []*stripe.SubscriptionItemsParams{ { price: stripe.String("price_H1y51TElsOZjG"), }, }, } params.AddExpand("latest_invoice.payment_intent") params.SetStripeAccount("{{CONNECTED_STRIPE_ACCOUNT_ID}}") subscription, _ := sub.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 stripe.Key = "sk_test_4eC39HqLyjWDarjtT1zdp7dc" params := &stripe.SubscriptionParams{ Customer: stripe.String("cus_4fdAW5ftNQow1a"), Items: []*stripe.SubscriptionItemsParams{ { price: stripe.String("price_H1y51TElsOZjG"), }, }, } params.AddExpand("latest_invoice.payment_intent") params.SetStripeAccount("{{CONNECTED_STRIPE_ACCOUNT_ID}}") subscription, _ := sub.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 SubscriptionCreateOptions { Customer = "cus_4fdAW5ftNQow1a", Items = new List<SubscriptionItemOptions> { new SubscriptionItemOptions { Price = "price_H1y51TElsOZjG", }, }, }; options.AddExpand("latest_invoice.payment_intent"); var requestOptions = new RequestOptions(); requestOptions.StripeAccount = "{{CONNECTED_ACCOUNT_ID}}"; var service = new SubscriptionService(); var subscription = service.Create(options, 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 StripeConfiguration.ApiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"; var options = new SubscriptionCreateOptions { Customer = "cus_4fdAW5ftNQow1a", Items = new List<SubscriptionItemOptions> { new SubscriptionItemOptions { Price = "price_H1y51TElsOZjG", }, }, }; options.AddExpand("latest_invoice.payment_intent"); var requestOptions = new RequestOptions(); requestOptions.StripeAccount = "{{CONNECTED_ACCOUNT_ID}}"; var service = new SubscriptionService(); var subscription = service.Create(options, requestOptions);

As with creating a direct charge on a connected account, you can create a customer on a connected account using either the platform’s publishable key or the connected account’s publishable key. You can also create a token using shared customers. When using direct charges, the connected account is responsible for the cost of the Stripe fees, refunds, and chargebacks.

Creating a subscription using destination charges

To create a subscription that charges on the platform and creates automatic transfers to a connected account, make a create subscription call while providing the connected account ID as the transfer_data[destination] value.

curl Ruby Python PHP Java Node Go .NET
curl https://api.stripe.com/v1/subscriptions \ -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \ -d customer=cus_4fdAW5ftNQow1a \ -d "items[0][price]"=price_H1y51TElsOZjG \ -d "expand[]"="latest_invoice.payment_intent" \ -d "transfer_data[destination]"="{{CONNECTED_STRIPE_ACCOUNT_ID}}"
curl https://api.stripe.com/v1/subscriptions \ -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \ -d customer=cus_4fdAW5ftNQow1a \ -d "items[0][price]"=price_H1y51TElsOZjG \ -d "expand[]"="latest_invoice.payment_intent" \ -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' subscription = Stripe::Subscription.create({ customer: "cus_4fdAW5ftNQow1a", items: [ { price: "price_H1y51TElsOZjG" } ], expand: ["latest_invoice.payment_intent"], 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' subscription = Stripe::Subscription.create({ customer: "cus_4fdAW5ftNQow1a", items: [ { price: "price_H1y51TElsOZjG" } ], expand: ["latest_invoice.payment_intent"], 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' subscription = stripe.Subscription.create( customer="cus_4fdAW5ftNQow1a", items=[ { "price": "price_H1y51TElsOZjG", }, ], expand=["latest_invoice.payment_intent"], 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' subscription = stripe.Subscription.create( customer="cus_4fdAW5ftNQow1a", items=[ { "price": "price_H1y51TElsOZjG", }, ], expand=["latest_invoice.payment_intent"], 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'); $subscription = \Stripe\Subscription::create([ "customer" => "cus_4fdAW5ftNQow1a", "items" => [ ["price" => "price_H1y51TElsOZjG"], ], "expand" => ["latest_invoice.payment_intent"], "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'); $subscription = \Stripe\Subscription::create([ "customer" => "cus_4fdAW5ftNQow1a", "items" => [ ["price" => "price_H1y51TElsOZjG"], ], "expand" => ["latest_invoice.payment_intent"], "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"; SubscriptionCreateParams params = SubscriptionCreateParams.builder() .setCustomer("cus_4fdAW5ftNQow1a") .addItem(SubscriptionCreateParams.Item.builder() .setPrice("price_H1y51TElsOZjG") .build()) .setTransferData( SubscriptionCreateParams.TransferData.builder() .setDestination("{{CONNECTED_STRIPE_ACCOUNT_ID}}") .build()) .addExpand("latest_invoice.payment_intent") .build(); Subscription subscription = Subscription.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 Stripe.apiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"; SubscriptionCreateParams params = SubscriptionCreateParams.builder() .setCustomer("cus_4fdAW5ftNQow1a") .addItem(SubscriptionCreateParams.Item.builder() .setPrice("price_H1y51TElsOZjG") .build()) .setTransferData( SubscriptionCreateParams.TransferData.builder() .setDestination("{{CONNECTED_STRIPE_ACCOUNT_ID}}") .build()) .addExpand("latest_invoice.payment_intent") .build(); Subscription subscription = Subscription.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'); const stripe = Stripe('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); const subscription = await stripe.subscriptions.create({ customer: "cus_4fdAW5ftNQow1a", items: [ { price: "price_H1y51TElsOZjG", }, ], expand: ["latest_invoice.payment_intent"], 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 const Stripe = require('stripe'); const stripe = Stripe('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); const subscription = await stripe.subscriptions.create({ customer: "cus_4fdAW5ftNQow1a", items: [ { price: "price_H1y51TElsOZjG", }, ], expand: ["latest_invoice.payment_intent"], 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.SubscriptionParams{ Customer: stripe.String("cus_4fdAW5ftNQow1a"), Items: []*stripe.SubscriptionItemsParams{ { price: stripe.String("price_H1y51TElsOZjG"), }, }, TransferData: &stripe.InvoiceTransferDataParams{ Destination: stripe.String("{{CONNECTED_STRIPE_ACCOUNT_ID}}"), }, } params.AddExpand("latest_invoice.payment_intent") subscription, _ := sub.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 stripe.Key = "sk_test_4eC39HqLyjWDarjtT1zdp7dc" params := &stripe.SubscriptionParams{ Customer: stripe.String("cus_4fdAW5ftNQow1a"), Items: []*stripe.SubscriptionItemsParams{ { price: stripe.String("price_H1y51TElsOZjG"), }, }, TransferData: &stripe.InvoiceTransferDataParams{ Destination: stripe.String("{{CONNECTED_STRIPE_ACCOUNT_ID}}"), }, } params.AddExpand("latest_invoice.payment_intent") subscription, _ := sub.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 SubscriptionCreateOptions { Customer = "cus_4fdAW5ftNQow1a", Items = new List<SubscriptionItemOptions> { new SubscriptionItemOptions { Price = "price_H1y51TElsOZjG", }, }, TransferData = new SubscriptionTransferDataOptions { Destination = "{{CONNECTED_STRIPE_ACCOUNT_ID}}", }, }; options.AddExpand("latest_invoice.payment_intent"); var service = new SubscriptionService(); var subscription = service.Create(options);
// 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 SubscriptionCreateOptions { Customer = "cus_4fdAW5ftNQow1a", Items = new List<SubscriptionItemOptions> { new SubscriptionItemOptions { Price = "price_H1y51TElsOZjG", }, }, TransferData = new SubscriptionTransferDataOptions { Destination = "{{CONNECTED_STRIPE_ACCOUNT_ID}}", }, }; options.AddExpand("latest_invoice.payment_intent"); var service = new SubscriptionService(); var subscription = service.Create(options);

For this to work, both the customer and the price must be defined on the platform account, and the connected account token must be created using the platform’s publishable key. If charging a customer, the customer must exist within the platform account. When using automatic transfers, the platform is the business of record.

Collecting fees on subscriptions

When creating or updating a subscription, you can optionally specify an application_fee_percent. This must be a non-negative decimal between 0 and 100, with at most two decimal places.

Once each billing period, Stripe takes this percentage of the final invoice amount—including any bundled invoice items, discounts, or account balance adjustments—as a fee for the platform. This deduction is made before charging any Stripe fees.

This example shows application_fee_percent for subscriptions that use direct charges on connected accounts:

curl Ruby Python PHP Java Node Go .NET
curl https://api.stripe.com/v1/subscriptions \ -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \ -d customer=cus_4fdAW5ftNQow1a \ -d "items[0][price]"=price_H1y51TElsOZjG \ -d "expand[]"="latest_invoice.payment_intent" \ -d application_fee_percent=10 \ -H "Stripe-Account: {{CONNECTED_STRIPE_ACCOUNT_ID}}"
curl https://api.stripe.com/v1/subscriptions \ -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \ -d customer=cus_4fdAW5ftNQow1a \ -d "items[0][price]"=price_H1y51TElsOZjG \ -d "expand[]"="latest_invoice.payment_intent" \ -d application_fee_percent=10 \ -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' subscription = Stripe::Subscription.create({ customer: "cus_4fdAW5ftNQow1a", items: [ { price: "price_H1y51TElsOZjG" } ], expand: ["latest_invoice.payment_intent"], application_fee_percent: 10, }, 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' subscription = Stripe::Subscription.create({ customer: "cus_4fdAW5ftNQow1a", items: [ { price: "price_H1y51TElsOZjG" } ], expand: ["latest_invoice.payment_intent"], application_fee_percent: 10, }, 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' subscription = stripe.Subscription.create( customer="cus_4fdAW5ftNQow1a", items=[ { "price": "price_H1y51TElsOZjG", }, ], expand=["latest_invoice.payment_intent"], application_fee_percent=10, 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' subscription = stripe.Subscription.create( customer="cus_4fdAW5ftNQow1a", items=[ { "price": "price_H1y51TElsOZjG", }, ], expand=["latest_invoice.payment_intent"], application_fee_percent=10, 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'); $subscription = \Stripe\Subscription::create([ "customer" => "cus_4fdAW5ftNQow1a", "items" => [ ["price" => "price_H1y51TElsOZjG"], ], "expand" => ["latest_invoice.payment_intent"], "application_fee_percent" => 10, ], ["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'); $subscription = \Stripe\Subscription::create([ "customer" => "cus_4fdAW5ftNQow1a", "items" => [ ["price" => "price_H1y51TElsOZjG"], ], "expand" => ["latest_invoice.payment_intent"], "application_fee_percent" => 10, ], ["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"; SubscriptionCreateParams params = SubscriptionCreateParams.builder() .setCustomer("cus_4fdAW5ftNQow1a") .addItem(SubscriptionCreateParams.Item.builder() .setPrice("price_H1y51TElsOZjG") .build()) .setApplicationFeePercent(new BigDecimal(10)) .addExpand("latest_invoice.payment_intent") .build(); RequestOptions requestOptions = RequestOptions.builder().setStripeAccount({{CONNECTED_STRIPE_ACCOUNT_ID}}).build(); Subscription subscription = Subscription.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 Stripe.apiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"; SubscriptionCreateParams params = SubscriptionCreateParams.builder() .setCustomer("cus_4fdAW5ftNQow1a") .addItem(SubscriptionCreateParams.Item.builder() .setPrice("price_H1y51TElsOZjG") .build()) .setApplicationFeePercent(new BigDecimal(10)) .addExpand("latest_invoice.payment_intent") .build(); RequestOptions requestOptions = RequestOptions.builder().setStripeAccount({{CONNECTED_STRIPE_ACCOUNT_ID}}).build(); Subscription subscription = Subscription.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'); const stripe = Stripe('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); const subscription = await stripe.subscriptions.create({ customer: "cus_4fdAW5ftNQow1a", items: [ { price: "price_H1y51TElsOZjG", }, ], expand: ["latest_invoice.payment_intent"], application_fee_percent: 10, }, { stripeAccount: "{{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 const Stripe = require('stripe'); const stripe = Stripe('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); const subscription = await stripe.subscriptions.create({ customer: "cus_4fdAW5ftNQow1a", items: [ { price: "price_H1y51TElsOZjG", }, ], expand: ["latest_invoice.payment_intent"], application_fee_percent: 10, }, { stripeAccount: "{{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.SubscriptionParams{ Customer: stripe.String("cus_4fdAW5ftNQow1a"), Items: []*stripe.SubscriptionItemsParams{ { price: stripe.String("price_H1y51TElsOZjG"), }, }, ApplicationFeePercent: stripe.Float64(10), } params.AddExpand("latest_invoice.payment_intent") params.SetStripeAccount("{{CONNECTED_STRIPE_ACCOUNT_ID}}") subscription, _ := sub.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 stripe.Key = "sk_test_4eC39HqLyjWDarjtT1zdp7dc" params := &stripe.SubscriptionParams{ Customer: stripe.String("cus_4fdAW5ftNQow1a"), Items: []*stripe.SubscriptionItemsParams{ { price: stripe.String("price_H1y51TElsOZjG"), }, }, ApplicationFeePercent: stripe.Float64(10), } params.AddExpand("latest_invoice.payment_intent") params.SetStripeAccount("{{CONNECTED_STRIPE_ACCOUNT_ID}}") subscription, _ := sub.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 SubscriptionCreateOptions { Customer = "cus_4fdAW5ftNQow1a", Items = new List<SubscriptionItemOptions> { new SubscriptionItemOptions { Price = "price_H1y51TElsOZjG", }, }, ApplicationFeePercent = 10.0m, }; options.AddExpand("latest_invoice.payment_intent"); var requestOptions = new RequestOptions(); requestOptions.StripeAccount = "{{CONNECTED_ACCOUNT_ID}}"; var service = new SubscriptionService(); var subscription = service.Create(options, 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 StripeConfiguration.ApiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"; var options = new SubscriptionCreateOptions { Customer = "cus_4fdAW5ftNQow1a", Items = new List<SubscriptionItemOptions> { new SubscriptionItemOptions { Price = "price_H1y51TElsOZjG", }, }, ApplicationFeePercent = 10.0m, }; options.AddExpand("latest_invoice.payment_intent"); var requestOptions = new RequestOptions(); requestOptions.StripeAccount = "{{CONNECTED_ACCOUNT_ID}}"; var service = new SubscriptionService(); var subscription = service.Create(options, requestOptions);

This example shows application_fee_percent for subscriptions that use destination charges:

curl Ruby Python PHP Java Node Go .NET
curl https://api.stripe.com/v1/subscriptions \ -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \ -d customer=cus_4fdAW5ftNQow1a \ -d "items[0][price]"=price_H1y51TElsOZjG \ -d "expand[]"="latest_invoice.payment_intent" \ -d application_fee_percent=10 \ -d "transfer_data[destination]"="{{CONNECTED_STRIPE_ACCOUNT_ID}}"
curl https://api.stripe.com/v1/subscriptions \ -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \ -d customer=cus_4fdAW5ftNQow1a \ -d "items[0][price]"=price_H1y51TElsOZjG \ -d "expand[]"="latest_invoice.payment_intent" \ -d application_fee_percent=10 \ -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' subscription = Stripe::Subscription.create({ customer: "cus_4fdAW5ftNQow1a", items: [ { price: "price_H1y51TElsOZjG" } ], expand: ["latest_invoice.payment_intent"], application_fee_percent: 10, 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' subscription = Stripe::Subscription.create({ customer: "cus_4fdAW5ftNQow1a", items: [ { price: "price_H1y51TElsOZjG" } ], expand: ["latest_invoice.payment_intent"], application_fee_percent: 10, 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' subscription = stripe.Subscription.create( customer="cus_4fdAW5ftNQow1a", items=[ { "price": "price_H1y51TElsOZjG", }, ], expand=["latest_invoice.payment_intent"], application_fee_percent=10, 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' subscription = stripe.Subscription.create( customer="cus_4fdAW5ftNQow1a", items=[ { "price": "price_H1y51TElsOZjG", }, ], expand=["latest_invoice.payment_intent"], application_fee_percent=10, 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'); $subscription = \Stripe\Subscription::create([ "customer" => "cus_4fdAW5ftNQow1a", "items" => [ ["price" => "price_H1y51TElsOZjG"], ], "expand" => ["latest_invoice.payment_intent"], "application_fee_percent" => 10, "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'); $subscription = \Stripe\Subscription::create([ "customer" => "cus_4fdAW5ftNQow1a", "items" => [ ["price" => "price_H1y51TElsOZjG"], ], "expand" => ["latest_invoice.payment_intent"], "application_fee_percent" => 10, "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"; SubscriptionCreateParams params = SubscriptionCreateParams.builder() .setCustomer("cus_4fdAW5ftNQow1a") .addItem(SubscriptionCreateParams.Item.builder() .setPrice("price_H1y51TElsOZjG") .build()) .setApplicationFeePercent(new BigDecimal(10)) .setTransferData( SubscriptionCreateParams.TransferData.builder() .setDestination("{{CONNECTED_STRIPE_ACCOUNT_ID}}") .build()) .addExpand("latest_invoice.payment_intent") .build(); Subscription subscription = Subscription.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 Stripe.apiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"; SubscriptionCreateParams params = SubscriptionCreateParams.builder() .setCustomer("cus_4fdAW5ftNQow1a") .addItem(SubscriptionCreateParams.Item.builder() .setPrice("price_H1y51TElsOZjG") .build()) .setApplicationFeePercent(new BigDecimal(10)) .setTransferData( SubscriptionCreateParams.TransferData.builder() .setDestination("{{CONNECTED_STRIPE_ACCOUNT_ID}}") .build()) .addExpand("latest_invoice.payment_intent") .build(); Subscription subscription = Subscription.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'); const stripe = Stripe('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); const subscription = await stripe.subscriptions.create({ customer: "cus_4fdAW5ftNQow1a", items: [ { price: "price_H1y51TElsOZjG", }, ], expand: ["latest_invoice.payment_intent"], application_fee_percent: 10, 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 const Stripe = require('stripe'); const stripe = Stripe('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); const subscription = await stripe.subscriptions.create({ customer: "cus_4fdAW5ftNQow1a", items: [ { price: "price_H1y51TElsOZjG", }, ], expand: ["latest_invoice.payment_intent"], application_fee_percent: 10, 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.SubscriptionParams{ Customer: stripe.String("cus_4fdAW5ftNQow1a"), Items: []*stripe.SubscriptionItemsParams{ { price: stripe.String("price_H1y51TElsOZjG"), }, }, ApplicationFeePercent: stripe.Float64(10), TransferData: &stripe.InvoiceTransferDataParams{ Destination: stripe.String("{{CONNECTED_STRIPE_ACCOUNT_ID}}"), }, } params.AddExpand("latest_invoice.payment_intent") subscription, _ := sub.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 stripe.Key = "sk_test_4eC39HqLyjWDarjtT1zdp7dc" params := &stripe.SubscriptionParams{ Customer: stripe.String("cus_4fdAW5ftNQow1a"), Items: []*stripe.SubscriptionItemsParams{ { price: stripe.String("price_H1y51TElsOZjG"), }, }, ApplicationFeePercent: stripe.Float64(10), TransferData: &stripe.InvoiceTransferDataParams{ Destination: stripe.String("{{CONNECTED_STRIPE_ACCOUNT_ID}}"), }, } params.AddExpand("latest_invoice.payment_intent") subscription, _ := sub.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 SubscriptionCreateOptions { Customer = "cus_4fdAW5ftNQow1a", Items = new List<SubscriptionItemOptions> { new SubscriptionItemOptions { Price = "price_H1y51TElsOZjG", }, }, ApplicationFeePercent = 10.0m, TransferData = new SubscriptionTransferDataOptions { Destination = "{{CONNECTED_STRIPE_ACCOUNT_ID}}", }, }; options.AddExpand("latest_invoice.payment_intent"); var service = new SubscriptionService(); var subscription = service.Create(options);
// 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 SubscriptionCreateOptions { Customer = "cus_4fdAW5ftNQow1a", Items = new List<SubscriptionItemOptions> { new SubscriptionItemOptions { Price = "price_H1y51TElsOZjG", }, }, ApplicationFeePercent = 10.0m, TransferData = new SubscriptionTransferDataOptions { Destination = "{{CONNECTED_STRIPE_ACCOUNT_ID}}", }, }; options.AddExpand("latest_invoice.payment_intent"); var service = new SubscriptionService(); var subscription = service.Create(options);

Calculating application fee percent

To see how application_fee_percent is calculated, consider this scenario:

  • A subscription costs 30 USD per billing cycle.
  • There’s a 10 USD invoice item on the next invoice.
  • A 50% coupon applies.
  • The application_fee_percent is 10.

In this case, the total application fee is 2 USD: (30 USD + 10 USD) * 50% * 10%.

Percent fees and flat fees

Application fees on subscriptions must normally be a percentage, because the amount billed with subscriptions often varies. You cannot set a subscription’s recurring application fee as a flat amount.

However, you can charge a flat application_fee_amount on an invoice, as explained in the next section. Also, the application_fee_percent parameter does not apply to invoices created outside of a subscription billing period. For example, it does not apply to proration invoice items that are immediately invoiced. In these cases, you should directly set an application_fee_amount on the invoice for the amount you’d like to charge.

Working with invoices created by subscriptions

Each cycle, subscriptions create invoices and invoices create charges. For more information about subscription cycles, see the subscription lifecycle. To charge a flat or dynamic fee that can’t be automatically calculated with application_fee_percent, add an application_fee_amount directly on each invoice created by the subscription.

This example shows an application_fee_amount for an invoice with a direct charge on the connected account:

curl Ruby Python PHP Java Node Go .NET
curl https://api.stripe.com/v1/invoices/{INVOICE_ID} \ -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \ -d application_fee_amount=100 \ -H "Stripe-Account: {{CONNECTED_STRIPE_ACCOUNT_ID}}"
curl https://api.stripe.com/v1/invoices/{INVOICE_ID} \ -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \ -d application_fee_amount=100 \ -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' invoice = Stripe::Invoice.update( {INVOICE_ID}, {application_fee_amount: 100}, 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' invoice = Stripe::Invoice.update( {INVOICE_ID}, {application_fee_amount: 100}, 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' invoice = stripe.Invoice.modify( {INVOICE_ID}, application_fee_amount=100, 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' invoice = stripe.Invoice.modify( {INVOICE_ID}, application_fee_amount=100, 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'); $invoice = StripeInvoice::update( {INVOICE_ID}, ['application_fee_amount' => 100], ["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'); $invoice = StripeInvoice::update( {INVOICE_ID}, ['application_fee_amount' => 100], ["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"; RequestOptions requestOptions = RequestOptions.builder().setStripeAccount({{CONNECTED_STRIPE_ACCOUNT_ID}}).build(); Invoice invoice = Invoice.retrieve({INVOICE_ID}, requestOptions); Map<String, Object> invoiceParams = new HashMap<>(); invoiceParams.put("application_fee_amount", 100); invoice.update(invoiceParams, 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 Stripe.apiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"; RequestOptions requestOptions = RequestOptions.builder().setStripeAccount({{CONNECTED_STRIPE_ACCOUNT_ID}}).build(); Invoice invoice = Invoice.retrieve({INVOICE_ID}, requestOptions); Map<String, Object> invoiceParams = new HashMap<>(); invoiceParams.put("application_fee_amount", 100); invoice.update(invoiceParams, 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'); const stripe = Stripe('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); const invoice = await stripe.invoices.update( {INVOICE_ID}, {application_fee_amount: 100}, {stripeAccount: "{{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 const Stripe = require('stripe'); const stripe = Stripe('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); const invoice = await stripe.invoices.update( {INVOICE_ID}, {application_fee_amount: 100}, {stripeAccount: "{{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.InvoiceParams{ ApplicationFeeAmount: stripe.Int64(100), } params.SetStripeAccount("{{CONNECTED_STRIPE_ACCOUNT_ID}}") in, _ := invoice.Update({INVOICE_ID}, 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 stripe.Key = "sk_test_4eC39HqLyjWDarjtT1zdp7dc" params := &stripe.InvoiceParams{ ApplicationFeeAmount: stripe.Int64(100), } params.SetStripeAccount("{{CONNECTED_STRIPE_ACCOUNT_ID}}") in, _ := invoice.Update({INVOICE_ID}, 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 InvoiceUpdateOptions { ApplicationFeeAmount = 100, }; var requestOptions = new RequestOptions(); requestOptions.StripeAccount = "{{CONNECTED_STRIPE_ACCOUNT_ID}}"; var service = new InvoiceService(); var invoice = service.Update("{INVOICE_ID}", options, 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 StripeConfiguration.ApiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"; var options = new InvoiceUpdateOptions { ApplicationFeeAmount = 100, }; var requestOptions = new RequestOptions(); requestOptions.StripeAccount = "{{CONNECTED_STRIPE_ACCOUNT_ID}}"; var service = new InvoiceService(); var invoice = service.Update("{INVOICE_ID}", options, requestOptions);

This example shows an application_fee_amount for an invoice with a destination charge:

curl Ruby Python PHP Java Node Go .NET
curl https://api.stripe.com/v1/invoices/{INVOICE_ID} \ -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \ -d application_fee_amount=100 \ -d "transfer_data[destination]"="{{CONNECTED_STRIPE_ACCOUNT_ID}}"
curl https://api.stripe.com/v1/invoices/{INVOICE_ID} \ -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \ -d application_fee_amount=100 \ -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' invoice = Stripe::Invoice.update( {INVOICE_ID}, { transfer_data: {destination: "{{CONNECTED_STRIPE_ACCOUNT_ID}}"}, application_fee_amount: 100, }, )
# 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' invoice = Stripe::Invoice.update( {INVOICE_ID}, { transfer_data: {destination: "{{CONNECTED_STRIPE_ACCOUNT_ID}}"}, application_fee_amount: 100, }, )
# 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' invoice = stripe.Invoice.modify( {INVOICE_ID}, transfer_data={"destination": "{{CONNECTED_STRIPE_ACCOUNT_ID}}"}, application_fee_amount=100, )
# 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' invoice = stripe.Invoice.modify( {INVOICE_ID}, transfer_data={"destination": "{{CONNECTED_STRIPE_ACCOUNT_ID}}"}, application_fee_amount=100, )
// 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'); $invoice = StripeInvoice::update( {INVOICE_ID}, [ 'transfer_data' => ['destination' => '{{CONNECTED_STRIPE_ACCOUNT_ID}}'], 'application_fee_amount' => 100, ], );
// 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'); $invoice = StripeInvoice::update( {INVOICE_ID}, [ 'transfer_data' => ['destination' => '{{CONNECTED_STRIPE_ACCOUNT_ID}}'], 'application_fee_amount' => 100, ], );
// 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"; Invoice invoice = Invoice.retrieve({INVOICE_ID}); Map<String, Object> invoiceParams = new HashMap<>(); Map<String, Object> transferDataParams = new HashMap<>(); transferDataParams.put("destination", "{{CONNECTED_STRIPE_ACCOUNT_ID}}"); invoiceParams.put("transfer_data", transferDataParams); invoiceParams.put("application_fee_amount", 100); invoice.update(invoiceParams)
// 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"; Invoice invoice = Invoice.retrieve({INVOICE_ID}); Map<String, Object> invoiceParams = new HashMap<>(); Map<String, Object> transferDataParams = new HashMap<>(); transferDataParams.put("destination", "{{CONNECTED_STRIPE_ACCOUNT_ID}}"); invoiceParams.put("transfer_data", transferDataParams); invoiceParams.put("application_fee_amount", 100); invoice.update(invoiceParams)
// 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'); const stripe = Stripe('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); const invoice = await stripe.invoices.update( {INVOICE_ID}, { application_fee_amount: 100, 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 const Stripe = require('stripe'); const stripe = Stripe('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); const invoice = await stripe.invoices.update( {INVOICE_ID}, { application_fee_amount: 100, 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.InvoiceParams{ ApplicationFeeAmount: stripe.Int64(100), TransferData: &stripe.InvoiceTransferDataParams{ Destination: stripe.String("{{CONNECTED_STRIPE_ACCOUNT_ID}}"), }, } in, _ := invoice.Update({INVOICE_ID}, 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 stripe.Key = "sk_test_4eC39HqLyjWDarjtT1zdp7dc" params := &stripe.InvoiceParams{ ApplicationFeeAmount: stripe.Int64(100), TransferData: &stripe.InvoiceTransferDataParams{ Destination: stripe.String("{{CONNECTED_STRIPE_ACCOUNT_ID}}"), }, } in, _ := invoice.Update({INVOICE_ID}, 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 InvoiceUpdateOptions { ApplicationFeeAmount = 100, TransferData = new InvoiceTransferDataOptions { Destination = "{{CONNECTED_STRIPE_ACCOUNT_ID}}" } }; var service = new InvoiceService(); var invoice = service.Update("{INVOICE_ID}", options);
// 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 InvoiceUpdateOptions { ApplicationFeeAmount = 100, TransferData = new InvoiceTransferDataOptions { Destination = "{{CONNECTED_STRIPE_ACCOUNT_ID}}" } }; var service = new InvoiceService(); var invoice = service.Update("{INVOICE_ID}", options);

To automatically charge an application_fee_amount, create a webhook that listens for the invoice.created event. You can also do this manually by creating an invoice for pending invoice items, and setting an application fee on it.

The application_fee_amount set directly on an invoice overrides any application fee amount calculated with application_fee_percent, and is capped at the invoice’s final charge amount.

Further reading

Discover what other Connect functionality is available:

  • Creating invoices
  • Creating charges
  • Share customers across accounts
  • Multiple currencies
Was this page helpful?
Questions? Contact us.
Developer tutorials on YouTube.
You can unsubscribe at any time. Read our privacy policy.
On this page
Restrictions
Creating a subscription using direct charges
Creating a subscription using destination charges
Collecting fees on subscriptions
Working with invoices created by subscriptions