Remove line item from cart
Removes a line item from the cart
DELETE
Spree SDK
Authorizations
Publishable API key for store access
JWT token for authenticated customers
Response
line item removed, returns updated cart
Documentation Index
Fetch the complete documentation index at: /docs/llms.txt
Use this file to discover all available pages before exploring further.
Removes a line item from the cart
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', {
token: '<token>',
})curl --request DELETE \
--url http://{defaultHost}/api/v3/store/carts/{cart_id}/items/{id} \
--header 'Authorization: Bearer <token>' \
--header 'x-spree-api-key: <api-key>'{
"id": "cart_UkLWZg9DAJ",
"market_id": null,
"channel_id": "ch_UkLWZg9DAJ",
"number": "R725723396",
"token": "BKVjbAoa8GVS68wVEkU5hL74Dy9FCHfFFUX",
"email": "emely@kulas.info",
"customer_note": null,
"currency": "USD",
"locale": "en",
"total_quantity": 0,
"warnings": [],
"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",
"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": "256 Lovely Street",
"address2": "Northwest",
"postal_code": "10118",
"city": "New York",
"phone": "555-555-0199",
"company": "Company",
"country_name": "United States of America",
"country_iso": "US",
"state_text": "NY",
"state_abbr": "NY",
"quick_checkout": false,
"is_default_billing": false,
"is_default_shipping": false,
"state_name": "New York"
},
"shipping_address": null,
"payment_methods": [],
"gift_card": null,
"market": null
}{
"error": {
"code": "line_item_not_found",
"message": "Line item not found"
}
}Publishable API key for store access
JWT token for authenticated customers
line item removed, returns updated cart
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Was this page helpful?
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', {
token: '<token>',
})curl --request DELETE \
--url http://{defaultHost}/api/v3/store/carts/{cart_id}/items/{id} \
--header 'Authorization: Bearer <token>' \
--header 'x-spree-api-key: <api-key>'{
"id": "cart_UkLWZg9DAJ",
"market_id": null,
"channel_id": "ch_UkLWZg9DAJ",
"number": "R725723396",
"token": "BKVjbAoa8GVS68wVEkU5hL74Dy9FCHfFFUX",
"email": "emely@kulas.info",
"customer_note": null,
"currency": "USD",
"locale": "en",
"total_quantity": 0,
"warnings": [],
"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",
"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": "256 Lovely Street",
"address2": "Northwest",
"postal_code": "10118",
"city": "New York",
"phone": "555-555-0199",
"company": "Company",
"country_name": "United States of America",
"country_iso": "US",
"state_text": "NY",
"state_abbr": "NY",
"quick_checkout": false,
"is_default_billing": false,
"is_default_shipping": false,
"state_name": "New York"
},
"shipping_address": null,
"payment_methods": [],
"gift_card": null,
"market": null
}{
"error": {
"code": "line_item_not_found",
"message": "Line item not found"
}
}