# Tax for marketplaces Learn about tax requirements for platforms and marketplaces, and how to enable Stripe Tax to collect tax on transactions when the Connect platform is liable. ## Tax requirements for platforms and marketplaces Many countries and US states require marketplace operators to collect sales tax and VAT on their facilitated sales. The US refers to these businesses as marketplace facilitators, while other regions, such as Europe, might refer to them as deemed sellers. As a marketplace operator, your tax collection requirements differ depending on the country or state. However, if your electronic interface enables transactions between buyers and sellers and you directly or indirectly collect customer payments, you might need to fulfill tax collection responsibilities. If your businesses operates a marketplace or platform, you must first determine whether they qualify as a marketplace facilitator or a deemed seller, then make sure that they maintain tax compliance. If you’re unsure about your business’s tax requirements, consult a tax advisor. If your business operates a marketplace and wants to collect tax on sales facilitated through this marketplace, refer to details below to enable Stripe Tax for marketplaces. ## Enable Stripe Tax for marketplaces Stripe Tax enables businesses to calculate, collect, and file indirect taxes in over 40 countries, across hundreds of product categories. Use this guide if your platform is responsible for collecting, filing, and reporting taxes. We use the platform’s head office location, preset tax code, and tax registrations to calculate taxes. However, we don’t use the connected account information for tax purposes. 1. [Configure your platform account for tax collection](#set-up) 1. (Optional) [Assign tax codes to product catalog](#assign-product-tax-codes) 1. [Integrate tax calculation and collection](#enable-tax-collection) 1. [Withhold the collected tax amount](#tax-withholding) 1. [Access Stripe Tax reports](#access-reports) ## Configure your platform account for tax collection To collect taxes, you need the platform account’s tax settings and registrations. ### Use the Stripe Dashboard [Use the Stripe Dashboard](https://docs.stripe.com/tax/set-up.md) to specify your head office location, preset tax code, and tax registrations. ### Use the Stripe API Use the [Tax Settings API](https://docs.stripe.com/tax/settings-api.md#updating-settings) to set your head office location and other default values and the [Tax Registrations API](https://docs.stripe.com/tax/registrations-api.md#adding-registration) to add tax registrations for the locations where you have tax obligations. ## Assign tax codes to your product catalog To calculate taxes, Stripe Tax requires that you classify products into tax codes. You can do so by supplying [a preset tax code](https://docs.stripe.com/tax/products-prices-tax-codes-tax-behavior.md#preset-tax-codes) for the platform account, which might be sufficient if you typically sell a single category of items or services. Additionally, you can [map tax codes to each product](https://docs.stripe.com/tax/products-prices-tax-codes-tax-behavior.md#tax-code-on-product) to give you more control over tax categorization. You might have to map each product that a seller sets up on your marketplace. You can find a list of supported tax codes from [available tax codes](https://docs.stripe.com/tax/tax-codes.md) or retrieve it from the Stripe [Tax Code API](https://docs.stripe.com/api/tax_codes.md). ## Integrate tax calculation and collection You need to integrate with Stripe Tax to estimate taxes as part of your checkout flow. ### Payment Links ### Payment Links for one-time payments Pick one of the currently supported charge types that allow your platform account to be *liable for tax* with [Stripe Payment Links](https://docs.stripe.com/tax/payment-links.md): This charge type isn’t supported for use cases involving a connected account where the platform is *liable for tax*. For the Payment Links API calls: * Include [automatic_tax[liability]](https://docs.stripe.com/api/payment_links/payment_links/create.md#create_payment_link-automatic_tax-liability) with `type=self`. * Include [transfer_data[destination]](https://docs.stripe.com/api/payment_links/payment_links/create.md#create_payment_link-transfer_data) with the value of the connected account ID. * (Optional) If you’re [automatically sending invoices](https://docs.stripe.com/payment-links/post-payment.md#automatically-send-paid-invoices), include [invoice_creation[invoice_data][issuer]](https://docs.stripe.com/api/payment_links/payment_links/create.md#create_payment_link-invoice_creation-invoice_data-issuer) with `type=self`. * (Optional) If the connected account is the [settlement merchant](https://docs.stripe.com/connect/destination-charges.md#settlement-merchant), include [on_behalf_of](https://docs.stripe.com/api/payment_links/payment_links/create.md#create_payment_link-on_behalf_of) with the value of the connected account ID. ```dotnet StripeConfiguration.ApiKey = "<>"; var options = new PaymentLinkCreateOptions { LineItems = new List { new PaymentLinkLineItemOptions { Price = "<>", Quantity = 2 }, }, AutomaticTax = new PaymentLinkAutomaticTaxOptions { Enabled = true, Liability = new PaymentLinkAutomaticTaxLiabilityOptions { Type = "self" }, }, TransferData = new PaymentLinkTransferDataOptions { Destination = "<>" }, InvoiceCreation = new PaymentLinkInvoiceCreationOptions { Enabled = true, InvoiceData = new PaymentLinkInvoiceCreationInvoiceDataOptions { Issuer = new PaymentLinkInvoiceCreationInvoiceDataIssuerOptions { Type = "self" }, }, }, }; var service = new PaymentLinkService(); PaymentLink paymentLink = service.Create(options); ``` ```go stripe.Key = "<>" params := &stripe.PaymentLinkParams{ LineItems: []*stripe.PaymentLinkLineItemParams{ &stripe.PaymentLinkLineItemParams{Price: stripe.String("<>"), Quantity: stripe.Int64(2)}, }, AutomaticTax: &stripe.PaymentLinkAutomaticTaxParams{ Enabled: stripe.Bool(true), Liability: &stripe.PaymentLinkAutomaticTaxLiabilityParams{ Type: stripe.String(string(stripe.PaymentLinkAutomaticTaxLiabilityTypeSelf)), }, }, TransferData: &stripe.PaymentLinkTransferDataParams{ Destination: stripe.String("<>"), }, InvoiceCreation: &stripe.PaymentLinkInvoiceCreationParams{ Enabled: stripe.Bool(true), InvoiceData: &stripe.PaymentLinkInvoiceCreationInvoiceDataParams{ Issuer: &stripe.PaymentLinkInvoiceCreationInvoiceDataIssuerParams{ Type: stripe.String(string(stripe.PaymentLinkInvoiceCreationInvoiceDataIssuerTypeSelf)), }, }, }, }; result, err := paymentlink.New(params); ``` ```java Stripe.apiKey = "<>"; PaymentLinkCreateParams params = PaymentLinkCreateParams.builder() .addLineItem( PaymentLinkCreateParams.LineItem.builder().setPrice("<>").setQuantity(2L).build() ) .setAutomaticTax( PaymentLinkCreateParams.AutomaticTax.builder() .setEnabled(true) .setLiability( PaymentLinkCreateParams.AutomaticTax.Liability.builder() .setType(PaymentLinkCreateParams.AutomaticTax.Liability.Type.SELF) .build() ) .build() ) .setTransferData( PaymentLinkCreateParams.TransferData.builder().setDestination("<>").build() ) .setInvoiceCreation( PaymentLinkCreateParams.InvoiceCreation.builder() .setEnabled(true) .setInvoiceData( PaymentLinkCreateParams.InvoiceCreation.InvoiceData.builder() .setIssuer( PaymentLinkCreateParams.InvoiceCreation.InvoiceData.Issuer.builder() .setType(PaymentLinkCreateParams.InvoiceCreation.InvoiceData.Issuer.Type.SELF) .build() ) .build() ) .build() ) .build(); PaymentLink paymentLink = PaymentLink.create(params); ``` ```node const stripe = require('stripe')('<>'); const paymentLink = await stripe.paymentLinks.create({ line_items: [ { price: '<>', quantity: 2, }, ], automatic_tax: { enabled: true, liability: { type: 'self', }, }, transfer_data: { destination: '<>', }, invoice_creation: { enabled: true, invoice_data: { issuer: { type: 'self', }, }, }, }); ``` ```python import stripe stripe.api_key = "<>" payment_link = stripe.PaymentLink.create( line_items=[{"price": "<>", "quantity": 2}], automatic_tax={"enabled": True, "liability": {"type": "self"}}, transfer_data={"destination": "<>"}, invoice_creation={"enabled": True, "invoice_data": {"issuer": {"type": "self"}}}, ) ``` ```php $stripe = new \Stripe\StripeClient('<>'); $paymentLink = $stripe->paymentLinks->create([ 'line_items' => [ [ 'price' => '<>', 'quantity' => 2, ], ], 'automatic_tax' => [ 'enabled' => true, 'liability' => ['type' => 'self'], ], 'transfer_data' => ['destination' => '<>'], 'invoice_creation' => [ 'enabled' => true, 'invoice_data' => ['issuer' => ['type' => 'self']], ], ]); ``` ```ruby Stripe.api_key = '<>' payment_link = Stripe::PaymentLink.create({ line_items: [ { price: '<>', quantity: 2, }, ], automatic_tax: { enabled: true, liability: {type: 'self'}, }, transfer_data: {destination: '<>'}, invoice_creation: { enabled: true, invoice_data: {issuer: {type: 'self'}}, }, }) ``` For the Payment Links API calls: * Include [automatic_tax[liability]](https://docs.stripe.com/api/payment_links/payment_links/create.md#create_payment_link-automatic_tax-liability) with `type=self`. * (Optional) If you’re [automatically sending invoices](https://docs.stripe.com/payment-links/post-payment.md#automatically-send-paid-invoices), include [invoice_creation[invoice_data][issuer]](https://docs.stripe.com/api/payment_links/payment_links/create.md#create_payment_link-invoice_creation-invoice_data-issuer) with `type=self`. * (Optional) If the connected account is the [settlement merchant](https://docs.stripe.com/connect/separate-charges-and-transfers.md#settlement-merchant), include [on_behalf_of](https://docs.stripe.com/api/payment_links/payment_links/create.md#create_payment_link-on_behalf_of) with the value of the connected account ID. ```dotnet StripeConfiguration.ApiKey = "<>"; var options = new PaymentLinkCreateOptions { LineItems = new List { new PaymentLinkLineItemOptions { Price = "<>", Quantity = 2 }, }, AutomaticTax = new PaymentLinkAutomaticTaxOptions { Enabled = true, Liability = new PaymentLinkAutomaticTaxLiabilityOptions { Type = "self" }, }, InvoiceCreation = new PaymentLinkInvoiceCreationOptions { Enabled = true, InvoiceData = new PaymentLinkInvoiceCreationInvoiceDataOptions { Issuer = new PaymentLinkInvoiceCreationInvoiceDataIssuerOptions { Type = "self" }, }, }, }; var service = new PaymentLinkService(); PaymentLink paymentLink = service.Create(options); ``` ```go stripe.Key = "<>" params := &stripe.PaymentLinkParams{ LineItems: []*stripe.PaymentLinkLineItemParams{ &stripe.PaymentLinkLineItemParams{Price: stripe.String("<>"), Quantity: stripe.Int64(2)}, }, AutomaticTax: &stripe.PaymentLinkAutomaticTaxParams{ Enabled: stripe.Bool(true), Liability: &stripe.PaymentLinkAutomaticTaxLiabilityParams{ Type: stripe.String(string(stripe.PaymentLinkAutomaticTaxLiabilityTypeSelf)), }, }, InvoiceCreation: &stripe.PaymentLinkInvoiceCreationParams{ Enabled: stripe.Bool(true), InvoiceData: &stripe.PaymentLinkInvoiceCreationInvoiceDataParams{ Issuer: &stripe.PaymentLinkInvoiceCreationInvoiceDataIssuerParams{ Type: stripe.String(string(stripe.PaymentLinkInvoiceCreationInvoiceDataIssuerTypeSelf)), }, }, }, }; result, err := paymentlink.New(params); ``` ```java Stripe.apiKey = "<>"; PaymentLinkCreateParams params = PaymentLinkCreateParams.builder() .addLineItem( PaymentLinkCreateParams.LineItem.builder().setPrice("<>").setQuantity(2L).build() ) .setAutomaticTax( PaymentLinkCreateParams.AutomaticTax.builder() .setEnabled(true) .setLiability( PaymentLinkCreateParams.AutomaticTax.Liability.builder() .setType(PaymentLinkCreateParams.AutomaticTax.Liability.Type.SELF) .build() ) .build() ) .setInvoiceCreation( PaymentLinkCreateParams.InvoiceCreation.builder() .setEnabled(true) .setInvoiceData( PaymentLinkCreateParams.InvoiceCreation.InvoiceData.builder() .setIssuer( PaymentLinkCreateParams.InvoiceCreation.InvoiceData.Issuer.builder() .setType(PaymentLinkCreateParams.InvoiceCreation.InvoiceData.Issuer.Type.SELF) .build() ) .build() ) .build() ) .build(); PaymentLink paymentLink = PaymentLink.create(params); ``` ```node const stripe = require('stripe')('<>'); const paymentLink = await stripe.paymentLinks.create({ line_items: [ { price: '<>', quantity: 2, }, ], automatic_tax: { enabled: true, liability: { type: 'self', }, }, invoice_creation: { enabled: true, invoice_data: { issuer: { type: 'self', }, }, }, }); ``` ```python import stripe stripe.api_key = "<>" payment_link = stripe.PaymentLink.create( line_items=[{"price": "<>", "quantity": 2}], automatic_tax={"enabled": True, "liability": {"type": "self"}}, invoice_creation={"enabled": True, "invoice_data": {"issuer": {"type": "self"}}}, ) ``` ```php $stripe = new \Stripe\StripeClient('<>'); $paymentLink = $stripe->paymentLinks->create([ 'line_items' => [ [ 'price' => '<>', 'quantity' => 2, ], ], 'automatic_tax' => [ 'enabled' => true, 'liability' => ['type' => 'self'], ], 'invoice_creation' => [ 'enabled' => true, 'invoice_data' => ['issuer' => ['type' => 'self']], ], ]); ``` ```ruby Stripe.api_key = '<>' payment_link = Stripe::PaymentLink.create({ line_items: [ { price: '<>', quantity: 2, }, ], automatic_tax: { enabled: true, liability: {type: 'self'}, }, invoice_creation: { enabled: true, invoice_data: {issuer: {type: 'self'}}, }, }) ``` For the Transfers API calls: * Include [source_transaction](https://docs.stripe.com/api/transfers/create.md#create_transfer-source_transaction) to tie the transfer to the Payment Intent created by the Payment Link. * Include [destination](https://docs.stripe.com/api/transfers/create.md#create_transfer-destination) with the value of the connected account ID. ```dotnet StripeConfiguration.ApiKey = "<>"; var options = new TransferCreateOptions { Amount = 1000, Currency = "usd", SourceTransaction = "<>", Destination = "<>", }; var service = new TransferService(); Transfer transfer = service.Create(options); ``` ```go stripe.Key = "<>" params := &stripe.TransferParams{ Amount: stripe.Int64(1000), Currency: stripe.String(string(stripe.CurrencyUSD)), SourceTransaction: stripe.String("<>"), Destination: stripe.String("<>"), }; result, err := transfer.New(params); ``` ```java Stripe.apiKey = "<>"; TransferCreateParams params = TransferCreateParams.builder() .setAmount(1000L) .setCurrency("usd") .setSourceTransaction("<>") .setDestination("<>") .build(); Transfer transfer = Transfer.create(params); ``` ```node const stripe = require('stripe')('<>'); const transfer = await stripe.transfers.create({ amount: 1000, currency: 'usd', source_transaction: '<>', destination: '<>', }); ``` ```python import stripe stripe.api_key = "<>" transfer = stripe.Transfer.create( amount=1000, currency="usd", source_transaction="<>", destination="<>", ) ``` ```php $stripe = new \Stripe\StripeClient('<>'); $transfer = $stripe->transfers->create([ 'amount' => 1000, 'currency' => 'usd', 'source_transaction' => '<>', 'destination' => '<>', ]); ``` ```ruby Stripe.api_key = '<>' transfer = Stripe::Transfer.create({ amount: 1000, currency: 'usd', source_transaction: '<>', destination: '<>', }) ``` ### Payment Links for subscriptions Pick one of the currently supported charge types that allow your platform account to be *liable for tax* with [Stripe Payment Links](https://docs.stripe.com/tax/payment-links.md): This charge type isn’t supported for use cases involving a connected account where the platform is *liable for tax*. For the Payment Links API calls: * Include [automatic_tax[liability]](https://docs.stripe.com/api/payment_links/payment_links/create.md#create_payment_link-automatic_tax-liability) with `type=self`. * Include [transfer_data[destination]](https://docs.stripe.com/api/payment_links/payment_links/create.md#create_payment_link-transfer_data) with the value of the connected account ID. * Include [subscription_data[invoice_settings][issuer]](https://docs.stripe.com/api/payment_links/payment_links/create.md#create_payment_link-subscription_data-invoice_settings-issuer) with `type=self`. * (Optional) If the connected account is the [settlement merchant](https://docs.stripe.com/connect/destination-charges.md#settlement-merchant), include [subscription_data[on_behalf_of]](https://docs.stripe.com/api/payment_links/payment_links/create.md#create_payment_link-on_behalf_of) with the value of the connected account ID. ```dotnet StripeConfiguration.ApiKey = "<>"; var options = new PaymentLinkCreateOptions { LineItems = new List { new PaymentLinkLineItemOptions { Price = "<>", Quantity = 1 }, }, AutomaticTax = new PaymentLinkAutomaticTaxOptions { Enabled = true, Liability = new PaymentLinkAutomaticTaxLiabilityOptions { Type = "self" }, }, TransferData = new PaymentLinkTransferDataOptions { Destination = "<>" }, SubscriptionData = new PaymentLinkSubscriptionDataOptions { InvoiceSettings = new PaymentLinkSubscriptionDataInvoiceSettingsOptions { Issuer = new PaymentLinkSubscriptionDataInvoiceSettingsIssuerOptions { Type = "self" }, }, }, }; var service = new PaymentLinkService(); PaymentLink paymentLink = service.Create(options); ``` ```go stripe.Key = "<>" params := &stripe.PaymentLinkParams{ LineItems: []*stripe.PaymentLinkLineItemParams{ &stripe.PaymentLinkLineItemParams{Price: stripe.String("<>"), Quantity: stripe.Int64(1)}, }, AutomaticTax: &stripe.PaymentLinkAutomaticTaxParams{ Enabled: stripe.Bool(true), Liability: &stripe.PaymentLinkAutomaticTaxLiabilityParams{ Type: stripe.String(string(stripe.PaymentLinkAutomaticTaxLiabilityTypeSelf)), }, }, TransferData: &stripe.PaymentLinkTransferDataParams{ Destination: stripe.String("<>"), }, SubscriptionData: &stripe.PaymentLinkSubscriptionDataParams{ InvoiceSettings: &stripe.PaymentLinkSubscriptionDataInvoiceSettingsParams{ Issuer: &stripe.PaymentLinkSubscriptionDataInvoiceSettingsIssuerParams{ Type: stripe.String(string(stripe.PaymentLinkSubscriptionDataInvoiceSettingsIssuerTypeSelf)), }, }, }, }; result, err := paymentlink.New(params); ``` ```java Stripe.apiKey = "<>"; PaymentLinkCreateParams params = PaymentLinkCreateParams.builder() .addLineItem( PaymentLinkCreateParams.LineItem.builder().setPrice("<>").setQuantity(1L).build() ) .setAutomaticTax( PaymentLinkCreateParams.AutomaticTax.builder() .setEnabled(true) .setLiability( PaymentLinkCreateParams.AutomaticTax.Liability.builder() .setType(PaymentLinkCreateParams.AutomaticTax.Liability.Type.SELF) .build() ) .build() ) .setTransferData( PaymentLinkCreateParams.TransferData.builder().setDestination("<>").build() ) .setSubscriptionData( PaymentLinkCreateParams.SubscriptionData.builder() .setInvoiceSettings( PaymentLinkCreateParams.SubscriptionData.InvoiceSettings.builder() .setIssuer( PaymentLinkCreateParams.SubscriptionData.InvoiceSettings.Issuer.builder() .setType(PaymentLinkCreateParams.SubscriptionData.InvoiceSettings.Issuer.Type.SELF) .build() ) .build() ) .build() ) .build(); PaymentLink paymentLink = PaymentLink.create(params); ``` ```node const stripe = require('stripe')('<>'); const paymentLink = await stripe.paymentLinks.create({ line_items: [ { price: '<>', quantity: 1, }, ], automatic_tax: { enabled: true, liability: { type: 'self', }, }, transfer_data: { destination: '<>', }, subscription_data: { invoice_settings: { issuer: { type: 'self', }, }, }, }); ``` ```python import stripe stripe.api_key = "<>" payment_link = stripe.PaymentLink.create( line_items=[{"price": "<>", "quantity": 1}], automatic_tax={"enabled": True, "liability": {"type": "self"}}, transfer_data={"destination": "<>"}, subscription_data={"invoice_settings": {"issuer": {"type": "self"}}}, ) ``` ```php $stripe = new \Stripe\StripeClient('<>'); $paymentLink = $stripe->paymentLinks->create([ 'line_items' => [ [ 'price' => '<>', 'quantity' => 1, ], ], 'automatic_tax' => [ 'enabled' => true, 'liability' => ['type' => 'self'], ], 'transfer_data' => ['destination' => '<>'], 'subscription_data' => ['invoice_settings' => ['issuer' => ['type' => 'self']]], ]); ``` ```ruby Stripe.api_key = '<>' payment_link = Stripe::PaymentLink.create({ line_items: [ { price: '<>', quantity: 1, }, ], automatic_tax: { enabled: true, liability: {type: 'self'}, }, transfer_data: {destination: '<>'}, subscription_data: {invoice_settings: {issuer: {type: 'self'}}}, }) ``` For the Payment Links API calls: * Include [automatic_tax[liability]](https://docs.stripe.com/api/payment_links/payment_links/create.md#create_payment_link-automatic_tax-liability) with `type=self`. * Include [subscription_data[invoice_settings][issuer]](https://docs.stripe.com/api/payment_links/payment_links/create.md#create_payment_link-subscription_data-invoice_settings-issuer) with `type=self`. * (Optional) If the connected account is the [settlement merchant](https://docs.stripe.com/connect/separate-charges-and-transfers.md#settlement-merchant), include [subscription_data[on_behalf_of]](https://docs.stripe.com/api/payment_links/payment_links/create.md#create_payment_link-on_behalf_of) with the value of the connected account ID. ```dotnet StripeConfiguration.ApiKey = "<>"; var options = new PaymentLinkCreateOptions { LineItems = new List { new PaymentLinkLineItemOptions { Price = "<>", Quantity = 1 }, }, AutomaticTax = new PaymentLinkAutomaticTaxOptions { Enabled = true, Liability = new PaymentLinkAutomaticTaxLiabilityOptions { Type = "self" }, }, SubscriptionData = new PaymentLinkSubscriptionDataOptions { InvoiceSettings = new PaymentLinkSubscriptionDataInvoiceSettingsOptions { Issuer = new PaymentLinkSubscriptionDataInvoiceSettingsIssuerOptions { Type = "self" }, }, }, }; var service = new PaymentLinkService(); PaymentLink paymentLink = service.Create(options); ``` ```go stripe.Key = "<>" params := &stripe.PaymentLinkParams{ LineItems: []*stripe.PaymentLinkLineItemParams{ &stripe.PaymentLinkLineItemParams{Price: stripe.String("<>"), Quantity: stripe.Int64(1)}, }, AutomaticTax: &stripe.PaymentLinkAutomaticTaxParams{ Enabled: stripe.Bool(true), Liability: &stripe.PaymentLinkAutomaticTaxLiabilityParams{ Type: stripe.String(string(stripe.PaymentLinkAutomaticTaxLiabilityTypeSelf)), }, }, SubscriptionData: &stripe.PaymentLinkSubscriptionDataParams{ InvoiceSettings: &stripe.PaymentLinkSubscriptionDataInvoiceSettingsParams{ Issuer: &stripe.PaymentLinkSubscriptionDataInvoiceSettingsIssuerParams{ Type: stripe.String(string(stripe.PaymentLinkSubscriptionDataInvoiceSettingsIssuerTypeSelf)), }, }, }, }; result, err := paymentlink.New(params); ``` ```java Stripe.apiKey = "<>"; PaymentLinkCreateParams params = PaymentLinkCreateParams.builder() .addLineItem( PaymentLinkCreateParams.LineItem.builder().setPrice("<>").setQuantity(1L).build() ) .setAutomaticTax( PaymentLinkCreateParams.AutomaticTax.builder() .setEnabled(true) .setLiability( PaymentLinkCreateParams.AutomaticTax.Liability.builder() .setType(PaymentLinkCreateParams.AutomaticTax.Liability.Type.SELF) .build() ) .build() ) .setSubscriptionData( PaymentLinkCreateParams.SubscriptionData.builder() .setInvoiceSettings( PaymentLinkCreateParams.SubscriptionData.InvoiceSettings.builder() .setIssuer( PaymentLinkCreateParams.SubscriptionData.InvoiceSettings.Issuer.builder() .setType(PaymentLinkCreateParams.SubscriptionData.InvoiceSettings.Issuer.Type.SELF) .build() ) .build() ) .build() ) .build(); PaymentLink paymentLink = PaymentLink.create(params); ``` ```node const stripe = require('stripe')('<>'); const paymentLink = await stripe.paymentLinks.create({ line_items: [ { price: '<>', quantity: 1, }, ], automatic_tax: { enabled: true, liability: { type: 'self', }, }, subscription_data: { invoice_settings: { issuer: { type: 'self', }, }, }, }); ``` ```python import stripe stripe.api_key = "<>" payment_link = stripe.PaymentLink.create( line_items=[{"price": "<>", "quantity": 1}], automatic_tax={"enabled": True, "liability": {"type": "self"}}, subscription_data={"invoice_settings": {"issuer": {"type": "self"}}}, ) ``` ```php $stripe = new \Stripe\StripeClient('<>'); $paymentLink = $stripe->paymentLinks->create([ 'line_items' => [ [ 'price' => '<>', 'quantity' => 1, ], ], 'automatic_tax' => [ 'enabled' => true, 'liability' => ['type' => 'self'], ], 'subscription_data' => ['invoice_settings' => ['issuer' => ['type' => 'self']]], ]); ``` ```ruby Stripe.api_key = '<>' payment_link = Stripe::PaymentLink.create({ line_items: [ { price: '<>', quantity: 1, }, ], automatic_tax: { enabled: true, liability: {type: 'self'}, }, subscription_data: {invoice_settings: {issuer: {type: 'self'}}}, }) ``` For the Transfers API calls: * Include [source_transaction](https://docs.stripe.com/api/transfers/create.md#create_transfer-source_transaction) to tie the transfer to the Payment Intent created by the Payment Link. * Include [destination](https://docs.stripe.com/api/transfers/create.md#create_transfer-destination) with the value of the connected account ID. ```dotnet StripeConfiguration.ApiKey = "<>"; var options = new TransferCreateOptions { Amount = 1000, Currency = "usd", SourceTransaction = "<>", Destination = "<>", }; var service = new TransferService(); Transfer transfer = service.Create(options); ``` ```go stripe.Key = "<>" params := &stripe.TransferParams{ Amount: stripe.Int64(1000), Currency: stripe.String(string(stripe.CurrencyUSD)), SourceTransaction: stripe.String("<>"), Destination: stripe.String("<>"), }; result, err := transfer.New(params); ``` ```java Stripe.apiKey = "<>"; TransferCreateParams params = TransferCreateParams.builder() .setAmount(1000L) .setCurrency("usd") .setSourceTransaction("<>") .setDestination("<>") .build(); Transfer transfer = Transfer.create(params); ``` ```node const stripe = require('stripe')('<>'); const transfer = await stripe.transfers.create({ amount: 1000, currency: 'usd', source_transaction: '<>', destination: '<>', }); ``` ```python import stripe stripe.api_key = "<>" transfer = stripe.Transfer.create( amount=1000, currency="usd", source_transaction="<>", destination="<>", ) ``` ```php $stripe = new \Stripe\StripeClient('<>'); $transfer = $stripe->transfers->create([ 'amount' => 1000, 'currency' => 'usd', 'source_transaction' => '<>', 'destination' => '<>', ]); ``` ```ruby Stripe.api_key = '<>' transfer = Stripe::Transfer.create({ amount: 1000, currency: 'usd', source_transaction: '<>', destination: '<>', }) ``` ### Checkout ### Checkout Sessions for one-time payments Pick one of the currently supported charge types that allow your platform account to be *liable for tax* with [Stripe Checkout](https://docs.stripe.com/tax/checkout.md): This charge type isn’t supported for use cases involving a connected account where the platform is *liable for tax*. For the Checkout Sessions API calls: * Include [automatic_tax[liability]](https://docs.stripe.com/api/checkout/sessions/create.md#create_checkout_session-automatic_tax-liability) with `type=self`. * Include [payment_intent_data[transfer_data][destination]](https://docs.stripe.com/api/checkout/sessions/create.md#create_checkout_session-payment_intent_data-transfer_data-destination) with the value of the connected account ID. * (Optional) If you’re [automatically sending invoices](https://docs.stripe.com/payments/checkout/receipts.md?payment-ui=stripe-hosted#automatically-send-receipts), include [invoice_creation[invoice_data][issuer]](https://docs.stripe.com/api/checkout/sessions/create.md#create_checkout_session-invoice_creation-invoice_data-issuer) with `type=self`. * (Optional) If the connected account is the [settlement merchant](https://docs.stripe.com/connect/destination-charges.md#settlement-merchant), include [payment_intent_data[on_behalf_of]](https://docs.stripe.com/api/checkout/sessions/create.md#create_checkout_session-payment_intent_data-on_behalf_of) with the value of the connected account ID. ```dotnet StripeConfiguration.ApiKey = "<>"; var options = new Stripe.Checkout.SessionCreateOptions { LineItems = new List { new Stripe.Checkout.SessionLineItemOptions { Price = "<>", Quantity = 2 }, }, AutomaticTax = new Stripe.Checkout.SessionAutomaticTaxOptions { Enabled = true, Liability = new Stripe.Checkout.SessionAutomaticTaxLiabilityOptions { Type = "self" }, }, PaymentIntentData = new Stripe.Checkout.SessionPaymentIntentDataOptions { TransferData = new Stripe.Checkout.SessionPaymentIntentDataTransferDataOptions { Destination = "<>", }, }, InvoiceCreation = new Stripe.Checkout.SessionInvoiceCreationOptions { Enabled = true, InvoiceData = new Stripe.Checkout.SessionInvoiceCreationInvoiceDataOptions { Issuer = new Stripe.Checkout.SessionInvoiceCreationInvoiceDataIssuerOptions { Type = "self", }, }, }, Mode = "payment", SuccessUrl = "https://example.com/success", CancelUrl = "https://example.com/cancel", }; var service = new Stripe.Checkout.SessionService(); Stripe.Checkout.Session session = service.Create(options); ``` ```go stripe.Key = "<>" params := &stripe.CheckoutSessionParams{ LineItems: []*stripe.CheckoutSessionLineItemParams{ &stripe.CheckoutSessionLineItemParams{ Price: stripe.String("<>"), Quantity: stripe.Int64(2), }, }, AutomaticTax: &stripe.CheckoutSessionAutomaticTaxParams{ Enabled: stripe.Bool(true), Liability: &stripe.CheckoutSessionAutomaticTaxLiabilityParams{ Type: stripe.String(string(stripe.CheckoutSessionAutomaticTaxLiabilityTypeSelf)), }, }, PaymentIntentData: &stripe.CheckoutSessionPaymentIntentDataParams{ TransferData: &stripe.CheckoutSessionPaymentIntentDataTransferDataParams{ Destination: stripe.String("<>"), }, }, InvoiceCreation: &stripe.CheckoutSessionInvoiceCreationParams{ Enabled: stripe.Bool(true), InvoiceData: &stripe.CheckoutSessionInvoiceCreationInvoiceDataParams{ Issuer: &stripe.CheckoutSessionInvoiceCreationInvoiceDataIssuerParams{ Type: stripe.String(string(stripe.CheckoutSessionInvoiceCreationInvoiceDataIssuerTypeSelf)), }, }, }, Mode: stripe.String(string(stripe.CheckoutSessionModePayment)), SuccessURL: stripe.String("https://example.com/success"), CancelURL: stripe.String("https://example.com/cancel"), }; result, err := session.New(params); ``` ```java Stripe.apiKey = "<>"; SessionCreateParams params = SessionCreateParams.builder() .addLineItem( SessionCreateParams.LineItem.builder().setPrice("<>").setQuantity(2L).build() ) .setAutomaticTax( SessionCreateParams.AutomaticTax.builder() .setEnabled(true) .setLiability( SessionCreateParams.AutomaticTax.Liability.builder() .setType(SessionCreateParams.AutomaticTax.Liability.Type.SELF) .build() ) .build() ) .setPaymentIntentData( SessionCreateParams.PaymentIntentData.builder() .setTransferData( SessionCreateParams.PaymentIntentData.TransferData.builder() .setDestination("<>") .build() ) .build() ) .setInvoiceCreation( SessionCreateParams.InvoiceCreation.builder() .setEnabled(true) .setInvoiceData( SessionCreateParams.InvoiceCreation.InvoiceData.builder() .setIssuer( SessionCreateParams.InvoiceCreation.InvoiceData.Issuer.builder() .setType(SessionCreateParams.InvoiceCreation.InvoiceData.Issuer.Type.SELF) .build() ) .build() ) .build() ) .setMode(SessionCreateParams.Mode.PAYMENT) .setSuccessUrl("https://example.com/success") .setCancelUrl("https://example.com/cancel") .build(); Session session = Session.create(params); ``` ```node const stripe = require('stripe')('<>'); const session = await stripe.checkout.sessions.create({ line_items: [ { price: '<>', quantity: 2, }, ], automatic_tax: { enabled: true, liability: { type: 'self', }, }, payment_intent_data: { transfer_data: { destination: '<>', }, }, invoice_creation: { enabled: true, invoice_data: { issuer: { type: 'self', }, }, }, mode: 'payment', success_url: 'https://example.com/success', cancel_url: 'https://example.com/cancel', }); ``` ```python import stripe stripe.api_key = "<>" session = stripe.checkout.Session.create( line_items=[{"price": "<>", "quantity": 2}], automatic_tax={"enabled": True, "liability": {"type": "self"}}, payment_intent_data={"transfer_data": {"destination": "<>"}}, invoice_creation={"enabled": True, "invoice_data": {"issuer": {"type": "self"}}}, mode="payment", success_url="https://example.com/success", cancel_url="https://example.com/cancel", ) ``` ```php $stripe = new \Stripe\StripeClient('<>'); $session = $stripe->checkout->sessions->create([ 'line_items' => [ [ 'price' => '<>', 'quantity' => 2, ], ], 'automatic_tax' => [ 'enabled' => true, 'liability' => ['type' => 'self'], ], 'payment_intent_data' => ['transfer_data' => ['destination' => '<>']], 'invoice_creation' => [ 'enabled' => true, 'invoice_data' => ['issuer' => ['type' => 'self']], ], 'mode' => 'payment', 'success_url' => 'https://example.com/success', 'cancel_url' => 'https://example.com/cancel', ]); ``` ```ruby Stripe.api_key = '<>' session = Stripe::Checkout::Session.create({ line_items: [ { price: '<>', quantity: 2, }, ], automatic_tax: { enabled: true, liability: {type: 'self'}, }, payment_intent_data: {transfer_data: {destination: '<>'}}, invoice_creation: { enabled: true, invoice_data: {issuer: {type: 'self'}}, }, mode: 'payment', success_url: 'https://example.com/success', cancel_url: 'https://example.com/cancel', }) ``` For the Checkout Sessions API calls: * Include [automatic_tax[liability]](https://docs.stripe.com/api/checkout/sessions/create.md#create_checkout_session-automatic_tax-liability) with `type=self`. * (Optional) If you’re [automatically sending invoices](https://docs.stripe.com/payments/checkout/receipts.md?payment-ui=stripe-hosted#automatically-send-receipts), include [invoice_creation[invoice_data][issuer]](https://docs.stripe.com/api/checkout/sessions/create.md#create_checkout_session-invoice_creation-invoice_data-issuer) with `type=self`. * (Optional) If the connected account is the [settlement merchant](https://docs.stripe.com/connect/separate-charges-and-transfers.md#settlement-merchant), include [payment_intent_data[on_behalf_of]](https://docs.stripe.com/api/checkout/sessions/create.md#create_checkout_session-payment_intent_data-on_behalf_of) with the value of the connected account ID. ```dotnet StripeConfiguration.ApiKey = "<>"; var options = new Stripe.Checkout.SessionCreateOptions { LineItems = new List { new Stripe.Checkout.SessionLineItemOptions { Price = "<>", Quantity = 2 }, }, AutomaticTax = new Stripe.Checkout.SessionAutomaticTaxOptions { Enabled = true, Liability = new Stripe.Checkout.SessionAutomaticTaxLiabilityOptions { Type = "self" }, }, InvoiceCreation = new Stripe.Checkout.SessionInvoiceCreationOptions { Enabled = true, InvoiceData = new Stripe.Checkout.SessionInvoiceCreationInvoiceDataOptions { Issuer = new Stripe.Checkout.SessionInvoiceCreationInvoiceDataIssuerOptions { Type = "self", }, }, }, Mode = "payment", SuccessUrl = "https://example.com/success", CancelUrl = "https://example.com/cancel", }; var service = new Stripe.Checkout.SessionService(); Stripe.Checkout.Session session = service.Create(options); ``` ```go stripe.Key = "<>" params := &stripe.CheckoutSessionParams{ LineItems: []*stripe.CheckoutSessionLineItemParams{ &stripe.CheckoutSessionLineItemParams{ Price: stripe.String("<>"), Quantity: stripe.Int64(2), }, }, AutomaticTax: &stripe.CheckoutSessionAutomaticTaxParams{ Enabled: stripe.Bool(true), Liability: &stripe.CheckoutSessionAutomaticTaxLiabilityParams{ Type: stripe.String(string(stripe.CheckoutSessionAutomaticTaxLiabilityTypeSelf)), }, }, InvoiceCreation: &stripe.CheckoutSessionInvoiceCreationParams{ Enabled: stripe.Bool(true), InvoiceData: &stripe.CheckoutSessionInvoiceCreationInvoiceDataParams{ Issuer: &stripe.CheckoutSessionInvoiceCreationInvoiceDataIssuerParams{ Type: stripe.String(string(stripe.CheckoutSessionInvoiceCreationInvoiceDataIssuerTypeSelf)), }, }, }, Mode: stripe.String(string(stripe.CheckoutSessionModePayment)), SuccessURL: stripe.String("https://example.com/success"), CancelURL: stripe.String("https://example.com/cancel"), }; result, err := session.New(params); ``` ```java Stripe.apiKey = "<>"; SessionCreateParams params = SessionCreateParams.builder() .addLineItem( SessionCreateParams.LineItem.builder().setPrice("<>").setQuantity(2L).build() ) .setAutomaticTax( SessionCreateParams.AutomaticTax.builder() .setEnabled(true) .setLiability( SessionCreateParams.AutomaticTax.Liability.builder() .setType(SessionCreateParams.AutomaticTax.Liability.Type.SELF) .build() ) .build() ) .setInvoiceCreation( SessionCreateParams.InvoiceCreation.builder() .setEnabled(true) .setInvoiceData( SessionCreateParams.InvoiceCreation.InvoiceData.builder() .setIssuer( SessionCreateParams.InvoiceCreation.InvoiceData.Issuer.builder() .setType(SessionCreateParams.InvoiceCreation.InvoiceData.Issuer.Type.SELF) .build() ) .build() ) .build() ) .setMode(SessionCreateParams.Mode.PAYMENT) .setSuccessUrl("https://example.com/success") .setCancelUrl("https://example.com/cancel") .build(); Session session = Session.create(params); ``` ```node const stripe = require('stripe')('<>'); const session = await stripe.checkout.sessions.create({ line_items: [ { price: '<>', quantity: 2, }, ], automatic_tax: { enabled: true, liability: { type: 'self', }, }, invoice_creation: { enabled: true, invoice_data: { issuer: { type: 'self', }, }, }, mode: 'payment', success_url: 'https://example.com/success', cancel_url: 'https://example.com/cancel', }); ``` ```python import stripe stripe.api_key = "<>" session = stripe.checkout.Session.create( line_items=[{"price": "<>", "quantity": 2}], automatic_tax={"enabled": True, "liability": {"type": "self"}}, invoice_creation={"enabled": True, "invoice_data": {"issuer": {"type": "self"}}}, mode="payment", success_url="https://example.com/success", cancel_url="https://example.com/cancel", ) ``` ```php $stripe = new \Stripe\StripeClient('<>'); $session = $stripe->checkout->sessions->create([ 'line_items' => [ [ 'price' => '<>', 'quantity' => 2, ], ], 'automatic_tax' => [ 'enabled' => true, 'liability' => ['type' => 'self'], ], 'invoice_creation' => [ 'enabled' => true, 'invoice_data' => ['issuer' => ['type' => 'self']], ], 'mode' => 'payment', 'success_url' => 'https://example.com/success', 'cancel_url' => 'https://example.com/cancel', ]); ``` ```ruby Stripe.api_key = '<>' session = Stripe::Checkout::Session.create({ line_items: [ { price: '<>', quantity: 2, }, ], automatic_tax: { enabled: true, liability: {type: 'self'}, }, invoice_creation: { enabled: true, invoice_data: {issuer: {type: 'self'}}, }, mode: 'payment', success_url: 'https://example.com/success', cancel_url: 'https://example.com/cancel', }) ``` For the Transfers API calls: * Include [source_transaction](https://docs.stripe.com/api/transfers/create.md#create_transfer-source_transaction) to tie the transfer to the Payment Intent created by the Checkout Session. * Include [destination](https://docs.stripe.com/api/transfers/create.md#create_transfer-destination) with the value of the connected account ID. ```dotnet StripeConfiguration.ApiKey = "<>"; var options = new TransferCreateOptions { Amount = 1000, Currency = "usd", SourceTransaction = "<>", Destination = "<>", }; var service = new TransferService(); Transfer transfer = service.Create(options); ``` ```go stripe.Key = "<>" params := &stripe.TransferParams{ Amount: stripe.Int64(1000), Currency: stripe.String(string(stripe.CurrencyUSD)), SourceTransaction: stripe.String("<>"), Destination: stripe.String("<>"), }; result, err := transfer.New(params); ``` ```java Stripe.apiKey = "<>"; TransferCreateParams params = TransferCreateParams.builder() .setAmount(1000L) .setCurrency("usd") .setSourceTransaction("<>") .setDestination("<>") .build(); Transfer transfer = Transfer.create(params); ``` ```node const stripe = require('stripe')('<>'); const transfer = await stripe.transfers.create({ amount: 1000, currency: 'usd', source_transaction: '<>', destination: '<>', }); ``` ```python import stripe stripe.api_key = "<>" transfer = stripe.Transfer.create( amount=1000, currency="usd", source_transaction="<>", destination="<>", ) ``` ```php $stripe = new \Stripe\StripeClient('<>'); $transfer = $stripe->transfers->create([ 'amount' => 1000, 'currency' => 'usd', 'source_transaction' => '<>', 'destination' => '<>', ]); ``` ```ruby Stripe.api_key = '<>' transfer = Stripe::Transfer.create({ amount: 1000, currency: 'usd', source_transaction: '<>', destination: '<>', }) ``` ### Checkout Sessions for subscriptions Pick one of the currently supported charge types that allow your platform account to be *liable for tax* with [Stripe Checkout](https://docs.stripe.com/tax/checkout.md): This charge type isn’t supported for use cases involving a connected account where the platform is *liable for tax*. For the Checkout Sessions API calls: * Include [automatic_tax[liability]](https://docs.stripe.com/api/checkout/sessions/create.md#create_checkout_session-automatic_tax-liability) with `type=self`. * Include [subscription_data[transfer_data][destination]](https://docs.stripe.com/api/checkout/sessions/create.md#create_checkout_session-subscription_data-transfer_data-destination) with the value of the connected account ID. * Include [subscription_data[invoice_settings][issuer]](https://docs.stripe.com/api/checkout/sessions/create.md#create_checkout_session-subscription_data-invoice_settings-issuer) with `type=self`. * (Optional) If the connected account is the [settlement merchant](https://docs.stripe.com/connect/destination-charges.md#settlement-merchant), include [subscription_data[on_behalf_of]](https://docs.stripe.com/api/checkout/sessions/create.md#create_checkout_session-subscription_data-on_behalf_of) with the value of the connected account ID. ```dotnet StripeConfiguration.ApiKey = "<>"; var options = new Stripe.Checkout.SessionCreateOptions { LineItems = new List { new Stripe.Checkout.SessionLineItemOptions { Price = "<>", Quantity = 1 }, }, AutomaticTax = new Stripe.Checkout.SessionAutomaticTaxOptions { Enabled = true, Liability = new Stripe.Checkout.SessionAutomaticTaxLiabilityOptions { Type = "self" }, }, SubscriptionData = new Stripe.Checkout.SessionSubscriptionDataOptions { TransferData = new Stripe.Checkout.SessionSubscriptionDataTransferDataOptions { Destination = "<>", }, InvoiceSettings = new Stripe.Checkout.SessionSubscriptionDataInvoiceSettingsOptions { Issuer = new Stripe.Checkout.SessionSubscriptionDataInvoiceSettingsIssuerOptions { Type = "self", }, }, }, Mode = "subscription", SuccessUrl = "https://example.com/success", CancelUrl = "https://example.com/cancel", }; var service = new Stripe.Checkout.SessionService(); Stripe.Checkout.Session session = service.Create(options); ``` ```go stripe.Key = "<>" params := &stripe.CheckoutSessionParams{ LineItems: []*stripe.CheckoutSessionLineItemParams{ &stripe.CheckoutSessionLineItemParams{ Price: stripe.String("<>"), Quantity: stripe.Int64(1), }, }, AutomaticTax: &stripe.CheckoutSessionAutomaticTaxParams{ Enabled: stripe.Bool(true), Liability: &stripe.CheckoutSessionAutomaticTaxLiabilityParams{ Type: stripe.String(string(stripe.CheckoutSessionAutomaticTaxLiabilityTypeSelf)), }, }, SubscriptionData: &stripe.CheckoutSessionSubscriptionDataParams{ TransferData: &stripe.CheckoutSessionSubscriptionDataTransferDataParams{ Destination: stripe.String("<>"), }, InvoiceSettings: &stripe.CheckoutSessionSubscriptionDataInvoiceSettingsParams{ Issuer: &stripe.CheckoutSessionSubscriptionDataInvoiceSettingsIssuerParams{ Type: stripe.String("self"), }, }, }, Mode: stripe.String(string(stripe.CheckoutSessionModeSubscription)), SuccessURL: stripe.String("https://example.com/success"), CancelURL: stripe.String("https://example.com/cancel"), }; result, err := session.New(params); ``` ```java Stripe.apiKey = "<>"; SessionCreateParams params = SessionCreateParams.builder() .addLineItem( SessionCreateParams.LineItem.builder().setPrice("<>").setQuantity(1L).build() ) .setAutomaticTax( SessionCreateParams.AutomaticTax.builder() .setEnabled(true) .setLiability( SessionCreateParams.AutomaticTax.Liability.builder() .setType(SessionCreateParams.AutomaticTax.Liability.Type.SELF) .build() ) .build() ) .setSubscriptionData( SessionCreateParams.SubscriptionData.builder() .setTransferData( SessionCreateParams.SubscriptionData.TransferData.builder() .setDestination("<>") .build() ) .setInvoiceSettings( SessionCreateParams.SubscriptionData.InvoiceSettings.builder() .setIssuer( SessionCreateParams.SubscriptionData.InvoiceSettings.Issuer.builder() .setType(SessionCreateParams.SubscriptionData.InvoiceSettings.Issuer.Type.SELF) .build() ) .build() ) .build() ) .setMode(SessionCreateParams.Mode.SUBSCRIPTION) .setSuccessUrl("https://example.com/success") .setCancelUrl("https://example.com/cancel") .build(); Session session = Session.create(params); ``` ```node const stripe = require('stripe')('<>'); const session = await stripe.checkout.sessions.create({ line_items: [ { price: '<>', quantity: 1, }, ], automatic_tax: { enabled: true, liability: { type: 'self', }, }, subscription_data: { transfer_data: { destination: '<>', }, invoice_settings: { issuer: { type: 'self', }, }, }, mode: 'subscription', success_url: 'https://example.com/success', cancel_url: 'https://example.com/cancel', }); ``` ```python import stripe stripe.api_key = "<>" session = stripe.checkout.Session.create( line_items=[{"price": "<>", "quantity": 1}], automatic_tax={"enabled": True, "liability": {"type": "self"}}, subscription_data={ "transfer_data": {"destination": "<>"}, "invoice_settings": {"issuer": {"type": "self"}}, }, mode="subscription", success_url="https://example.com/success", cancel_url="https://example.com/cancel", ) ``` ```php $stripe = new \Stripe\StripeClient('<>'); $session = $stripe->checkout->sessions->create([ 'line_items' => [ [ 'price' => '<>', 'quantity' => 1, ], ], 'automatic_tax' => [ 'enabled' => true, 'liability' => ['type' => 'self'], ], 'subscription_data' => [ 'transfer_data' => ['destination' => '<>'], 'invoice_settings' => ['issuer' => ['type' => 'self']], ], 'mode' => 'subscription', 'success_url' => 'https://example.com/success', 'cancel_url' => 'https://example.com/cancel', ]); ``` ```ruby Stripe.api_key = '<>' session = Stripe::Checkout::Session.create({ line_items: [ { price: '<>', quantity: 1, }, ], automatic_tax: { enabled: true, liability: {type: 'self'}, }, subscription_data: { transfer_data: {destination: '<>'}, invoice_settings: {issuer: {type: 'self'}}, }, mode: 'subscription', success_url: 'https://example.com/success', cancel_url: 'https://example.com/cancel', }) ``` For the Checkout Sessions API calls: * Include [automatic_tax[liability]](https://docs.stripe.com/api/checkout/sessions/create.md#create_checkout_session-automatic_tax-liability) with `type=self`. * Include [subscription_data[invoice_settings][issuer]](https://docs.stripe.com/api/checkout/sessions/create.md#create_checkout_session-subscription_data-invoice_settings-issuer) with `type=self`. * (Optional) If the connected account is the [settlement merchant](https://docs.stripe.com/connect/separate-charges-and-transfers.md#settlement-merchant), include [subscription_data[on_behalf_of]](https://docs.stripe.com/api/checkout/sessions/create.md#create_checkout_session-subscription_data-on_behalf_of) with the value of the connected account ID. ```dotnet StripeConfiguration.ApiKey = "<>"; var options = new Stripe.Checkout.SessionCreateOptions { LineItems = new List { new Stripe.Checkout.SessionLineItemOptions { Price = "<>", Quantity = 1 }, }, AutomaticTax = new Stripe.Checkout.SessionAutomaticTaxOptions { Enabled = true, Liability = new Stripe.Checkout.SessionAutomaticTaxLiabilityOptions { Type = "self" }, }, SubscriptionData = new Stripe.Checkout.SessionSubscriptionDataOptions { InvoiceSettings = new Stripe.Checkout.SessionSubscriptionDataInvoiceSettingsOptions { Issuer = new Stripe.Checkout.SessionSubscriptionDataInvoiceSettingsIssuerOptions { Type = "self", }, }, }, Mode = "subscription", SuccessUrl = "https://example.com/success", CancelUrl = "https://example.com/cancel", }; var service = new Stripe.Checkout.SessionService(); Stripe.Checkout.Session session = service.Create(options); ``` ```go stripe.Key = "<>" params := &stripe.CheckoutSessionParams{ LineItems: []*stripe.CheckoutSessionLineItemParams{ &stripe.CheckoutSessionLineItemParams{ Price: stripe.String("<>"), Quantity: stripe.Int64(1), }, }, AutomaticTax: &stripe.CheckoutSessionAutomaticTaxParams{ Enabled: stripe.Bool(true), Liability: &stripe.CheckoutSessionAutomaticTaxLiabilityParams{ Type: stripe.String(string(stripe.CheckoutSessionAutomaticTaxLiabilityTypeSelf)), }, }, SubscriptionData: &stripe.CheckoutSessionSubscriptionDataParams{ InvoiceSettings: &stripe.CheckoutSessionSubscriptionDataInvoiceSettingsParams{ Issuer: &stripe.CheckoutSessionSubscriptionDataInvoiceSettingsIssuerParams{ Type: stripe.String("self"), }, }, }, Mode: stripe.String(string(stripe.CheckoutSessionModeSubscription)), SuccessURL: stripe.String("https://example.com/success"), CancelURL: stripe.String("https://example.com/cancel"), }; result, err := session.New(params); ``` ```java Stripe.apiKey = "<>"; SessionCreateParams params = SessionCreateParams.builder() .addLineItem( SessionCreateParams.LineItem.builder().setPrice("<>").setQuantity(1L).build() ) .setAutomaticTax( SessionCreateParams.AutomaticTax.builder() .setEnabled(true) .setLiability( SessionCreateParams.AutomaticTax.Liability.builder() .setType(SessionCreateParams.AutomaticTax.Liability.Type.SELF) .build() ) .build() ) .setSubscriptionData( SessionCreateParams.SubscriptionData.builder() .setInvoiceSettings( SessionCreateParams.SubscriptionData.InvoiceSettings.builder() .setIssuer( SessionCreateParams.SubscriptionData.InvoiceSettings.Issuer.builder() .setType(SessionCreateParams.SubscriptionData.InvoiceSettings.Issuer.Type.SELF) .build() ) .build() ) .build() ) .setMode(SessionCreateParams.Mode.SUBSCRIPTION) .setSuccessUrl("https://example.com/success") .setCancelUrl("https://example.com/cancel") .build(); Session session = Session.create(params); ``` ```node const stripe = require('stripe')('<>'); const session = await stripe.checkout.sessions.create({ line_items: [ { price: '<>', quantity: 1, }, ], automatic_tax: { enabled: true, liability: { type: 'self', }, }, subscription_data: { invoice_settings: { issuer: { type: 'self', }, }, }, mode: 'subscription', success_url: 'https://example.com/success', cancel_url: 'https://example.com/cancel', }); ``` ```python import stripe stripe.api_key = "<>" session = stripe.checkout.Session.create( line_items=[{"price": "<>", "quantity": 1}], automatic_tax={"enabled": True, "liability": {"type": "self"}}, subscription_data={"invoice_settings": {"issuer": {"type": "self"}}}, mode="subscription", success_url="https://example.com/success", cancel_url="https://example.com/cancel", ) ``` ```php $stripe = new \Stripe\StripeClient('<>'); $session = $stripe->checkout->sessions->create([ 'line_items' => [ [ 'price' => '<>', 'quantity' => 1, ], ], 'automatic_tax' => [ 'enabled' => true, 'liability' => ['type' => 'self'], ], 'subscription_data' => ['invoice_settings' => ['issuer' => ['type' => 'self']]], 'mode' => 'subscription', 'success_url' => 'https://example.com/success', 'cancel_url' => 'https://example.com/cancel', ]); ``` ```ruby Stripe.api_key = '<>' session = Stripe::Checkout::Session.create({ line_items: [ { price: '<>', quantity: 1, }, ], automatic_tax: { enabled: true, liability: {type: 'self'}, }, subscription_data: {invoice_settings: {issuer: {type: 'self'}}}, mode: 'subscription', success_url: 'https://example.com/success', cancel_url: 'https://example.com/cancel', }) ``` For the Transfers API calls: * Include [source_transaction](https://docs.stripe.com/api/transfers/create.md#create_transfer-source_transaction) to tie the transfer to the Payment Intent created by the Checkout Session. * Include [destination](https://docs.stripe.com/api/transfers/create.md#create_transfer-destination) with the value of the connected account ID. ```dotnet StripeConfiguration.ApiKey = "<>"; var options = new TransferCreateOptions { Amount = 1000, Currency = "usd", SourceTransaction = "<>", Destination = "<>", }; var service = new TransferService(); Transfer transfer = service.Create(options); ``` ```go stripe.Key = "<>" params := &stripe.TransferParams{ Amount: stripe.Int64(1000), Currency: stripe.String(string(stripe.CurrencyUSD)), SourceTransaction: stripe.String("<>"), Destination: stripe.String("<>"), }; result, err := transfer.New(params); ``` ```java Stripe.apiKey = "<>"; TransferCreateParams params = TransferCreateParams.builder() .setAmount(1000L) .setCurrency("usd") .setSourceTransaction("<>") .setDestination("<>") .build(); Transfer transfer = Transfer.create(params); ``` ```node const stripe = require('stripe')('<>'); const transfer = await stripe.transfers.create({ amount: 1000, currency: 'usd', source_transaction: '<>', destination: '<>', }); ``` ```python import stripe stripe.api_key = "<>" transfer = stripe.Transfer.create( amount=1000, currency="usd", source_transaction="<>", destination="<>", ) ``` ```php $stripe = new \Stripe\StripeClient('<>'); $transfer = $stripe->transfers->create([ 'amount' => 1000, 'currency' => 'usd', 'source_transaction' => '<>', 'destination' => '<>', ]); ``` ```ruby Stripe.api_key = '<>' transfer = Stripe::Transfer.create({ amount: 1000, currency: 'usd', source_transaction: '<>', destination: '<>', }) ``` ### Billing ### Subscriptions Pick one of the currently supported charge types that allow your platform account to be *liable for tax* with [Stripe Subscriptions](https://docs.stripe.com/tax/subscriptions.md): This charge type isn’t supported for use cases involving a connected account where the platform is *liable for tax*. For the Subscriptions API calls: * Include [automatic_tax[liability]](https://docs.stripe.com/api/subscriptions/create.md#create_subscription-automatic_tax-liability) with `type=self`. * Include [transfer_data[destination]](https://docs.stripe.com/api/subscriptions/create.md#create_subscription-transfer_data-destination) with the value of the connected account ID. * Include [invoice_settings[issuer]](https://docs.stripe.com/api/subscriptions/create.md#create_subscription-invoice_settings-issuer) with `type=self`. In some jurisdictions, like the European Union, invoice PDFs are used as the tax instrument and the invoice issuer must match the entity *liable for tax* at all times. * (Optional) If the connected account is the [settlement merchant](https://docs.stripe.com/connect/destination-charges.md#settlement-merchant), include [on_behalf_of](https://docs.stripe.com/api/subscriptions/create.md#create_subscription-on_behalf_of) with the value of the connected account ID. ```dotnet StripeConfiguration.ApiKey = "<>"; var options = new SubscriptionCreateOptions { Items = new List { new SubscriptionItemOptions { Price = "<>", Quantity = 1 }, }, Customer = "<>", AutomaticTax = new SubscriptionAutomaticTaxOptions { Enabled = true, Liability = new SubscriptionAutomaticTaxLiabilityOptions { Type = "self" }, }, TransferData = new SubscriptionTransferDataOptions { Destination = "<>" }, InvoiceSettings = new SubscriptionInvoiceSettingsOptions { Issuer = new SubscriptionInvoiceSettingsIssuerOptions { Type = "self" }, }, }; var service = new SubscriptionService(); Subscription subscription = service.Create(options); ``` ```go stripe.Key = "<>" params := &stripe.SubscriptionParams{ Items: []*stripe.SubscriptionItemsParams{ &stripe.SubscriptionItemsParams{Price: stripe.String("<>"), Quantity: stripe.Int64(1)}, }, Customer: stripe.String("<>"), AutomaticTax: &stripe.SubscriptionAutomaticTaxParams{ Enabled: stripe.Bool(true), Liability: &stripe.SubscriptionAutomaticTaxLiabilityParams{ Type: stripe.String(string(stripe.SubscriptionAutomaticTaxLiabilityTypeSelf)), }, }, TransferData: &stripe.SubscriptionTransferDataParams{ Destination: stripe.String("<>"), }, InvoiceSettings: &stripe.SubscriptionInvoiceSettingsParams{ Issuer: &stripe.SubscriptionInvoiceSettingsIssuerParams{ Type: stripe.String(string(stripe.SubscriptionInvoiceSettingsIssuerTypeSelf)), }, }, }; result, err := subscription.New(params); ``` ```java Stripe.apiKey = "<>"; SubscriptionCreateParams params = SubscriptionCreateParams.builder() .addItem(SubscriptionCreateParams.Item.builder().setPrice("<>").setQuantity(1L).build()) .setCustomer("<>") .setAutomaticTax( SubscriptionCreateParams.AutomaticTax.builder() .setEnabled(true) .setLiability( SubscriptionCreateParams.AutomaticTax.Liability.builder() .setType(SubscriptionCreateParams.AutomaticTax.Liability.Type.SELF) .build() ) .build() ) .setTransferData( SubscriptionCreateParams.TransferData.builder().setDestination("<>").build() ) .setInvoiceSettings( SubscriptionCreateParams.InvoiceSettings.builder() .setIssuer( SubscriptionCreateParams.InvoiceSettings.Issuer.builder() .setType(SubscriptionCreateParams.InvoiceSettings.Issuer.Type.SELF) .build() ) .build() ) .build(); Subscription subscription = Subscription.create(params); ``` ```node const stripe = require('stripe')('<>'); const subscription = await stripe.subscriptions.create({ items: [ { price: '<>', quantity: 1, }, ], customer: '<>', automatic_tax: { enabled: true, liability: { type: 'self', }, }, transfer_data: { destination: '<>', }, invoice_settings: { issuer: { type: 'self', }, }, }); ``` ```python import stripe stripe.api_key = "<>" subscription = stripe.Subscription.create( items=[{"price": "<>", "quantity": 1}], customer="<>", automatic_tax={"enabled": True, "liability": {"type": "self"}}, transfer_data={"destination": "<>"}, invoice_settings={"issuer": {"type": "self"}}, ) ``` ```php $stripe = new \Stripe\StripeClient('<>'); $subscription = $stripe->subscriptions->create([ 'items' => [ [ 'price' => '<>', 'quantity' => 1, ], ], 'customer' => '<>', 'automatic_tax' => [ 'enabled' => true, 'liability' => ['type' => 'self'], ], 'transfer_data' => ['destination' => '<>'], 'invoice_settings' => ['issuer' => ['type' => 'self']], ]); ``` ```ruby Stripe.api_key = '<>' subscription = Stripe::Subscription.create({ items: [ { price: '<>', quantity: 1, }, ], customer: '<>', automatic_tax: { enabled: true, liability: {type: 'self'}, }, transfer_data: {destination: '<>'}, invoice_settings: {issuer: {type: 'self'}}, }) ``` For the Subscriptions API calls: * Include [automatic_tax[liability]](https://docs.stripe.com/api/subscriptions/create.md#create_subscription-automatic_tax-liability) with `type=self`. * Include [invoice_settings[issuer]](https://docs.stripe.com/api/subscriptions/create.md#create_subscription-invoice_settings-issuer) with `type=self`. In some jurisdictions, like the European Union, invoice PDFs are used as the tax instrument and the invoice issuer must match the entity *liable for tax* at all times. * Include [on_behalf_of](https://docs.stripe.com/api/subscriptions/create.md#create_subscription-on_behalf_of) with the value of the connected account ID. ```dotnet StripeConfiguration.ApiKey = "<>"; var options = new SubscriptionCreateOptions { Items = new List { new SubscriptionItemOptions { Price = "<>", Quantity = 1 }, }, Customer = "<>", AutomaticTax = new SubscriptionAutomaticTaxOptions { Enabled = true, Liability = new SubscriptionAutomaticTaxLiabilityOptions { Type = "self" }, }, InvoiceSettings = new SubscriptionInvoiceSettingsOptions { Issuer = new SubscriptionInvoiceSettingsIssuerOptions { Type = "self" }, }, OnBehalfOf = "<>", }; var service = new SubscriptionService(); Subscription subscription = service.Create(options); ``` ```go stripe.Key = "<>" params := &stripe.SubscriptionParams{ Items: []*stripe.SubscriptionItemsParams{ &stripe.SubscriptionItemsParams{Price: stripe.String("<>"), Quantity: stripe.Int64(1)}, }, Customer: stripe.String("<>"), AutomaticTax: &stripe.SubscriptionAutomaticTaxParams{ Enabled: stripe.Bool(true), Liability: &stripe.SubscriptionAutomaticTaxLiabilityParams{ Type: stripe.String(string(stripe.SubscriptionAutomaticTaxLiabilityTypeSelf)), }, }, InvoiceSettings: &stripe.SubscriptionInvoiceSettingsParams{ Issuer: &stripe.SubscriptionInvoiceSettingsIssuerParams{ Type: stripe.String(string(stripe.SubscriptionInvoiceSettingsIssuerTypeSelf)), }, }, OnBehalfOf: stripe.String("<>"), }; result, err := subscription.New(params); ``` ```java Stripe.apiKey = "<>"; SubscriptionCreateParams params = SubscriptionCreateParams.builder() .addItem(SubscriptionCreateParams.Item.builder().setPrice("<>").setQuantity(1L).build()) .setCustomer("<>") .setAutomaticTax( SubscriptionCreateParams.AutomaticTax.builder() .setEnabled(true) .setLiability( SubscriptionCreateParams.AutomaticTax.Liability.builder() .setType(SubscriptionCreateParams.AutomaticTax.Liability.Type.SELF) .build() ) .build() ) .setInvoiceSettings( SubscriptionCreateParams.InvoiceSettings.builder() .setIssuer( SubscriptionCreateParams.InvoiceSettings.Issuer.builder() .setType(SubscriptionCreateParams.InvoiceSettings.Issuer.Type.SELF) .build() ) .build() ) .setOnBehalfOf("<>") .build(); Subscription subscription = Subscription.create(params); ``` ```node const stripe = require('stripe')('<>'); const subscription = await stripe.subscriptions.create({ items: [ { price: '<>', quantity: 1, }, ], customer: '<>', automatic_tax: { enabled: true, liability: { type: 'self', }, }, invoice_settings: { issuer: { type: 'self', }, }, on_behalf_of: '<>', }); ``` ```python import stripe stripe.api_key = "<>" subscription = stripe.Subscription.create( items=[{"price": "<>", "quantity": 1}], customer="<>", automatic_tax={"enabled": True, "liability": {"type": "self"}}, invoice_settings={"issuer": {"type": "self"}}, on_behalf_of="<>", ) ``` ```php $stripe = new \Stripe\StripeClient('<>'); $subscription = $stripe->subscriptions->create([ 'items' => [ [ 'price' => '<>', 'quantity' => 1, ], ], 'customer' => '<>', 'automatic_tax' => [ 'enabled' => true, 'liability' => ['type' => 'self'], ], 'invoice_settings' => ['issuer' => ['type' => 'self']], 'on_behalf_of' => '<>', ]); ``` ```ruby Stripe.api_key = '<>' subscription = Stripe::Subscription.create({ items: [ { price: '<>', quantity: 1, }, ], customer: '<>', automatic_tax: { enabled: true, liability: {type: 'self'}, }, invoice_settings: {issuer: {type: 'self'}}, on_behalf_of: '<>', }) ``` For the Transfers API calls: * Include [source_transaction](https://docs.stripe.com/api/transfers/create.md#create_transfer-source_transaction) to tie the transfer to the Payment Intent created by the Subscription Invoice. * Include [destination](https://docs.stripe.com/api/transfers/create.md#create_transfer-destination) with the value of the connected account ID. ```dotnet StripeConfiguration.ApiKey = "<>"; var options = new TransferCreateOptions { Amount = 1000, Currency = "usd", SourceTransaction = "<>", Destination = "<>", }; var service = new TransferService(); Transfer transfer = service.Create(options); ``` ```go stripe.Key = "<>" params := &stripe.TransferParams{ Amount: stripe.Int64(1000), Currency: stripe.String(string(stripe.CurrencyUSD)), SourceTransaction: stripe.String("<>"), Destination: stripe.String("<>"), }; result, err := transfer.New(params); ``` ```java Stripe.apiKey = "<>"; TransferCreateParams params = TransferCreateParams.builder() .setAmount(1000L) .setCurrency("usd") .setSourceTransaction("<>") .setDestination("<>") .build(); Transfer transfer = Transfer.create(params); ``` ```node const stripe = require('stripe')('<>'); const transfer = await stripe.transfers.create({ amount: 1000, currency: 'usd', source_transaction: '<>', destination: '<>', }); ``` ```python import stripe stripe.api_key = "<>" transfer = stripe.Transfer.create( amount=1000, currency="usd", source_transaction="<>", destination="<>", ) ``` ```php $stripe = new \Stripe\StripeClient('<>'); $transfer = $stripe->transfers->create([ 'amount' => 1000, 'currency' => 'usd', 'source_transaction' => '<>', 'destination' => '<>', ]); ``` ```ruby Stripe.api_key = '<>' transfer = Stripe::Transfer.create({ amount: 1000, currency: 'usd', source_transaction: '<>', destination: '<>', }) ``` ### Invoicing Pick one of the currently supported charge types that allow your platform account to be *liable for tax* with [Stripe Invoicing](https://docs.stripe.com/tax/invoicing.md): This charge type isn’t supported for use cases involving a connected account where the platform is *liable for tax*. For the Invoices API calls: * Include [automatic_tax[liability]](https://docs.stripe.com/api/invoices/create.md#create_invoice-automatic_tax-liability) with `type=self`. * Include [transfer_data[destination]](https://docs.stripe.com/api/invoices/create.md#create_invoice-transfer_data-destination) with the value of the connected account ID. * Include [issuer](https://docs.stripe.com/api/invoices/create.md#create_invoice-issuer) with `type=self`. In some jurisdictions, like the European Union, invoice PDFs are used as the tax instrument and the invoice issuer must match the entity *liable for tax* at all times. * (Optional) If the connected account is the [settlement merchant](https://docs.stripe.com/connect/destination-charges.md#settlement-merchant), include [on_behalf_of](https://docs.stripe.com/api/invoices/create.md#create_invoice-on_behalf_of) with the value of the connected account ID. ```dotnet StripeConfiguration.ApiKey = "<>"; var options = new InvoiceCreateOptions { Customer = "<>", AutomaticTax = new InvoiceAutomaticTaxOptions { Enabled = true, Liability = new InvoiceAutomaticTaxLiabilityOptions { Type = "self" }, }, TransferData = new InvoiceTransferDataOptions { Destination = "<>" }, Issuer = new InvoiceIssuerOptions { Type = "self" }, }; var service = new InvoiceService(); Invoice invoice = service.Create(options); ``` ```go stripe.Key = "<>" params := &stripe.InvoiceParams{ Customer: stripe.String("<>"), AutomaticTax: &stripe.InvoiceAutomaticTaxParams{ Enabled: stripe.Bool(true), Liability: &stripe.InvoiceAutomaticTaxLiabilityParams{ Type: stripe.String(string(stripe.InvoiceAutomaticTaxLiabilityTypeSelf)), }, }, TransferData: &stripe.InvoiceTransferDataParams{ Destination: stripe.String("<>"), }, Issuer: &stripe.InvoiceIssuerParams{Type: stripe.String(string(stripe.InvoiceIssuerTypeSelf))}, }; result, err := invoice.New(params); ``` ```java Stripe.apiKey = "<>"; InvoiceCreateParams params = InvoiceCreateParams.builder() .setCustomer("<>") .setAutomaticTax( InvoiceCreateParams.AutomaticTax.builder() .setEnabled(true) .setLiability( InvoiceCreateParams.AutomaticTax.Liability.builder() .setType(InvoiceCreateParams.AutomaticTax.Liability.Type.SELF) .build() ) .build() ) .setTransferData( InvoiceCreateParams.TransferData.builder().setDestination("<>").build() ) .setIssuer( InvoiceCreateParams.Issuer.builder().setType(InvoiceCreateParams.Issuer.Type.SELF).build() ) .build(); Invoice invoice = Invoice.create(params); ``` ```node const stripe = require('stripe')('<>'); const invoice = await stripe.invoices.create({ customer: '<>', automatic_tax: { enabled: true, liability: { type: 'self', }, }, transfer_data: { destination: '<>', }, issuer: { type: 'self', }, }); ``` ```python import stripe stripe.api_key = "<>" invoice = stripe.Invoice.create( customer="<>", automatic_tax={"enabled": True, "liability": {"type": "self"}}, transfer_data={"destination": "<>"}, issuer={"type": "self"}, ) ``` ```php $stripe = new \Stripe\StripeClient('<>'); $invoice = $stripe->invoices->create([ 'customer' => '<>', 'automatic_tax' => [ 'enabled' => true, 'liability' => ['type' => 'self'], ], 'transfer_data' => ['destination' => '<>'], 'issuer' => ['type' => 'self'], ]); ``` ```ruby Stripe.api_key = '<>' invoice = Stripe::Invoice.create({ customer: '<>', automatic_tax: { enabled: true, liability: {type: 'self'}, }, transfer_data: {destination: '<>'}, issuer: {type: 'self'}, }) ``` For the Invoices API calls: * Include [automatic_tax[liability]](https://docs.stripe.com/api/invoices/create.md#create_invoice-automatic_tax-liability) with `type=self`. * Include [issuer](https://docs.stripe.com/api/invoices/create.md#create_invoice-issuer) with `type=self`. In some jurisdictions, like the European Union, invoice PDFs are used as the tax instrument and the invoice issuer must match the entity *liable for tax* at all times. * (Optional) If the connected account is the [settlement merchant](https://docs.stripe.com/connect/separate-charges-and-transfers.md#settlement-merchant), include [on_behalf_of](https://docs.stripe.com/api/invoices/create.md#create_invoice-on_behalf_of) with the value of the connected account ID. ```dotnet StripeConfiguration.ApiKey = "<>"; var options = new InvoiceCreateOptions { Customer = "<>", AutomaticTax = new InvoiceAutomaticTaxOptions { Enabled = true, Liability = new InvoiceAutomaticTaxLiabilityOptions { Type = "self" }, }, Issuer = new InvoiceIssuerOptions { Type = "self" }, }; var service = new InvoiceService(); Invoice invoice = service.Create(options); ``` ```go stripe.Key = "<>" params := &stripe.InvoiceParams{ Customer: stripe.String("<>"), AutomaticTax: &stripe.InvoiceAutomaticTaxParams{ Enabled: stripe.Bool(true), Liability: &stripe.InvoiceAutomaticTaxLiabilityParams{ Type: stripe.String(string(stripe.InvoiceAutomaticTaxLiabilityTypeSelf)), }, }, Issuer: &stripe.InvoiceIssuerParams{Type: stripe.String(string(stripe.InvoiceIssuerTypeSelf))}, }; result, err := invoice.New(params); ``` ```java Stripe.apiKey = "<>"; InvoiceCreateParams params = InvoiceCreateParams.builder() .setCustomer("<>") .setAutomaticTax( InvoiceCreateParams.AutomaticTax.builder() .setEnabled(true) .setLiability( InvoiceCreateParams.AutomaticTax.Liability.builder() .setType(InvoiceCreateParams.AutomaticTax.Liability.Type.SELF) .build() ) .build() ) .setIssuer( InvoiceCreateParams.Issuer.builder().setType(InvoiceCreateParams.Issuer.Type.SELF).build() ) .build(); Invoice invoice = Invoice.create(params); ``` ```node const stripe = require('stripe')('<>'); const invoice = await stripe.invoices.create({ customer: '<>', automatic_tax: { enabled: true, liability: { type: 'self', }, }, issuer: { type: 'self', }, }); ``` ```python import stripe stripe.api_key = "<>" invoice = stripe.Invoice.create( customer="<>", automatic_tax={"enabled": True, "liability": {"type": "self"}}, issuer={"type": "self"}, ) ``` ```php $stripe = new \Stripe\StripeClient('<>'); $invoice = $stripe->invoices->create([ 'customer' => '<>', 'automatic_tax' => [ 'enabled' => true, 'liability' => ['type' => 'self'], ], 'issuer' => ['type' => 'self'], ]); ``` ```ruby Stripe.api_key = '<>' invoice = Stripe::Invoice.create({ customer: '<>', automatic_tax: { enabled: true, liability: {type: 'self'}, }, issuer: {type: 'self'}, }) ``` For the Transfers API calls: * Include [source_transaction](https://docs.stripe.com/api/transfers/create.md#create_transfer-source_transaction) to tie the transfer to the Payment Intent created by the Invoice. * Include [destination](https://docs.stripe.com/api/transfers/create.md#create_transfer-destination) with the value of the connected account ID. ```dotnet StripeConfiguration.ApiKey = "<>"; var options = new TransferCreateOptions { Amount = 1000, Currency = "usd", SourceTransaction = "<>", Destination = "<>", }; var service = new TransferService(); Transfer transfer = service.Create(options); ``` ```go stripe.Key = "<>" params := &stripe.TransferParams{ Amount: stripe.Int64(1000), Currency: stripe.String(string(stripe.CurrencyUSD)), SourceTransaction: stripe.String("<>"), Destination: stripe.String("<>"), }; result, err := transfer.New(params); ``` ```java Stripe.apiKey = "<>"; TransferCreateParams params = TransferCreateParams.builder() .setAmount(1000L) .setCurrency("usd") .setSourceTransaction("<>") .setDestination("<>") .build(); Transfer transfer = Transfer.create(params); ``` ```node const stripe = require('stripe')('<>'); const transfer = await stripe.transfers.create({ amount: 1000, currency: 'usd', source_transaction: '<>', destination: '<>', }); ``` ```python import stripe stripe.api_key = "<>" transfer = stripe.Transfer.create( amount=1000, currency="usd", source_transaction="<>", destination="<>", ) ``` ```php $stripe = new \Stripe\StripeClient('<>'); $transfer = $stripe->transfers->create([ 'amount' => 1000, 'currency' => 'usd', 'source_transaction' => '<>', 'destination' => '<>', ]); ``` ```ruby Stripe.api_key = '<>' transfer = Stripe::Transfer.create({ amount: 1000, currency: 'usd', source_transaction: '<>', destination: '<>', }) ``` ### Custom flows using the Stripe Tax API ### Payment Intents Pick one of the currently supported charge types that allow your platform account to be *liable for tax* with [Stripe Tax API](https://docs.stripe.com/tax/custom.md): We don’t recommend this charge type because the connected account controls refunds. The connected account needs to be aware of the tax withholding strategy to refund the correct amount to you and their users. For the Tax Calculation API calls: ```dotnet StripeConfiguration.ApiKey = "<>"; var options = new Stripe.Tax.CalculationCreateOptions { Currency = "usd", LineItems = new List { new Stripe.Tax.CalculationLineItemOptions { Amount = 1000, Reference = "L1" }, }, Customer = "<>", }; var service = new Stripe.Tax.CalculationService(); Stripe.Tax.Calculation calculation = service.Create(options); ``` ```go stripe.Key = "<>" params := &stripe.TaxCalculationParams{ Currency: stripe.String(string(stripe.CurrencyUSD)), LineItems: []*stripe.TaxCalculationLineItemParams{ &stripe.TaxCalculationLineItemParams{ Amount: stripe.Int64(1000), Reference: stripe.String("L1"), }, }, Customer: stripe.String("<>"), }; result, err := calculation.New(params); ``` ```java Stripe.apiKey = "<>"; CalculationCreateParams params = CalculationCreateParams.builder() .setCurrency("usd") .addLineItem( CalculationCreateParams.LineItem.builder().setAmount(1000L).setReference("L1").build() ) .setCustomer("<>") .build(); Calculation calculation = Calculation.create(params); ``` ```node const stripe = require('stripe')('<>'); const calculation = await stripe.tax.calculations.create({ currency: 'usd', line_items: [ { amount: 1000, reference: 'L1', }, ], customer: '<>', }); ``` ```python import stripe stripe.api_key = "<>" calculation = stripe.tax.Calculation.create( currency="usd", line_items=[{"amount": 1000, "reference": "L1"}], customer="<>", ) ``` ```php $stripe = new \Stripe\StripeClient('<>'); $calculation = $stripe->tax->calculations->create([ 'currency' => 'usd', 'line_items' => [ [ 'amount' => 1000, 'reference' => 'L1', ], ], 'customer' => '<>', ]); ``` ```ruby Stripe.api_key = '<>' calculation = Stripe::Tax::Calculation.create({ currency: 'usd', line_items: [ { amount: 1000, reference: 'L1', }, ], customer: '<>', }) ``` For the Payment Intents API calls: * Include [amount](https://docs.stripe.com/api/payment_intents/create.md#create_payment_intent-amount) with the `amount_total` returned by the tax calculation. * Include [metadata[tax_calculation]](https://docs.stripe.com/api/payment_intents/create.md#create_payment_intent-metadata) with the `id` returned by the tax calculation. * Include [transfer_data[destination]](https://docs.stripe.com/api/payment_intents/create.md#create_payment_intent-transfer_data-destination) with the value of the connected account ID. * (Optional) If the connected account is the [settlement merchant](https://docs.stripe.com/connect/destination-charges.md#settlement-merchant), include [on_behalf_of](https://docs.stripe.com/api/payment_intents/create.md#create_payment_intent-on_behalf_of) with the value of the connected account ID. ```dotnet StripeConfiguration.ApiKey = "<>"; var options = new PaymentIntentCreateOptions { Amount = 1000, Currency = "usd", Customer = "<>", Metadata = new Dictionary { { "tax_calculation", "<>" } }, TransferData = new PaymentIntentTransferDataOptions { Destination = "<>" }, }; var service = new PaymentIntentService(); PaymentIntent paymentIntent = service.Create(options); ``` ```go stripe.Key = "<>" params := &stripe.PaymentIntentParams{ Amount: stripe.Int64(1000), Currency: stripe.String(string(stripe.CurrencyUSD)), Customer: stripe.String("<>"), TransferData: &stripe.PaymentIntentTransferDataParams{ Destination: stripe.String("<>"), }, }; params.AddMetadata("tax_calculation", "<>") result, err := paymentintent.New(params); ``` ```java Stripe.apiKey = "<>"; PaymentIntentCreateParams params = PaymentIntentCreateParams.builder() .setAmount(1000L) .setCurrency("usd") .setCustomer("<>") .putMetadata("tax_calculation", "<>") .setTransferData( PaymentIntentCreateParams.TransferData.builder() .setDestination("<>") .build() ) .build(); PaymentIntent paymentIntent = PaymentIntent.create(params); ``` ```node const stripe = require('stripe')('<>'); const paymentIntent = await stripe.paymentIntents.create({ amount: 1000, currency: 'usd', customer: '<>', metadata: { tax_calculation: '<>', }, transfer_data: { destination: '<>', }, }); ``` ```python import stripe stripe.api_key = "<>" payment_intent = stripe.PaymentIntent.create( amount=1000, currency="usd", customer="<>", metadata={"tax_calculation": "<>"}, transfer_data={"destination": "<>"}, ) ``` ```php $stripe = new \Stripe\StripeClient('<>'); $paymentIntent = $stripe->paymentIntents->create([ 'amount' => 1000, 'currency' => 'usd', 'customer' => '<>', 'metadata' => ['tax_calculation' => '<>'], 'transfer_data' => ['destination' => '<>'], ]); ``` ```ruby Stripe.api_key = '<>' payment_intent = Stripe::PaymentIntent.create({ amount: 1000, currency: 'usd', customer: '<>', metadata: {tax_calculation: '<>'}, transfer_data: {destination: '<>'}, }) ``` You must also [create tax transactions](https://docs.stripe.com/tax/custom.md#tax-transaction) to record the tax you collect from customers and [account for refunds](https://docs.stripe.com/tax/custom.md#reversals). For the Tax Calculation API calls: ```dotnet StripeConfiguration.ApiKey = "<>"; var options = new Stripe.Tax.CalculationCreateOptions { Currency = "usd", LineItems = new List { new Stripe.Tax.CalculationLineItemOptions { Amount = 1000, Reference = "L1" }, }, Customer = "<>", }; var service = new Stripe.Tax.CalculationService(); Stripe.Tax.Calculation calculation = service.Create(options); ``` ```go stripe.Key = "<>" params := &stripe.TaxCalculationParams{ Currency: stripe.String(string(stripe.CurrencyUSD)), LineItems: []*stripe.TaxCalculationLineItemParams{ &stripe.TaxCalculationLineItemParams{ Amount: stripe.Int64(1000), Reference: stripe.String("L1"), }, }, Customer: stripe.String("<>"), }; result, err := calculation.New(params); ``` ```java Stripe.apiKey = "<>"; CalculationCreateParams params = CalculationCreateParams.builder() .setCurrency("usd") .addLineItem( CalculationCreateParams.LineItem.builder().setAmount(1000L).setReference("L1").build() ) .setCustomer("<>") .build(); Calculation calculation = Calculation.create(params); ``` ```node const stripe = require('stripe')('<>'); const calculation = await stripe.tax.calculations.create({ currency: 'usd', line_items: [ { amount: 1000, reference: 'L1', }, ], customer: '<>', }); ``` ```python import stripe stripe.api_key = "<>" calculation = stripe.tax.Calculation.create( currency="usd", line_items=[{"amount": 1000, "reference": "L1"}], customer="<>", ) ``` ```php $stripe = new \Stripe\StripeClient('<>'); $calculation = $stripe->tax->calculations->create([ 'currency' => 'usd', 'line_items' => [ [ 'amount' => 1000, 'reference' => 'L1', ], ], 'customer' => '<>', ]); ``` ```ruby Stripe.api_key = '<>' calculation = Stripe::Tax::Calculation.create({ currency: 'usd', line_items: [ { amount: 1000, reference: 'L1', }, ], customer: '<>', }) ``` For the Payment Intents API calls: * Include [amount](https://docs.stripe.com/api/payment_intents/create.md#create_payment_intent-amount) with the `amount_total` returned by the tax calculation. * Include [metadata[tax_calculation]](https://docs.stripe.com/api/payment_intents/create.md#create_payment_intent-metadata) with the `id` returned by the tax calculation. * (Optional) If the connected account is the [settlement merchant](https://docs.stripe.com/connect/separate-charges-and-transfers.md#settlement-merchant), include [on_behalf_of](https://docs.stripe.com/api/payment_intents/create.md#create_payment_intent-on_behalf_of) with the value of the connected account ID. ```dotnet StripeConfiguration.ApiKey = "<>"; var options = new PaymentIntentCreateOptions { Amount = 1000, Currency = "usd", Customer = "<>", Metadata = new Dictionary { { "tax_calculation", "<>" } }, }; var service = new PaymentIntentService(); PaymentIntent paymentIntent = service.Create(options); ``` ```go stripe.Key = "<>" params := &stripe.PaymentIntentParams{ Amount: stripe.Int64(1000), Currency: stripe.String(string(stripe.CurrencyUSD)), Customer: stripe.String("<>"), }; params.AddMetadata("tax_calculation", "<>") result, err := paymentintent.New(params); ``` ```java Stripe.apiKey = "<>"; PaymentIntentCreateParams params = PaymentIntentCreateParams.builder() .setAmount(1000L) .setCurrency("usd") .setCustomer("<>") .putMetadata("tax_calculation", "<>") .build(); PaymentIntent paymentIntent = PaymentIntent.create(params); ``` ```node const stripe = require('stripe')('<>'); const paymentIntent = await stripe.paymentIntents.create({ amount: 1000, currency: 'usd', customer: '<>', metadata: { tax_calculation: '<>', }, }); ``` ```python import stripe stripe.api_key = "<>" payment_intent = stripe.PaymentIntent.create( amount=1000, currency="usd", customer="<>", metadata={"tax_calculation": "<>"}, ) ``` ```php $stripe = new \Stripe\StripeClient('<>'); $paymentIntent = $stripe->paymentIntents->create([ 'amount' => 1000, 'currency' => 'usd', 'customer' => '<>', 'metadata' => ['tax_calculation' => '<>'], ]); ``` ```ruby Stripe.api_key = '<>' payment_intent = Stripe::PaymentIntent.create({ amount: 1000, currency: 'usd', customer: '<>', metadata: {tax_calculation: '<>'}, }) ``` For the Transfers API calls: * Include [source_transaction](https://docs.stripe.com/api/transfers/create.md#create_transfer-source_transaction) to tie the transfer to the Payment Intent. * Include [destination](https://docs.stripe.com/api/transfers/create.md#create_transfer-destination) with the value of the connected account ID. ```dotnet StripeConfiguration.ApiKey = "<>"; var options = new TransferCreateOptions { Amount = 1000, Currency = "usd", SourceTransaction = "<>", Destination = "<>", }; var service = new TransferService(); Transfer transfer = service.Create(options); ``` ```go stripe.Key = "<>" params := &stripe.TransferParams{ Amount: stripe.Int64(1000), Currency: stripe.String(string(stripe.CurrencyUSD)), SourceTransaction: stripe.String("<>"), Destination: stripe.String("<>"), }; result, err := transfer.New(params); ``` ```java Stripe.apiKey = "<>"; TransferCreateParams params = TransferCreateParams.builder() .setAmount(1000L) .setCurrency("usd") .setSourceTransaction("<>") .setDestination("<>") .build(); Transfer transfer = Transfer.create(params); ``` ```node const stripe = require('stripe')('<>'); const transfer = await stripe.transfers.create({ amount: 1000, currency: 'usd', source_transaction: '<>', destination: '<>', }); ``` ```python import stripe stripe.api_key = "<>" transfer = stripe.Transfer.create( amount=1000, currency="usd", source_transaction="<>", destination="<>", ) ``` ```php $stripe = new \Stripe\StripeClient('<>'); $transfer = $stripe->transfers->create([ 'amount' => 1000, 'currency' => 'usd', 'source_transaction' => '<>', 'destination' => '<>', ]); ``` ```ruby Stripe.api_key = '<>' transfer = Stripe::Transfer.create({ amount: 1000, currency: 'usd', source_transaction: '<>', destination: '<>', }) ``` You must also [create tax transactions](https://docs.stripe.com/tax/custom.md#tax-transaction) to record the tax you collect from customers and [account for refunds](https://docs.stripe.com/tax/custom.md#reversals). ### Off-Stripe payments Check how to integrate using [Stripe Tax API](https://docs.stripe.com/tax/custom.md) and to allow your platform account to be *liable for tax*. In the Tax Calculation API calls: ```dotnet StripeConfiguration.ApiKey = "<>"; var options = new Stripe.Tax.CalculationCreateOptions { Currency = "usd", LineItems = new List { new Stripe.Tax.CalculationLineItemOptions { Amount = 1000, Reference = "L1" }, }, Customer = "<>", }; var service = new Stripe.Tax.CalculationService(); Stripe.Tax.Calculation calculation = service.Create(options); ``` ```go stripe.Key = "<>" params := &stripe.TaxCalculationParams{ Currency: stripe.String(string(stripe.CurrencyUSD)), LineItems: []*stripe.TaxCalculationLineItemParams{ &stripe.TaxCalculationLineItemParams{ Amount: stripe.Int64(1000), Reference: stripe.String("L1"), }, }, Customer: stripe.String("<>"), }; result, err := calculation.New(params); ``` ```java Stripe.apiKey = "<>"; CalculationCreateParams params = CalculationCreateParams.builder() .setCurrency("usd") .addLineItem( CalculationCreateParams.LineItem.builder().setAmount(1000L).setReference("L1").build() ) .setCustomer("<>") .build(); Calculation calculation = Calculation.create(params); ``` ```node const stripe = require('stripe')('<>'); const calculation = await stripe.tax.calculations.create({ currency: 'usd', line_items: [ { amount: 1000, reference: 'L1', }, ], customer: '<>', }); ``` ```python import stripe stripe.api_key = "<>" calculation = stripe.tax.Calculation.create( currency="usd", line_items=[{"amount": 1000, "reference": "L1"}], customer="<>", ) ``` ```php $stripe = new \Stripe\StripeClient('<>'); $calculation = $stripe->tax->calculations->create([ 'currency' => 'usd', 'line_items' => [ [ 'amount' => 1000, 'reference' => 'L1', ], ], 'customer' => '<>', ]); ``` ```ruby Stripe.api_key = '<>' calculation = Stripe::Tax::Calculation.create({ currency: 'usd', line_items: [ { amount: 1000, reference: 'L1', }, ], customer: '<>', }) ``` You must also [create tax transactions](https://docs.stripe.com/tax/custom.md#tax-transaction) to record the tax you collect from customers and [account for refunds](https://docs.stripe.com/tax/custom.md#reversals). After you implement it, Stripe automatically starts collecting tax in jurisdictions where you have an active registration. Independent of the payment APIs, we credit the transaction amount to the connected account. You need to withhold the collected tax amount on the platform because the platform is *liable for tax*. ## Withhold collected tax amount You must make sure that the tax collected is transferred to your marketplace account, so that you can then remit the tax to relevant jurisdictions. ### Checkout and Payment Links This charge type isn’t supported for use cases involving a connected account where the platform is *liable for tax*. To withhold the collected tax amount for a Checkout Session or Payment Link integration use a [transfer reversal](https://docs.stripe.com/api/transfer_reversals.md). For the Transfer Reversal API call, include an [amount](https://docs.stripe.com/api/transfers/create.md#create_transfer-amount) with the value to be reversed from the connected account to your platform equivalent to the [total tax amount](https://docs.stripe.com/api/checkout/sessions/object.md#checkout_session_object-total_details-amount_tax) present in the Checkout Session object. Obtain the [transfer ID](https://docs.stripe.com/api/charges/object.md#charge_object-transfer) from the Charge object. If you don’t know the charge ID, you can retrieve the Checkout Session and [expand](https://docs.stripe.com/expand.md#multiple-properties) the [Payment Intent](https://docs.stripe.com/api/checkout/sessions/object.md#checkout_session_object-payment_intent) object and use the [latest charge](https://docs.stripe.com/api/payment_intents/object.md#payment_intent_object-latest_charge) field. ```dotnet StripeConfiguration.ApiKey = "<>"; var options = new TransferReversalCreateOptions { Amount = 1000 }; var service = new TransferReversalService(); TransferReversal transferReversal = service.Create("<>", options); ``` ```go stripe.Key = "<>" params := &stripe.TransferReversalParams{ Amount: stripe.Int64(1000), ID: stripe.String("<>"), }; result, err := transferreversal.New(params); ``` ```java Stripe.apiKey = "<>"; Transfer transfer = Transfer.retrieve("<>"); TransferReversalCollectionCreateParams params = TransferReversalCollectionCreateParams.builder().setAmount(1000L).build(); TransferReversal transferReversal = transfer.getReversals().create(params); ``` ```node const stripe = require('stripe')('<>'); const transferReversal = await stripe.transfers.createReversal( '<>', { amount: 1000, } ); ``` ```python import stripe stripe.api_key = "<>" reversal = stripe.Transfer.create_reversal( "<>", amount=1000, ) ``` ```php $stripe = new \Stripe\StripeClient('<>'); $transferReversal = $stripe->transfers->createReversal('<>', ['amount' => 1000]); ``` ```ruby Stripe.api_key = '<>' reversal = Stripe::Transfer.create_reversal('<>', {amount: 1000}) ``` To automatically create a Transfer Reversal when the Checkout Session is completed, create a *webhook* to be notified for [checkout.session.completed](https://docs.stripe.com/api/events/types.md#event_types-checkout.session.completed) events. This option is best suited for transactions that don’t require currency exchange. See [Reverse transfers](https://docs.stripe.com/connect/separate-charges-and-transfers.md#reverse-transfers) for more information. For the Transfer API call, include an [amount](https://docs.stripe.com/api/transfers/create.md#create_transfer-amount) with the value to be transferred to the connected account excluding the [total tax amount](https://docs.stripe.com/api/checkout/sessions/object.md#checkout_session_object-total_details-amount_tax) present in the Checkout Session object. The Checkout Session must be complete. To obtain the charge ID, you can retrieve the Checkout Session and [expand](https://docs.stripe.com/expand.md#multiple-properties) the [Payment Intent](https://docs.stripe.com/api/checkout/sessions/object.md#checkout_session_object-payment_intent) object and use the [latest charge](https://docs.stripe.com/api/payment_intents/object.md#payment_intent_object-latest_charge) field. ```dotnet StripeConfiguration.ApiKey = "<>"; var options = new TransferCreateOptions { Amount = 1000, Currency = "usd", SourceTransaction = "<>", Destination = "<>", }; var service = new TransferService(); Transfer transfer = service.Create(options); ``` ```go stripe.Key = "<>" params := &stripe.TransferParams{ Amount: stripe.Int64(1000), Currency: stripe.String(string(stripe.CurrencyUSD)), SourceTransaction: stripe.String("<>"), Destination: stripe.String("<>"), }; result, err := transfer.New(params); ``` ```java Stripe.apiKey = "<>"; TransferCreateParams params = TransferCreateParams.builder() .setAmount(1000L) .setCurrency("usd") .setSourceTransaction("<>") .setDestination("<>") .build(); Transfer transfer = Transfer.create(params); ``` ```node const stripe = require('stripe')('<>'); const transfer = await stripe.transfers.create({ amount: 1000, currency: 'usd', source_transaction: '<>', destination: '<>', }); ``` ```python import stripe stripe.api_key = "<>" transfer = stripe.Transfer.create( amount=1000, currency="usd", source_transaction="<>", destination="<>", ) ``` ```php $stripe = new \Stripe\StripeClient('<>'); $transfer = $stripe->transfers->create([ 'amount' => 1000, 'currency' => 'usd', 'source_transaction' => '<>', 'destination' => '<>', ]); ``` ```ruby Stripe.api_key = '<>' transfer = Stripe::Transfer.create({ amount: 1000, currency: 'usd', source_transaction: '<>', destination: '<>', }) ``` Learn more about [separate charges and transfers for Checkout Sessions](https://docs.stripe.com/connect/separate-charges-and-transfers.md?platform=web&ui=stripe-hosted). ### Invoicing This charge type isn’t supported for use cases involving a connected account where the platform is *liable for tax*. 1. **Option 1:** Use `transfer_data[amount]` To withhold the collected tax amount on destination charges, you can update the Invoice and exclude the tax amount from the `transfer_data[amount]` value. For the Invoice Update API call, include [transfer_data[amount]](https://docs.stripe.com/api/invoices/update.md#update_invoice-transfer_data-amount) with the value to be transferred to the connected account excluding the [total tax amount](https://docs.stripe.com/api/invoices/object.md#invoice_object-total_tax_amounts-amount) present in the Invoice object. You must make the update before the Invoice is finalized. ```dotnet StripeConfiguration.ApiKey = "<>"; var options = new InvoiceUpdateOptions { TransferData = new InvoiceTransferDataOptions { Destination = "<>", Amount = 1000, }, }; var service = new InvoiceService(); Invoice invoice = service.Update("<>", options); ``` ```go stripe.Key = "<>" params := &stripe.InvoiceParams{ TransferData: &stripe.InvoiceTransferDataParams{ Destination: stripe.String("<>"), Amount: stripe.Int64(1000), }, }; result, err := invoice.Update("<>", params); ``` ```java Stripe.apiKey = "<>"; Invoice resource = Invoice.retrieve("<>"); InvoiceUpdateParams params = InvoiceUpdateParams.builder() .setTransferData( InvoiceUpdateParams.TransferData.builder() .setDestination("<>") .setAmount(1000L) .build() ) .build(); Invoice invoice = resource.update(params); ``` ```node const stripe = require('stripe')('<>'); const invoice = await stripe.invoices.update( '<>', { transfer_data: { destination: '<>', amount: 1000, }, } ); ``` ```python import stripe stripe.api_key = "<>" invoice = stripe.Invoice.modify( "<>", transfer_data={"destination": "<>", "amount": 1000}, ) ``` ```php $stripe = new \Stripe\StripeClient('<>'); $invoice = $stripe->invoices->update( '<>', [ 'transfer_data' => [ 'destination' => '<>', 'amount' => 1000, ], ] ); ``` ```ruby Stripe.api_key = '<>' invoice = Stripe::Invoice.update( '<>', { transfer_data: { destination: '<>', amount: 1000, }, }, ) ``` 2. **Option 2:** Use `application_fee_amount` Another option to withhold the collected tax amount is to update the Invoice and include the tax amount in the `application_fee_amount` value. For the Invoice Update API call, include the [application_fee_amount](https://docs.stripe.com/api/invoices/update.md#update_invoice-application_fee_amount) with the value to be held by your platform including the [total tax amount](https://docs.stripe.com/api/invoices/object.md#invoice_object-total_tax_amounts-amount) present in the Invoice object. The update must be made before the Invoice is finalized. ```dotnet StripeConfiguration.ApiKey = "<>"; var options = new InvoiceUpdateOptions { ApplicationFeeAmount = 1000 }; var service = new InvoiceService(); Invoice invoice = service.Update("<>", options); ``` ```go stripe.Key = "<>" params := &stripe.InvoiceParams{ApplicationFeeAmount: stripe.Int64(1000)}; result, err := invoice.Update("<>", params); ``` ```java Stripe.apiKey = "<>"; Invoice resource = Invoice.retrieve("<>"); InvoiceUpdateParams params = InvoiceUpdateParams.builder().setApplicationFeeAmount(1000L).build(); Invoice invoice = resource.update(params); ``` ```node const stripe = require('stripe')('<>'); const invoice = await stripe.invoices.update( '<>', { application_fee_amount: 1000, } ); ``` ```python import stripe stripe.api_key = "<>" invoice = stripe.Invoice.modify( "<>", application_fee_amount=1000, ) ``` ```php $stripe = new \Stripe\StripeClient('<>'); $invoice = $stripe->invoices->update('<>', ['application_fee_amount' => 1000]); ``` ```ruby Stripe.api_key = '<>' invoice = Stripe::Invoice.update('<>', {application_fee_amount: 1000}) ``` 3. **Option 3:** Create a [transfer reversal](https://docs.stripe.com/api/transfer_reversals.md) For the Transfer Reversal API call, include the [amount](https://docs.stripe.com/api/transfers/create.md#create_transfer-amount) with the value to be reversed from the connected account to your platform equivalent to the [total tax amount](https://docs.stripe.com/api/invoices/object.md#invoice_object-total_tax_amounts-amount) present in the Invoice object. The Invoice must be paid. Obtain the [transfer ID](https://docs.stripe.com/api/charges/object.md#charge_object-transfer) from the [expanded](https://docs.stripe.com/expand.md#multiple-properties) [Charge](https://docs.stripe.com/api/invoices/object.md#invoice_object-charge) object present in the Invoice. ```dotnet StripeConfiguration.ApiKey = "<>"; var options = new TransferReversalCreateOptions { Amount = 1000 }; var service = new TransferReversalService(); TransferReversal transferReversal = service.Create("<>", options); ``` ```go stripe.Key = "<>" params := &stripe.TransferReversalParams{ Amount: stripe.Int64(1000), ID: stripe.String("<>"), }; result, err := transferreversal.New(params); ``` ```java Stripe.apiKey = "<>"; Transfer transfer = Transfer.retrieve("<>"); TransferReversalCollectionCreateParams params = TransferReversalCollectionCreateParams.builder().setAmount(1000L).build(); TransferReversal transferReversal = transfer.getReversals().create(params); ``` ```node const stripe = require('stripe')('<>'); const transferReversal = await stripe.transfers.createReversal( '<>', { amount: 1000, } ); ``` ```python import stripe stripe.api_key = "<>" reversal = stripe.Transfer.create_reversal( "<>", amount=1000, ) ``` ```php $stripe = new \Stripe\StripeClient('<>'); $transferReversal = $stripe->transfers->createReversal('<>', ['amount' => 1000]); ``` ```ruby Stripe.api_key = '<>' reversal = Stripe::Transfer.create_reversal('<>', {amount: 1000}) ``` To automatically create a Transfer Reversal when the Invoice is paid, create a *webhook* to be notified for [invoice.payment_succeeded](https://docs.stripe.com/api/events/types.md#event_types-invoice.payment_succeeded) events. This option is best suited for transactions that don’t require currency exchange. See [Reverse transfers](https://docs.stripe.com/connect/separate-charges-and-transfers.md#reverse-transfers) for more information. For the Transfer API call, include the [amount](https://docs.stripe.com/api/transfers/create.md#create_transfer-amount) with the value to be transferred to the connected account excluding the [total tax amount](https://docs.stripe.com/api/invoices/object.md#invoice_object-total_tax_amounts-amount) present in the Invoice object. The Invoice must be paid. You can obtain the [charge ID](https://docs.stripe.com/api/invoices/object.md#invoice_object-charge) from the Invoice object. ```dotnet StripeConfiguration.ApiKey = "<>"; var options = new TransferCreateOptions { Amount = 1000, Currency = "usd", SourceTransaction = "<>", Destination = "<>", }; var service = new TransferService(); Transfer transfer = service.Create(options); ``` ```go stripe.Key = "<>" params := &stripe.TransferParams{ Amount: stripe.Int64(1000), Currency: stripe.String(string(stripe.CurrencyUSD)), SourceTransaction: stripe.String("<>"), Destination: stripe.String("<>"), }; result, err := transfer.New(params); ``` ```java Stripe.apiKey = "<>"; TransferCreateParams params = TransferCreateParams.builder() .setAmount(1000L) .setCurrency("usd") .setSourceTransaction("<>") .setDestination("<>") .build(); Transfer transfer = Transfer.create(params); ``` ```node const stripe = require('stripe')('<>'); const transfer = await stripe.transfers.create({ amount: 1000, currency: 'usd', source_transaction: '<>', destination: '<>', }); ``` ```python import stripe stripe.api_key = "<>" transfer = stripe.Transfer.create( amount=1000, currency="usd", source_transaction="<>", destination="<>", ) ``` ```php $stripe = new \Stripe\StripeClient('<>'); $transfer = $stripe->transfers->create([ 'amount' => 1000, 'currency' => 'usd', 'source_transaction' => '<>', 'destination' => '<>', ]); ``` ```ruby Stripe.api_key = '<>' transfer = Stripe::Transfer.create({ amount: 1000, currency: 'usd', source_transaction: '<>', destination: '<>', }) ``` Related guide: [Separate Charges and Transfers](https://docs.stripe.com/connect/separate-charges-and-transfers.md). ### Subscriptions This charge type isn’t supported for use cases involving a connected account where the platform is *liable for tax*. 1. **Option 1:** Use `transfer_data[amount_percent]` For the Subscription Create API call, include [transfer_data[amount_percent]](https://docs.stripe.com/api/subscriptions/create.md#create_subscription-transfer_data-amount_percent) with the percentage of the subscription invoice total that will be transferred to the destination account, excluding the tax amount. Before you create the Subscription, you can use the [create preview invoice](https://docs.stripe.com/api/invoices/create_preview.md) endpoint to fetch the [total tax amount](https://docs.stripe.com/api/invoices/object.md#invoice_object-total_tax_amounts-amount) present in the Invoice object. ```dotnet StripeConfiguration.ApiKey = "<>"; var options = new SubscriptionCreateOptions { Customer = "<>", TransferData = new SubscriptionTransferDataOptions { Destination = "<>", AmountPercent = 65M, }, }; var service = new SubscriptionService(); Subscription subscription = service.Create(options); ``` ```go stripe.Key = "<>" params := &stripe.SubscriptionParams{ Customer: stripe.String("<>"), TransferData: &stripe.SubscriptionTransferDataParams{ Destination: stripe.String("<>"), AmountPercent: stripe.Float64(65), }, }; result, err := subscription.New(params); ``` ```java Stripe.apiKey = "<>"; SubscriptionCreateParams params = SubscriptionCreateParams.builder() .setCustomer("<>") .setTransferData( SubscriptionCreateParams.TransferData.builder() .setDestination("<>") .setAmountPercent(new BigDecimal(65)) .build() ) .build(); Subscription subscription = Subscription.create(params); ``` ```node const stripe = require('stripe')('<>'); const subscription = await stripe.subscriptions.create({ customer: '<>', transfer_data: { destination: '<>', amount_percent: 65, }, }); ``` ```python import stripe stripe.api_key = "<>" subscription = stripe.Subscription.create( customer="<>", transfer_data={"destination": "<>", "amount_percent": 65}, ) ``` ```php $stripe = new \Stripe\StripeClient('<>'); $subscription = $stripe->subscriptions->create([ 'customer' => '<>', 'transfer_data' => [ 'destination' => '<>', 'amount_percent' => 65, ], ]); ``` ```ruby Stripe.api_key = '<>' subscription = Stripe::Subscription.create({ customer: '<>', transfer_data: { destination: '<>', amount_percent: 65, }, }) ``` For the subsequent billing cycles, you can create a [webhook](https://docs.stripe.com/billing/subscriptions/webhooks.md#understand) that listens to the [invoice.created](https://docs.stripe.com/api/events/types.md#event_types-invoice.created) event and you can also update the Invoice, including a [transfer_data[amount]](https://docs.stripe.com/api/invoices/update.md#update_invoice-transfer_data-amount) with the flat amount that will be transferred to the destination account excluding the total tax amount. You must make the update before the Invoice is finalized. Learn more about how [draft invoices finalize](https://docs.stripe.com/invoicing/integration/workflow-transitions.md#finalized). ```dotnet StripeConfiguration.ApiKey = "<>"; var options = new InvoiceUpdateOptions { TransferData = new InvoiceTransferDataOptions { Destination = "<>", Amount = 1000, }, }; var service = new InvoiceService(); Invoice invoice = service.Update("<>", options); ``` ```go stripe.Key = "<>" params := &stripe.InvoiceParams{ TransferData: &stripe.InvoiceTransferDataParams{ Destination: stripe.String("<>"), Amount: stripe.Int64(1000), }, }; result, err := invoice.Update("<>", params); ``` ```java Stripe.apiKey = "<>"; Invoice resource = Invoice.retrieve("<>"); InvoiceUpdateParams params = InvoiceUpdateParams.builder() .setTransferData( InvoiceUpdateParams.TransferData.builder() .setDestination("<>") .setAmount(1000L) .build() ) .build(); Invoice invoice = resource.update(params); ``` ```node const stripe = require('stripe')('<>'); const invoice = await stripe.invoices.update( '<>', { transfer_data: { destination: '<>', amount: 1000, }, } ); ``` ```python import stripe stripe.api_key = "<>" invoice = stripe.Invoice.modify( "<>", transfer_data={"destination": "<>", "amount": 1000}, ) ``` ```php $stripe = new \Stripe\StripeClient('<>'); $invoice = $stripe->invoices->update( '<>', [ 'transfer_data' => [ 'destination' => '<>', 'amount' => 1000, ], ] ); ``` ```ruby Stripe.api_key = '<>' invoice = Stripe::Invoice.update( '<>', { transfer_data: { destination: '<>', amount: 1000, }, }, ) ``` 2. **Option 2:** Use `application_fee_percent` For the Subscription Create API call, include the [application_fee_percent](https://docs.stripe.com/api/subscriptions/create.md#create_subscription-application_fee_percent) with the percentage of the subscription invoice total that will be held by your platform, including the tax amount. Before you create the Subscription, you can use the [create preview invoice](https://docs.stripe.com/api/invoices/create_preview.md) endpoint to fetch the [total tax amount](https://docs.stripe.com/api/invoices/object.md#invoice_object-total_tax_amounts-amount) present in the Invoice object. ```dotnet StripeConfiguration.ApiKey = "<>"; var options = new SubscriptionCreateOptions { Customer = "<>", ApplicationFeePercent = 35M, }; var service = new SubscriptionService(); Subscription subscription = service.Create(options); ``` ```go stripe.Key = "<>" params := &stripe.SubscriptionParams{ Customer: stripe.String("<>"), ApplicationFeePercent: stripe.Float64(35), }; result, err := subscription.New(params); ``` ```java Stripe.apiKey = "<>"; SubscriptionCreateParams params = SubscriptionCreateParams.builder() .setCustomer("<>") .setApplicationFeePercent(new BigDecimal(35)) .build(); Subscription subscription = Subscription.create(params); ``` ```node const stripe = require('stripe')('<>'); const subscription = await stripe.subscriptions.create({ customer: '<>', application_fee_percent: 35, }); ``` ```python import stripe stripe.api_key = "<>" subscription = stripe.Subscription.create( customer="<>", application_fee_percent=35, ) ``` ```php $stripe = new \Stripe\StripeClient('<>'); $subscription = $stripe->subscriptions->create([ 'customer' => '<>', 'application_fee_percent' => 35, ]); ``` ```ruby Stripe.api_key = '<>' subscription = Stripe::Subscription.create({ customer: '<>', application_fee_percent: 35, }) ``` For the subsequent billing cycles, you can create a [webhook](https://docs.stripe.com/billing/subscriptions/webhooks.md#understand) that listens to the [invoice.created](https://docs.stripe.com/api/events/types.md#event_types-invoice.created) event and you can also update the Invoice, including the [application_fee_amount](https://docs.stripe.com/api/invoices/update.md#update_invoice-application_fee_amount) with the flat amount that will be held by your platform including the total tax amount. The update must be made before the Invoice is finalized. Learn more about [Invoice’s status transitions and finalization](https://docs.stripe.com/invoicing/integration/workflow-transitions.md#finalized). ```dotnet StripeConfiguration.ApiKey = "<>"; var options = new InvoiceUpdateOptions { ApplicationFeeAmount = 1000 }; var service = new InvoiceService(); Invoice invoice = service.Update("<>", options); ``` ```go stripe.Key = "<>" params := &stripe.InvoiceParams{ApplicationFeeAmount: stripe.Int64(1000)}; result, err := invoice.Update("<>", params); ``` ```java Stripe.apiKey = "<>"; Invoice resource = Invoice.retrieve("<>"); InvoiceUpdateParams params = InvoiceUpdateParams.builder().setApplicationFeeAmount(1000L).build(); Invoice invoice = resource.update(params); ``` ```node const stripe = require('stripe')('<>'); const invoice = await stripe.invoices.update( '<>', { application_fee_amount: 1000, } ); ``` ```python import stripe stripe.api_key = "<>" invoice = stripe.Invoice.modify( "<>", application_fee_amount=1000, ) ``` ```php $stripe = new \Stripe\StripeClient('<>'); $invoice = $stripe->invoices->update('<>', ['application_fee_amount' => 1000]); ``` ```ruby Stripe.api_key = '<>' invoice = Stripe::Invoice.update('<>', {application_fee_amount: 1000}) ``` See [Percent fees and flat fees](https://docs.stripe.com/connect/subscriptions.md#percent-fees-and-flat-fees) to learn more about application fees. 3. **Option 3:** Create a [transfer reversal](https://docs.stripe.com/api/transfer_reversals.md) For the Transfer Reversal API call, include the [amount](https://docs.stripe.com/api/transfers/create.md#create_transfer-amount) with the value to be reversed from the connected account to your platform equivalent to the [total tax amount](https://docs.stripe.com/api/invoices/object.md#invoice_object-total_tax_amounts-amount) present in the Subscription [latest Invoice](https://docs.stripe.com/api/subscriptions/object.md#subscription_object-latest_invoice) object. Obtain the [transfer ID](https://docs.stripe.com/api/charges/object.md#charge_object-transfer) from the Charge object. If you don’t know the charge ID, you can retrieve the Subscription, [expand](https://docs.stripe.com/expand.md#multiple-properties) the [latest invoice](https://docs.stripe.com/api/subscriptions/object.md#subscription_object-latest_invoice) and get the [charge ID](https://docs.stripe.com/api/invoices/object.md#invoice_object-charge) from the Invoice object. ```dotnet StripeConfiguration.ApiKey = "<>"; var options = new TransferReversalCreateOptions { Amount = 1000 }; var service = new TransferReversalService(); TransferReversal transferReversal = service.Create("<>", options); ``` ```go stripe.Key = "<>" params := &stripe.TransferReversalParams{ Amount: stripe.Int64(1000), ID: stripe.String("<>"), }; result, err := transferreversal.New(params); ``` ```java Stripe.apiKey = "<>"; Transfer transfer = Transfer.retrieve("<>"); TransferReversalCollectionCreateParams params = TransferReversalCollectionCreateParams.builder().setAmount(1000L).build(); TransferReversal transferReversal = transfer.getReversals().create(params); ``` ```node const stripe = require('stripe')('<>'); const transferReversal = await stripe.transfers.createReversal( '<>', { amount: 1000, } ); ``` ```python import stripe stripe.api_key = "<>" reversal = stripe.Transfer.create_reversal( "<>", amount=1000, ) ``` ```php $stripe = new \Stripe\StripeClient('<>'); $transferReversal = $stripe->transfers->createReversal('<>', ['amount' => 1000]); ``` ```ruby Stripe.api_key = '<>' reversal = Stripe::Transfer.create_reversal('<>', {amount: 1000}) ``` To automatically create a Transfer Reversal when the Subscription Invoice is paid, create a *webhook* to be notified of [invoice.payment_succeeded](https://docs.stripe.com/api/events/types.md#event_types-invoice.payment_succeeded) events. This option is best suited for transactions that don’t require currency exchange. See [Reverse transfers](https://docs.stripe.com/connect/separate-charges-and-transfers.md#reverse-transfers) for more information. For the Transfer API call, include the [amount](https://docs.stripe.com/api/transfers/create.md#create_transfer-amount) with the value to be transferred to the connected account excluding the [total tax amount](https://docs.stripe.com/api/invoices/object.md#invoice_object-total_tax_amounts-amount) present in the Subscription [latest Invoice](https://docs.stripe.com/api/subscriptions/object.md#subscription_object-latest_invoice) object. To obtain the charge ID, you can retrieve the Subscription, [expand](https://docs.stripe.com/expand.md#multiple-properties) the [latest invoice](https://docs.stripe.com/api/subscriptions/object.md#subscription_object-latest_invoice) and get the [charge ID](https://docs.stripe.com/api/invoices/object.md#invoice_object-charge) from the Invoice object. ```dotnet StripeConfiguration.ApiKey = "<>"; var options = new TransferCreateOptions { Amount = 1000, Currency = "usd", SourceTransaction = "<>", Destination = "<>", }; var service = new TransferService(); Transfer transfer = service.Create(options); ``` ```go stripe.Key = "<>" params := &stripe.TransferParams{ Amount: stripe.Int64(1000), Currency: stripe.String(string(stripe.CurrencyUSD)), SourceTransaction: stripe.String("<>"), Destination: stripe.String("<>"), }; result, err := transfer.New(params); ``` ```java Stripe.apiKey = "<>"; TransferCreateParams params = TransferCreateParams.builder() .setAmount(1000L) .setCurrency("usd") .setSourceTransaction("<>") .setDestination("<>") .build(); Transfer transfer = Transfer.create(params); ``` ```node const stripe = require('stripe')('<>'); const transfer = await stripe.transfers.create({ amount: 1000, currency: 'usd', source_transaction: '<>', destination: '<>', }); ``` ```python import stripe stripe.api_key = "<>" transfer = stripe.Transfer.create( amount=1000, currency="usd", source_transaction="<>", destination="<>", ) ``` ```php $stripe = new \Stripe\StripeClient('<>'); $transfer = $stripe->transfers->create([ 'amount' => 1000, 'currency' => 'usd', 'source_transaction' => '<>', 'destination' => '<>', ]); ``` ```ruby Stripe.api_key = '<>' transfer = Stripe::Transfer.create({ amount: 1000, currency: 'usd', source_transaction: '<>', destination: '<>', }) ``` See [separate charges and transfers](https://docs.stripe.com/connect/separate-charges-and-transfers.md). ### Payment Intents with Stripe Tax API We don’t recommend this charge type because the connected account controls refunds. The connected account needs to be aware of the tax withholding strategy to refund the correct amount to you and their users. 1. **Option 1:** Use `transfer_data[amount]` For the Payment Intent API call, include [transfer_data[amount]](https://docs.stripe.com/api/payment_intents/create.md#create_payment_intent-transfer_data-amount) with the value to be transferred to the connected account excluding either the total [tax amount exclusive](https://docs.stripe.com/api/tax/calculations/object.md#tax_calculation_object-tax_amount_exclusive) or [tax amount inclusive](https://docs.stripe.com/api/tax/calculations/object.md#tax_calculation_object-tax_amount_inclusive) present in the Tax Calculation object. ```dotnet StripeConfiguration.ApiKey = "<>"; var options = new PaymentIntentCreateOptions { Amount = 10000, Currency = "usd", TransferData = new PaymentIntentTransferDataOptions { Destination = "<>", Amount = 1000, }, }; var service = new PaymentIntentService(); PaymentIntent paymentIntent = service.Create(options); ``` ```go stripe.Key = "<>" params := &stripe.PaymentIntentParams{ Amount: stripe.Int64(10000), Currency: stripe.String(string(stripe.CurrencyUSD)), TransferData: &stripe.PaymentIntentTransferDataParams{ Destination: stripe.String("<>"), Amount: stripe.Int64(1000), }, }; result, err := paymentintent.New(params); ``` ```java Stripe.apiKey = "<>"; PaymentIntentCreateParams params = PaymentIntentCreateParams.builder() .setAmount(10000L) .setCurrency("usd") .setTransferData( PaymentIntentCreateParams.TransferData.builder() .setDestination("<>") .setAmount(1000L) .build() ) .build(); PaymentIntent paymentIntent = PaymentIntent.create(params); ``` ```node const stripe = require('stripe')('<>'); const paymentIntent = await stripe.paymentIntents.create({ amount: 10000, currency: 'usd', transfer_data: { destination: '<>', amount: 1000, }, }); ``` ```python import stripe stripe.api_key = "<>" payment_intent = stripe.PaymentIntent.create( amount=10000, currency="usd", transfer_data={"destination": "<>", "amount": 1000}, ) ``` ```php $stripe = new \Stripe\StripeClient('<>'); $paymentIntent = $stripe->paymentIntents->create([ 'amount' => 10000, 'currency' => 'usd', 'transfer_data' => [ 'destination' => '<>', 'amount' => 1000, ], ]); ``` ```ruby Stripe.api_key = '<>' payment_intent = Stripe::PaymentIntent.create({ amount: 10000, currency: 'usd', transfer_data: { destination: '<>', amount: 1000, }, }) ``` 2. **Option 2:** Use `application_fee_amount` For the Payment Intent API call, include the [application_fee_amount](https://docs.stripe.com/api/payment_intents/create.md#create_payment_intent-application_fee_amount) with the value to be held by your platform including either the total [tax amount exclusive](https://docs.stripe.com/api/tax/calculations/object.md#tax_calculation_object-tax_amount_exclusive) or the [tax amount inclusive](https://docs.stripe.com/api/tax/calculations/object.md#tax_calculation_object-tax_amount_inclusive) present in the Tax Calculation object. ```dotnet StripeConfiguration.ApiKey = "<>"; var options = new PaymentIntentCreateOptions { Amount = 10000, Currency = "usd", ApplicationFeeAmount = 1000, }; var service = new PaymentIntentService(); PaymentIntent paymentIntent = service.Create(options); ``` ```go stripe.Key = "<>" params := &stripe.PaymentIntentParams{ Amount: stripe.Int64(10000), Currency: stripe.String(string(stripe.CurrencyUSD)), ApplicationFeeAmount: stripe.Int64(1000), }; result, err := paymentintent.New(params); ``` ```java Stripe.apiKey = "<>"; PaymentIntentCreateParams params = PaymentIntentCreateParams.builder() .setAmount(10000L) .setCurrency("usd") .setApplicationFeeAmount(1000L) .build(); PaymentIntent paymentIntent = PaymentIntent.create(params); ``` ```node const stripe = require('stripe')('<>'); const paymentIntent = await stripe.paymentIntents.create({ amount: 10000, currency: 'usd', application_fee_amount: 1000, }); ``` ```python import stripe stripe.api_key = "<>" payment_intent = stripe.PaymentIntent.create( amount=10000, currency="usd", application_fee_amount=1000, ) ``` ```php $stripe = new \Stripe\StripeClient('<>'); $paymentIntent = $stripe->paymentIntents->create([ 'amount' => 10000, 'currency' => 'usd', 'application_fee_amount' => 1000, ]); ``` ```ruby Stripe.api_key = '<>' payment_intent = Stripe::PaymentIntent.create({ amount: 10000, currency: 'usd', application_fee_amount: 1000, }) ``` 3. **Option 3:** Create [transfer reversal](https://docs.stripe.com/api/transfer_reversals.md) For the Transfer Reversal API call, include the [amount](https://docs.stripe.com/api/transfers/create.md#create_transfer-amount) with the value to be reversed from the connected account to your platform equivalent to either the total [tax amount exclusive](https://docs.stripe.com/api/tax/calculations/object.md#tax_calculation_object-tax_amount_exclusive) or the [tax amount inclusive](https://docs.stripe.com/api/tax/calculations/object.md#tax_calculation_object-tax_amount_inclusive) present in the Tax Calculation object. Obtain the [transfer ID](https://docs.stripe.com/api/charges/object.md#charge_object-transfer) from the [expanded](https://docs.stripe.com/expand.md#multiple-properties) [latest charge](https://docs.stripe.com/api/payment_intents/object.md#payment_intent_object-latest_charge) present in the Payment Intent object. ```dotnet StripeConfiguration.ApiKey = "<>"; var options = new TransferReversalCreateOptions { Amount = 1000 }; var service = new TransferReversalService(); TransferReversal transferReversal = service.Create("<>", options); ``` ```go stripe.Key = "<>" params := &stripe.TransferReversalParams{ Amount: stripe.Int64(1000), ID: stripe.String("<>"), }; result, err := transferreversal.New(params); ``` ```java Stripe.apiKey = "<>"; Transfer transfer = Transfer.retrieve("<>"); TransferReversalCollectionCreateParams params = TransferReversalCollectionCreateParams.builder().setAmount(1000L).build(); TransferReversal transferReversal = transfer.getReversals().create(params); ``` ```node const stripe = require('stripe')('<>'); const transferReversal = await stripe.transfers.createReversal( '<>', { amount: 1000, } ); ``` ```python import stripe stripe.api_key = "<>" reversal = stripe.Transfer.create_reversal( "<>", amount=1000, ) ``` ```php $stripe = new \Stripe\StripeClient('<>'); $transferReversal = $stripe->transfers->createReversal('<>', ['amount' => 1000]); ``` ```ruby Stripe.api_key = '<>' reversal = Stripe::Transfer.create_reversal('<>', {amount: 1000}) ``` To automatically create a Transfer Reversal when the Payment Intent succeeds, create a *webhook* to be notified of [payment_intent.succeeded](https://docs.stripe.com/api/events/types.md#event_types-payment_intent.succeeded) events. This option is best suited for transactions that don’t require currency exchange. See [Reverse transfers](https://docs.stripe.com/connect/separate-charges-and-transfers.md#reverse-transfers) for more information. For the Transfer API call, include the [amount](https://docs.stripe.com/api/transfers/create.md#create_transfer-amount) with the value to be transferred to the connected account excluding either the total [tax amount exclusive](https://docs.stripe.com/api/tax/calculations/object.md#tax_calculation_object-tax_amount_exclusive) or the [tax amount inclusive](https://docs.stripe.com/api/tax/calculations/object.md#tax_calculation_object-tax_amount_inclusive) present in the Tax Calculation object. You can obtain the [charge ID](https://docs.stripe.com/api/payment_intents/object.md#payment_intent_object-latest_charge) from the Payment Intent object. ```dotnet StripeConfiguration.ApiKey = "<>"; var options = new TransferCreateOptions { Amount = 1000, Currency = "usd", SourceTransaction = "<>", Destination = "<>", }; var service = new TransferService(); Transfer transfer = service.Create(options); ``` ```go stripe.Key = "<>" params := &stripe.TransferParams{ Amount: stripe.Int64(1000), Currency: stripe.String(string(stripe.CurrencyUSD)), SourceTransaction: stripe.String("<>"), Destination: stripe.String("<>"), }; result, err := transfer.New(params); ``` ```java Stripe.apiKey = "<>"; TransferCreateParams params = TransferCreateParams.builder() .setAmount(1000L) .setCurrency("usd") .setSourceTransaction("<>") .setDestination("<>") .build(); Transfer transfer = Transfer.create(params); ``` ```node const stripe = require('stripe')('<>'); const transfer = await stripe.transfers.create({ amount: 1000, currency: 'usd', source_transaction: '<>', destination: '<>', }); ``` ```python import stripe stripe.api_key = "<>" transfer = stripe.Transfer.create( amount=1000, currency="usd", source_transaction="<>", destination="<>", ) ``` ```php $stripe = new \Stripe\StripeClient('<>'); $transfer = $stripe->transfers->create([ 'amount' => 1000, 'currency' => 'usd', 'source_transaction' => '<>', 'destination' => '<>', ]); ``` ```ruby Stripe.api_key = '<>' transfer = Stripe::Transfer.create({ amount: 1000, currency: 'usd', source_transaction: '<>', destination: '<>', }) ``` See [separate charges and transfers](https://docs.stripe.com/connect/separate-charges-and-transfers.md). ## Access Stripe Tax Reports ### Use the Stripe Dashboard You can use [Stripe Tax reports](https://docs.stripe.com/tax/reports.md) to help you correctly file and remit tax. The platform account can access the Stripe Tax reports using the [Tax Reporting](https://docs.stripe.com/tax/reports.md#how-to-access-data-using-exports-and-reports) functionality in the Stripe Dashboard. ### Use the Stripe API Platforms can also download the [itemized tax transactions](https://docs.stripe.com/tax/reports.md#itemized-exports) that they’re liable for using the [Report API](https://docs.stripe.com/reports/api.md) with the [tax.transactions.itemized.2](https://docs.stripe.com/reports/report-types/tax.md) report type. When a platform runs the following command, they download all 2022 transactions that they have sales tax liability for: ```dotnet StripeConfiguration.ApiKey = "<>"; var options = new Stripe.Reporting.ReportRunCreateOptions { ReportType = "tax.transactions.itemized.2", Parameters = new Stripe.Reporting.ReportRunParametersOptions { IntervalStart = DateTimeOffset.FromUnixTimeSeconds(1641013200).UtcDateTime, IntervalEnd = DateTimeOffset.FromUnixTimeSeconds(1672549200).UtcDateTime, }, }; var service = new Stripe.Reporting.ReportRunService(); Stripe.Reporting.ReportRun reportRun = service.Create(options); ``` ```go stripe.Key = "<>" params := &stripe.ReportingReportRunParams{ ReportType: stripe.String("tax.transactions.itemized.2"), Parameters: &stripe.ReportingReportRunParametersParams{ IntervalStart: stripe.Int64(1641013200), IntervalEnd: stripe.Int64(1672549200), }, }; result, err := reportrun.New(params); ``` ```java Stripe.apiKey = "<>"; ReportRunCreateParams params = ReportRunCreateParams.builder() .setReportType("tax.transactions.itemized.2") .setParameters( ReportRunCreateParams.Parameters.builder() .setIntervalStart(1641013200L) .setIntervalEnd(1672549200L) .build() ) .build(); ReportRun reportRun = ReportRun.create(params); ``` ```node const stripe = require('stripe')('<>'); const reportRun = await stripe.reporting.reportRuns.create({ report_type: 'tax.transactions.itemized.2', parameters: { interval_start: 1641013200, interval_end: 1672549200, }, }); ``` ```python import stripe stripe.api_key = "<>" report_run = stripe.reporting.ReportRun.create( report_type="tax.transactions.itemized.2", parameters={"interval_start": 1641013200, "interval_end": 1672549200}, ) ``` ```php $stripe = new \Stripe\StripeClient('<>'); $reportRun = $stripe->reporting->reportRuns->create([ 'report_type' => 'tax.transactions.itemized.2', 'parameters' => [ 'interval_start' => 1641013200, 'interval_end' => 1672549200, ], ]); ``` ```ruby Stripe.api_key = '<>' report_run = Stripe::Reporting::ReportRun.create({ report_type: 'tax.transactions.itemized.2', parameters: { interval_start: 1641013200, interval_end: 1672549200, }, }) ``` ## See Also * [Calculate tax in your custom checkout flow](https://docs.stripe.com/tax/custom.md)