Only Checkout with
payment mode supports shipping options.
Create a Checkout session, adding some shipping rates to the
shipping_options parameter. You can customize each shipping option with the
|The type of calculation to used on the shipping rate. Can only be |
fixed_amount for now.
|How much to charge, in cents. Set it to |
0 if you want to offer free shipping.
|Which currency to charge in (for example, |
|The name of the shipping rate, to display to the customer.|
|An object describing the estimated delivery time for this shipping rate option. API reference.|
This example code snippet 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.
Customers can select between these two options at checkout time.
The first option in the
shipping_options array is pre-selected for the customer when they land on the checkout page.
Your customers see a shipping selector on the checkout page: