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. Before you create a shipping rate, learn how to collect billing and shipping addresses.
Create a shipping rateDashboardServer-side
Shipping rates only support fixed amount values for the entire order. You can’t adjust the shipping rate based on the number of items in the order.
Create a Checkout SessionServer-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_ parameter with shipping_. 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_ array is pre-selected for the customer on the checkout page. However, customers can choose either option.
If successful, the shipping selector appears in your checkout flow:

The shipping selector in the checkout flow
OptionalHandle completed transactions
After the payment succeeds, you can retrieve the shipping amount in the amount_total attribute of the shipping_cost. You can also retrieve the selected shipping rate using the shipping_ attribute in shipping_. To access the shipping_ property, you must create an event handler to handle completed Checkout Sessions. You can test a handler by installing the Stripe CLI and using stripe listen --forward-to localhost:4242/webhook to forward events to your local server. In the following code sample, the handler allows for the user to access the shipping_:
OptionalDefine a delivery estimate
You can configure shipping rates using a number of delivery estimate combinations. The following table contains some examples of plain English delivery estimates, and their corresponding delivery_ and delivery_ values:
| Delivery Estimate | Minimum | Maximum |
|---|---|---|
| 1 day |
|
|
| 1 business day |
|
|
| At least 2 business days |
|
|
| 3 to 7 days |
|
|
| 4 to 8 hours |
|
|
| 4 hours to 2 business days |
|
|
OptionalCharge tax for shipping
You can use Stripe Tax to automatically calculate tax on shipping fees by setting a tax_ and tax_ on your shipping rate. Stripe Tax automatically determines whether shipping is taxable (as taxability varies by state and country) and applies the correct tax rate if so.
When creating a shipping rate with shipping_ or through Create a Shipping Rate, you can add a tax_ and tax_ parameter to the shipping rate.
We recommend setting the tax_ to Shipping (txcd_) to make sure that you always charge the correct tax. You can also set the shipping rate tax_ to Nontaxable (txcd_) if you don’t want to charge tax.
For this example, we set the tax_ to exclusive, which is common in the US. Learn more about tax behavior.
Your customer can see the calculated tax amount for the shipping rate factored into the total sales tax in your checkout flow:

Calculated tax amount for the shipping rate in the checkout flow
