Updates the quantity of a line item in the cart
JavaScript
import { createClient } from '@spree/sdk' const client = createClient({ baseUrl: 'https://your-store.com', publishableKey: '<api-key>', }) const cart = await client.carts.items.update('cart_abc123', 'li_abc123', { quantity: 5, }, { bearerToken: '<token>', })
{ "id": "cart_UkLWZg9DAJ", "number": "R205272356", "token": "Hj1DwwY7WR3KJ9Jo6mMdDdTGmn3KFr4XBdc", "email": "kacie@senger.info", "customer_note": null, "currency": "USD", "locale": "en", "total_quantity": 0, "item_total": "0.0", "display_item_total": "$0.00", "adjustment_total": "0.0", "display_adjustment_total": "$0.00", "discount_total": "0.0", "display_discount_total": "$0.00", "tax_total": "0.0", "display_tax_total": "$0.00", "included_tax_total": "0.0", "display_included_tax_total": "$0.00", "additional_tax_total": "0.0", "display_additional_tax_total": "$0.00", "total": "0.0", "display_total": "$0.00", "gift_card_total": "0.0", "display_gift_card_total": "$0.00", "amount_due": "0.0", "display_amount_due": "$0.00", "delivery_total": "0.0", "display_delivery_total": "$0.00", "warnings": [], "created_at": "2026-03-28T11:44:41.729Z", "updated_at": "2026-03-28T11:44:41.769Z", "store_credit_total": "0.0", "display_store_credit_total": "$0.00", "covered_by_store_credit": false, "current_step": "address", "completed_steps": [], "requirements": [ { "step": "address", "field": "ship_address", "message": "Shipping address is required" }, { "step": "delivery", "field": "shipping_method", "message": "Select a shipping method for all shipments" } ], "shipping_eq_billing_address": false, "discounts": [], "items": [ { "id": "li_UkLWZg9DAJ", "variant_id": "variant_UkLWZg9DAJ", "quantity": 1, "currency": "USD", "name": "Product 47640", "slug": "product-47640", "options_text": "", "price": "10.0", "display_price": "$10.00", "total": "10.0", "display_total": "$10.00", "adjustment_total": "0.0", "display_adjustment_total": "$0.00", "additional_tax_total": "0.0", "display_additional_tax_total": "$0.00", "included_tax_total": "0.0", "display_included_tax_total": "$0.00", "discount_total": "0.0", "display_discount_total": "$0.00", "pre_tax_amount": "10.0", "display_pre_tax_amount": "$10.00", "discounted_amount": "10.0", "display_discounted_amount": "$10.00", "display_compare_at_amount": "$0.00", "compare_at_amount": null, "thumbnail_url": null, "option_values": [], "digital_links": [] } ], "fulfillments": [], "payments": [], "billing_address": { "id": "addr_EfhxLZ9ck8", "first_name": "John", "last_name": "Doe", "full_name": "John Doe", "address1": "178 Lovely Street", "address2": "Northwest", "postal_code": "35005", "city": "Herndon", "phone": "555-555-0199", "company": "Company", "country_name": "United States of America", "country_iso": "US", "state_text": "STATE_ABBR_185", "state_abbr": "STATE_ABBR_185", "quick_checkout": false, "is_default_billing": false, "is_default_shipping": false, "state_name": "STATE_NAME_185" }, "shipping_address": null, "payment_methods": [], "gift_card": null }
Publishable API key for store access
JWT token for authenticated customers
Cart prefixed ID
Line item ID
x >= 1
5
Arbitrary key-value metadata (merged with existing)
{ "engraving": "J.D." }
metadata updated on line item
Show child attributes
Was this page helpful?