Update line itemsBeta
Make changes to the line items during checkout.
A Checkout Session’s line items keep track of what your customer is purchasing. You can configure the Checkout Session so customers can adjust line item quantities during checkout.
Other line item updates, such as adding new line items, are not yet supported.
Enable adjustable quantitiesServer-side
Set adjustable_quantity on your line_items when creating a Checkout Session to enable your customers to update the quantity of an item during checkout.
You can customize the default settings for the minimum and maximum quantities allowed by setting adjustable_quantity.minimum and adjustable_quantity.maximum. By default, an item’s minimum adjustable quantity is 0 and the maximum adjustable quantity is 99. You can specify a value of up to 999999 for adjustable_
.
Checkout prevents the customer from removing an item if it is the only item remaining.
Update line item quantitiesClient-side
Use updateLineItemQuantity to change a line item’s quantity in response to customer interaction, such as a button to increment the quantity: