Skip to content
Create account
or
Sign in
The Stripe Docs logo
/
Ask AI
Create account
Sign in
Get started
Payments
Finance automation
Platforms and marketplaces
Money management
Developer tools
Get started
Payments
Finance automation
Get started
Payments
Finance automation
Platforms and marketplaces
Money management
Overview
About Stripe payments
Upgrade your integration
Payments analytics
Online payments
OverviewFind your use caseManaged Payments
Use Payment Links
Build a checkout page
    Overview
    Quickstarts
    Customize look and feel
    Collect additional information
      Collect physical addresses
      Charge for shipping
      Collect phone numbers
      Add custom fields
      Collect consent for promotional emails
    Collect taxes
    Dynamically update checkout
    Manage your product catalog
    Subscriptions
    Manage payment methods
    Let customers pay in their local currency
    Add discounts, upsells, and optional items
    Set up future payments
    Save payment details during payment
    Manually approve payments on your server
    After the payment
    Elements with Checkout Sessions API beta changelog
    Migrate from legacy Checkout
    Migrate Checkout to use Prices
Build an advanced integration
Build an in-app integration
Payment methods
Add payment methods
Manage payment methods
Faster checkout with Link
Payment interfaces
Payment Links
Checkout
Web Elements
In-app Elements
Payment scenarios
Custom payment flows
Flexible acquiring
Orchestration
In-person payments
Terminal
Other Stripe products
Financial Connections
Crypto
Climate
HomePaymentsBuild a checkout pageCollect additional information

Charge for shipping

Create different shipping rates for your customers.

Copy page

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. Before you create a shipping rate, learn how to collect billing and shipping addresses.

Create a shipping rate
Dashboard
Server-side

To add a shipping rate using the Dashboard:

  1. Click Create shipping rate.
  2. Enter an amount, a description, and an optional delivery estimate.
  3. Click Save, and copy the shipping rate ID (shr_123456).

Enter your shipping rate details

Create a Checkout Session
Server-side

To create a Checkout Session that includes your shipping rate, pass in the generated shipping rate ID to the shipping_options parameter. If you want to create the shipping rate at the same time as a Checkout Session, use the shipping_rate_data parameter with shipping_options. Only Checkout Sessions in payment mode support shipping options.

The following code sample adds two shipping options to the Checkout Session:

  • Free shipping, with an estimated delivery of 5-7 business days.
  • Next day air, at a cost of 15.00 USD, with an estimated delivery of exactly 1 business day.

In this example, the first option in the shipping_options array is pre-selected for the customer on the checkout page. However, customers can choose either option.

Command Line
cURL
curl https://api.stripe.com/v1/checkout/sessions \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ -d "shipping_address_collection[allowed_countries][0]"=US \ -d "shipping_address_collection[allowed_countries][1]"=CA \ -d "shipping_options[0][shipping_rate_data][type]"=fixed_amount \ -d "shipping_options[0][shipping_rate_data][fixed_amount][amount]"=0 \ -d "shipping_options[0][shipping_rate_data][fixed_amount][currency]"=usd \ -d "shipping_options[0][shipping_rate_data][display_name]"="Free shipping" \ -d "shipping_options[0][shipping_rate_data][delivery_estimate][minimum][unit]"=business_day \ -d "shipping_options[0][shipping_rate_data][delivery_estimate][minimum][value]"=5 \ -d "shipping_options[0][shipping_rate_data][delivery_estimate][maximum][unit]"=business_day \ -d "shipping_options[0][shipping_rate_data][delivery_estimate][maximum][value]"=7 \ -d "shipping_options[1][shipping_rate_data][type]"=fixed_amount \ -d "shipping_options[1][shipping_rate_data][fixed_amount][amount]"=1500 \ -d "shipping_options[1][shipping_rate_data][fixed_amount][currency]"=usd \ -d "shipping_options[1][shipping_rate_data][display_name]"="Next day air" \ -d "shipping_options[1][shipping_rate_data][delivery_estimate][minimum][unit]"=business_day \ -d "shipping_options[1][shipping_rate_data][delivery_estimate][minimum][value]"=1 \ -d "shipping_options[1][shipping_rate_data][delivery_estimate][maximum][unit]"=business_day \ -d "shipping_options[1][shipping_rate_data][delivery_estimate][maximum][value]"=1 \ -d "line_items[0][price_data][currency]"=usd \ -d "line_items[0][price_data][product_data][name]"=T-shirt \ -d "line_items[0][price_data][unit_amount]"=2000 \ -d "line_items[0][quantity]"=1 \ -d mode=payment \ --data-urlencode success_url="https://example.com/success"

If successful, the shipping selector appears on your checkout page:

The shipping selector on the checkout page

The shipping selector on the checkout page

OptionalHandle completed transactions

OptionalDefine a delivery estimate

OptionalCharge tax for shipping

Was this page helpful?
YesNo
Need help? Contact Support.
Join our early access program.
Check out our changelog.
Questions? Contact Sales.
LLM? Read llms.txt.
Powered by Markdoc