Create a shipping rate
In the Shipping rates section of the Dashboard, add a shipping rate by clicking the New button. Enter an amount, an optional description (e.g.,
Ground shipping), and an optional estimated shipping time.
Shipping address collection
You can collect a customer’s shipping address in Checkout by setting
shipping_address_collection when creating a Checkout Session. You must also specify which countries to allow shipping to by configuring the
allowed_countries property with an array of two-letter ISO country codes. These countries appear in the Country dropdown in the Shipping Address form on Checkout.
When the customer completes the session, it saves the collected shipping address to the Checkout Session object on the
shipping property and includes it in the payload of the
checkout.session.completed webhook. Additionally, shipping information appears in the Checkout summary section of your payments detail page in Dashboard.
Create a Checkout session with a shipping rate
Create a Checkout session and include the ID of your desired ShippingRate in the
shipping_rates parameter. You can get the ID of the rate from the Dashboard. Then pass the
shipping_address_collection parameter described in the previous section.
Handling completed transactions
After the payment completes, you can retrieve the shipping amount in the
amount_shipping property in the
total_details of the completed Checkout session. See the Fulfillment guide to learn how to create an event handler to handle completed Checkout sessions.
As soon as you have a handler, you can access the