Removes a line item from 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.delete('cart_abc123', 'li_abc123', { bearerToken: '<token>', })
{ "id": "cart_UkLWZg9DAJ", "number": "R447901517", "token": "byRB2Rwjz1NXHnLmJN8cUjH5P27q5MJdfpS", "email": "lilli@mitchell.us", "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:42.311Z", "updated_at": "2026-03-28T11:44:42.361Z", "store_credit_total": "0.0", "display_store_credit_total": "$0.00", "covered_by_store_credit": false, "current_step": "address", "completed_steps": [], "requirements": [ { "step": "cart", "field": "line_items", "message": "Add at least one item to your cart" }, { "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": [], "fulfillments": [], "payments": [], "billing_address": { "id": "addr_EfhxLZ9ck8", "first_name": "John", "last_name": "Doe", "full_name": "John Doe", "address1": "181 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_188", "state_abbr": "STATE_ABBR_188", "quick_checkout": false, "is_default_billing": false, "is_default_shipping": false, "state_name": "STATE_NAME_188" }, "shipping_address": null, "payment_methods": [], "gift_card": null }
Publishable API key for store access
JWT token for authenticated customers
Cart prefixed ID
line item removed, returns updated cart
Show child attributes
Was this page helpful?