--- title: Automatically collect tax on Payment Links subtitle: Learn how to calculate and collect tax on a payment page without writing any code. route: /tax/payment-links --- # Automatically collect tax on Payment Links Learn how to calculate and collect tax on a payment page without writing any code. You can use Stripe Tax with [Payment Links](https://stripe.com/payments/payment-links) to automatically calculate and collect tax on a payment page and share a link to it with your customers, without writing any code. To [create a payment link](https://docs.stripe.com/payment-links/create.md) in the Dashboard: 1. Open the [Payment Links](https://dashboard.stripe.com/payment-links/create) page. 1. Click **+ New**. 1. Fill out the details. 1. Enable **Collect tax automatically**. To update an existing payment link in the Dashboard: 1. Open the [Payment Links](https://dashboard.stripe.com/payment-links) page. 1. Select the payment link you want to update. 1. On the payment link details page, click the overflow menu (⋯), then click **Edit**. 1. In the payment link editor, select **Collect tax automatically** to enable automatic tax collection on this payment link. 1. (Optional) Select **Collect customers’ addresses** to improve tax calculation accuracy. The more information you provide, the more precise the calculation. 1. Click **Update link** to save your changes. To create a payment link with automatic tax collection, pass the `automatic_tax[enabled]` parameter to the [Payment Link API](https://docs.stripe.com/api/payment-link/create.md) endpoint: ```dotnet StripeConfiguration.ApiKey = "<>"; var options = new PaymentLinkCreateOptions { AutomaticTax = new PaymentLinkAutomaticTaxOptions { Enabled = true }, LineItems = new List { new PaymentLinkLineItemOptions { Price = "<>", Quantity = 1 }, }, }; var service = new PaymentLinkService(); PaymentLink paymentLink = service.Create(options); ``` ```go stripe.Key = "<>" params := &stripe.PaymentLinkParams{ AutomaticTax: &stripe.PaymentLinkAutomaticTaxParams{Enabled: stripe.Bool(true)}, LineItems: []*stripe.PaymentLinkLineItemParams{ &stripe.PaymentLinkLineItemParams{Price: stripe.String("<>"), Quantity: stripe.Int64(1)}, }, }; result, err := paymentlink.New(params); ``` ```java Stripe.apiKey = "<>"; PaymentLinkCreateParams params = PaymentLinkCreateParams.builder() .setAutomaticTax(PaymentLinkCreateParams.AutomaticTax.builder().setEnabled(true).build()) .addLineItem( PaymentLinkCreateParams.LineItem.builder().setPrice("<>").setQuantity(1L).build() ) .build(); PaymentLink paymentLink = PaymentLink.create(params); ``` ```node const stripe = require('stripe')('<>'); const paymentLink = await stripe.paymentLinks.create({ automatic_tax: { enabled: true, }, line_items: [ { price: '<>', quantity: 1, }, ], }); ``` ```python import stripe stripe.api_key = "<>" payment_link = stripe.PaymentLink.create( automatic_tax={"enabled": True}, line_items=[{"price": "<>", "quantity": 1}], ) ``` ```php $stripe = new \Stripe\StripeClient('<>'); $paymentLink = $stripe->paymentLinks->create([ 'automatic_tax' => ['enabled' => true], 'line_items' => [ [ 'price' => '<>', 'quantity' => 1, ], ], ]); ``` ```ruby Stripe.api_key = '<>' payment_link = Stripe::PaymentLink.create({ automatic_tax: {enabled: true}, line_items: [ { price: '<>', quantity: 1, }, ], }) ``` To update an existing payment link in the API, pass the `automatic_tax[enabled]` parameter to the [Payment Link API](https://docs.stripe.com/api/payment-link/update.md) endpoint: ```dotnet StripeConfiguration.ApiKey = "<>"; var options = new PaymentLinkUpdateOptions { AutomaticTax = new PaymentLinkAutomaticTaxOptions { Enabled = true }, }; var service = new PaymentLinkService(); PaymentLink paymentLink = service.Update("<>", options); ``` ```go stripe.Key = "<>" params := &stripe.PaymentLinkParams{ AutomaticTax: &stripe.PaymentLinkAutomaticTaxParams{Enabled: stripe.Bool(true)}, }; result, err := paymentlink.Update("<>", params); ``` ```java Stripe.apiKey = "<>"; PaymentLink resource = PaymentLink.retrieve("<>"); PaymentLinkUpdateParams params = PaymentLinkUpdateParams.builder() .setAutomaticTax(PaymentLinkUpdateParams.AutomaticTax.builder().setEnabled(true).build()) .build(); PaymentLink paymentLink = resource.update(params); ``` ```node const stripe = require('stripe')('<>'); const paymentLink = await stripe.paymentLinks.update( '<>', { automatic_tax: { enabled: true, }, } ); ``` ```python import stripe stripe.api_key = "<>" payment_link = stripe.PaymentLink.modify( "<>", automatic_tax={"enabled": True}, ) ``` ```php $stripe = new \Stripe\StripeClient('<>'); $paymentLink = $stripe->paymentLinks->update( '<>', ['automatic_tax' => ['enabled' => true]] ); ``` ```ruby Stripe.api_key = '<>' payment_link = Stripe::PaymentLink.update('<>', {automatic_tax: {enabled: true}}) ``` ## Update your products and prices Stripe Tax uses information stored on *products* and *prices* to calculate tax, such as *tax code* and *tax behavior*. If you don’t explicitly specify these configurations, Stripe Tax will use the default tax code selected in [Tax Settings](https://dashboard.stripe.com/settings/tax). For more information, see [Specify product tax codes and tax behaviour](https://docs.stripe.com/tax/products-prices-tax-codes-tax-behavior.md). ## See Also - [Use Stripe Tax with Connect](https://docs.stripe.com/tax/connect.md)