--- title: Charge for shipping subtitle: Create different shipping rates for your customers. route: /payments/no-code/charge-shipping --- # Charge for shipping Create different shipping rates for your customers. Shipping rates let you display various shipping options—like standard, express, and overnight—with more accurate delivery estimates. Charge your customer for shipping using different Stripe products, some of which require coding. Before you create a shipping rate, learn how to [collect billing and shipping addresses](https://docs.stripe.com/payments/no-code/collect-addresses.md). If you’re using a third-party application with Stripe (for example, [Thrivecart](https://support.thrivecart.com/help/setting-your-physical-fulfilment-shipping-options/) or [Shopify](https://help.shopify.com/en/manual/shipping/setting-up-and-managing-your-shipping/setting-up-shipping-rates)) and want to adjust the shipping rate, visit the docs for that service. 1. Create a [payment link](https://dashboard.stripe.com/test/payment-links/create) and select **Collect customers’ addresses** with the **Billing and shipping addresses** option. 1. Select the countries you ship to. 1. Click **Add shipping rates** to select an existing shipping rate or add a new one. You can only use shipping rates with one-time prices on payment links. ![](images/shipping-rates/create-payment-link-with-shipping-rate.png) Add a new shipping rate for a payment link in the Dashboard [Create a shipping rate](https://docs.stripe.com/api/shipping_rates.md), which at a minimum, requires the `type` and `display_name` parameters. The following code sample uses both of these parameters along with `fixed_amount` and `deliver_estimate` to create a shipping rate: ```dotnet StripeConfiguration.ApiKey = "<>"; var options = new ShippingRateCreateOptions { DisplayName = "Ground shipping", Type = "fixed_amount", FixedAmount = new ShippingRateFixedAmountOptions { Amount = 500, Currency = "usd" }, DeliveryEstimate = new ShippingRateDeliveryEstimateOptions { Minimum = new ShippingRateDeliveryEstimateMinimumOptions { Unit = "business_day", Value = 5, }, Maximum = new ShippingRateDeliveryEstimateMaximumOptions { Unit = "business_day", Value = 7, }, }, }; var service = new ShippingRateService(); ShippingRate shippingRate = service.Create(options); ``` ```go stripe.Key = "<>" params := &stripe.ShippingRateParams{ DisplayName: stripe.String("Ground shipping"), Type: stripe.String("fixed_amount"), FixedAmount: &stripe.ShippingRateFixedAmountParams{ Amount: stripe.Int64(500), Currency: stripe.String(string(stripe.CurrencyUSD)), }, DeliveryEstimate: &stripe.ShippingRateDeliveryEstimateParams{ Minimum: &stripe.ShippingRateDeliveryEstimateMinimumParams{ Unit: stripe.String(string(stripe.ShippingRateDeliveryEstimateMinimumUnitBusinessDay)), Value: stripe.Int64(5), }, Maximum: &stripe.ShippingRateDeliveryEstimateMaximumParams{ Unit: stripe.String(string(stripe.ShippingRateDeliveryEstimateMaximumUnitBusinessDay)), Value: stripe.Int64(7), }, }, }; result, err := shippingrate.New(params); ``` ```java Stripe.apiKey = "<>"; ShippingRateCreateParams params = ShippingRateCreateParams.builder() .setDisplayName("Ground shipping") .setType(ShippingRateCreateParams.Type.FIXED_AMOUNT) .setFixedAmount( ShippingRateCreateParams.FixedAmount.builder().setAmount(500L).setCurrency("usd").build() ) .setDeliveryEstimate( ShippingRateCreateParams.DeliveryEstimate.builder() .setMinimum( ShippingRateCreateParams.DeliveryEstimate.Minimum.builder() .setUnit(ShippingRateCreateParams.DeliveryEstimate.Minimum.Unit.BUSINESS_DAY) .setValue(5L) .build() ) .setMaximum( ShippingRateCreateParams.DeliveryEstimate.Maximum.builder() .setUnit(ShippingRateCreateParams.DeliveryEstimate.Maximum.Unit.BUSINESS_DAY) .setValue(7L) .build() ) .build() ) .build(); ShippingRate shippingRate = ShippingRate.create(params); ``` ```node const stripe = require('stripe')('<>'); const shippingRate = await stripe.shippingRates.create({ display_name: 'Ground shipping', type: 'fixed_amount', fixed_amount: { amount: 500, currency: 'usd', }, delivery_estimate: { minimum: { unit: 'business_day', value: 5, }, maximum: { unit: 'business_day', value: 7, }, }, }); ``` ```python import stripe stripe.api_key = "<>" shipping_rate = stripe.ShippingRate.create( display_name="Ground shipping", type="fixed_amount", fixed_amount={"amount": 500, "currency": "usd"}, delivery_estimate={ "minimum": {"unit": "business_day", "value": 5}, "maximum": {"unit": "business_day", "value": 7}, }, ) ``` ```php $stripe = new \Stripe\StripeClient('<>'); $shippingRate = $stripe->shippingRates->create([ 'display_name' => 'Ground shipping', 'type' => 'fixed_amount', 'fixed_amount' => [ 'amount' => 500, 'currency' => 'usd', ], 'delivery_estimate' => [ 'minimum' => [ 'unit' => 'business_day', 'value' => 5, ], 'maximum' => [ 'unit' => 'business_day', 'value' => 7, ], ], ]); ``` ```ruby Stripe.api_key = '<>' shipping_rate = Stripe::ShippingRate.create({ display_name: 'Ground shipping', type: 'fixed_amount', fixed_amount: { amount: 500, currency: 'usd', }, delivery_estimate: { minimum: { unit: 'business_day', value: 5, }, maximum: { unit: 'business_day', value: 7, }, }, }) ``` Create a payment link and [collect a billing and shipping address](https://docs.stripe.com/payments/collect-addresses.md?payment-ui=payment-links). Add shipping rates to the payment link using the [shipping_options](https://docs.stripe.com/api/payment_links/payment_links/object.md#payment_link_object-shipping_options) parameter. You can only use shipping rates with one time prices on payment links. ```dotnet StripeConfiguration.ApiKey = "<>"; var options = new PaymentLinkCreateOptions { LineItems = new List { new PaymentLinkLineItemOptions { Price = "<>", Quantity = 1 }, }, BillingAddressCollection = "required", ShippingAddressCollection = new PaymentLinkShippingAddressCollectionOptions { AllowedCountries = new List { "US" }, }, ShippingOptions = new List { new PaymentLinkShippingOptionOptions { ShippingRate = "<>" }, }, }; 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)}, }, BillingAddressCollection: stripe.String(string(stripe.PaymentLinkBillingAddressCollectionRequired)), ShippingAddressCollection: &stripe.PaymentLinkShippingAddressCollectionParams{ AllowedCountries: []*string{stripe.String("US")}, }, ShippingOptions: []*stripe.PaymentLinkShippingOptionParams{ &stripe.PaymentLinkShippingOptionParams{ShippingRate: stripe.String("<>")}, }, }; result, err := paymentlink.New(params); ``` ```java Stripe.apiKey = "<>"; PaymentLinkCreateParams params = PaymentLinkCreateParams.builder() .addLineItem( PaymentLinkCreateParams.LineItem.builder().setPrice("<>").setQuantity(1L).build() ) .setBillingAddressCollection(PaymentLinkCreateParams.BillingAddressCollection.REQUIRED) .setShippingAddressCollection( PaymentLinkCreateParams.ShippingAddressCollection.builder() .addAllowedCountry(PaymentLinkCreateParams.ShippingAddressCollection.AllowedCountry.US) .build() ) .addShippingOption( PaymentLinkCreateParams.ShippingOption.builder().setShippingRate("<>").build() ) .build(); PaymentLink paymentLink = PaymentLink.create(params); ``` ```node const stripe = require('stripe')('<>'); const paymentLink = await stripe.paymentLinks.create({ line_items: [ { price: '<>', quantity: 1, }, ], billing_address_collection: 'required', shipping_address_collection: { allowed_countries: ['US'], }, shipping_options: [ { shipping_rate: '<>', }, ], }); ``` ```python import stripe stripe.api_key = "<>" payment_link = stripe.PaymentLink.create( line_items=[{"price": "<>", "quantity": 1}], billing_address_collection="required", shipping_address_collection={"allowed_countries": ["US"]}, shipping_options=[{"shipping_rate": "<>"}], ) ``` ```php $stripe = new \Stripe\StripeClient('<>'); $paymentLink = $stripe->paymentLinks->create([ 'line_items' => [ [ 'price' => '<>', 'quantity' => 1, ], ], 'billing_address_collection' => 'required', 'shipping_address_collection' => ['allowed_countries' => ['US']], 'shipping_options' => [['shipping_rate' => '<>']], ]); ``` ```ruby Stripe.api_key = '<>' payment_link = Stripe::PaymentLink.create({ line_items: [ { price: '<>', quantity: 1, }, ], billing_address_collection: 'required', shipping_address_collection: {allowed_countries: ['US']}, shipping_options: [{shipping_rate: '<>'}], }) ```