Billing
Create an invoice
Invoices with Connect

Create invoices with Connect

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

You can create invoices for connected accounts, which support several approaches for collecting payments. Invoices 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 on these invoices.

Create an invoice using direct charges

To create an invoice that directly charges on a connected account, create an invoice while authenticated as the connected account. For this to work, the customer must be defined on the connected account.

curl https://api.stripe.com/v1/invoices \ -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \ -d customer=cus_4fdAW5ftNQow1a \ -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.create({ customer: "cus_4fdAW5ftNQow1a", }, 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.create( customer="cus_4fdAW5ftNQow1a", 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 = \Stripe\Invoice::create([ "customer" => "cus_4fdAW5ftNQow1a", ], ["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("customer", "cus_4fdAW5ftNQow1a"); RequestOptions requestOptions = RequestOptions.builder().setStripeAccount({{CONNECTED_STRIPE_ACCOUNT_ID}}).build(); Invoice invoice = Invoice.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 invoice = await stripe.invoices.create({ customer: "cus_4fdAW5ftNQow1a", }, { 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 StripeConfiguration.ApiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"; var options = new InvoiceCreateOptions { Customer = "cus_4fdAW5ftNQow1a", }; var requestOptions = new RequestOptions(); requestOptions.StripeAccount = "{{CONNECTED_ACCOUNT_ID}}"; var service = new InvoiceService(); var invoice = 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.

Create an invoice using destination charges

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

curl https://api.stripe.com/v1/invoices \ -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \ -d customer=cus_4fdAW5ftNQow1a \ -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.create({ customer: "cus_4fdAW5ftNQow1a", 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.create( customer="cus_4fdAW5ftNQow1a", 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'); $invoice = \Stripe\Invoice::create([ "customer" => "cus_4fdAW5ftNQow1a", "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("customer", "cus_4fdAW5ftNQow1a"); Map<String, Object> transferDataParams = new HashMap<>(); transferDataParams.put("destination", "{{CONNECTED_STRIPE_ACCOUNT_ID}}"); params.put("transfer_data", transferDataParams); Invoice invoice = Invoice.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 invoice = await stripe.invoices.create({ customer: "cus_4fdAW5ftNQow1a", 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 StripeConfiguration.ApiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"; var options = new InvoiceCreateOptions { Customer = "cus_4fdAW5ftNQow1a", TransferData = new InvoiceTransferDataOptions { Destination = "{{CONNECTED_STRIPE_ACCOUNT_ID}}", }, }; var service = new InvoiceService(); var invoice = service.Create(options);

For this to work, the customer 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 the invoice, you can optionally withhold an application_fee_amount. This example shows an application_fee_amount for an invoice with a direct charge on the connected account:

curl https://api.stripe.com/v1/invoices \ -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \ -d customer=cus_4fdAW5ftNQow1a \ -d application_fee_amount=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' invoice = Stripe::Invoice.create({ customer: "cus_4fdAW5ftNQow1a", application_fee_amount: 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' invoice = stripe.Invoice.create( customer="cus_4fdAW5ftNQow1a", application_fee_amount=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'); $invoice = \Stripe\Invoice::create([ "customer" => "cus_4fdAW5ftNQow1a", "application_fee_amount" => 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"; Map<String, Object> params = new HashMap<>(); params.put("customer", "cus_4fdAW5ftNQow1a"); params.put("application_fee_amount", 10); RequestOptions requestOptions = RequestOptions.builder().setStripeAccount({{CONNECTED_STRIPE_ACCOUNT_ID}}).build(); Invoice invoice = Invoice.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 invoice = await stripe.invoices.create({ customer: "cus_4fdAW5ftNQow1a", application_fee_amount: 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 StripeConfiguration.ApiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"; var options = new InvoiceCreateOptions { Customer = "cus_4fdAW5ftNQow1a", ApplicationFeeAmount = 10, }; var requestOptions = new RequestOptions(); requestOptions.StripeAccount = "{{CONNECTED_ACCOUNT_ID}}"; var service = new InvoiceService(); var invoice = service.Create(options, requestOptions);

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

curl https://api.stripe.com/v1/invoices \ -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \ -d customer=cus_4fdAW5ftNQow1a \ -d application_fee_amount=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' invoice = Stripe::Invoice.create({ customer: "cus_4fdAW5ftNQow1a", application_fee_amount: 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' invoice = stripe.Invoice.create( customer="cus_4fdAW5ftNQow1a", application_fee_amount=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'); $invoice = \Stripe\Invoice::create([ "customer" => "cus_4fdAW5ftNQow1a", "application_fee_amount" => 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"; Map<String, Object> params = new HashMap<>(); params.put("customer", "cus_4fdAW5ftNQow1a"); params.put("application_fee_amount", 10); Map<String, Object> transferDataParams = new HashMap<>(); transferDataParams.put("destination", "{{CONNECTED_STRIPE_ACCOUNT_ID}}"); params.put("transfer_data", transferDataParams); Invoice invoice = Invoice.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 invoice = await stripe.invoices.create({ customer: "cus_4fdAW5ftNQow1a", transfer_data: { destination: "{{CONNECTED_STRIPE_ACCOUNT_ID}}", } application_fee_amount: 10, });
// 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 InvoiceCreateOptions { Customer = "cus_4fdAW5ftNQow1a", ApplicationFeeAmount = 10, TransferData = new InvoiceTransferDataOptions { Destination = "{{CONNECTED_STRIPE_ACCOUNT_ID}}", }, }; var service = new InvoiceService(); var invoice = service.Create(options);

Using on_behalf_of

To make the connected account the business of record, you need to charge them using the on_behalf_of attribute which is in active development. If you are interested in this feature, please enter your information below.

You might have had an internet hiccup. Try again?

We'll be in touch soon. 

Further reading

Discover what other Connect functionality is available:

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