curl --location --request DELETE 'https://api.stateset.com/v1/carts/cart_0901f083-aa1c-43c5-af5c-0a9d2fc64e30/items/ci_def456' \
--header 'Authorization: Bearer YOUR_API_KEY'
{
"id": "cart_0901f083-aa1c-43c5-af5c-0a9d2fc64e30",
"object": "cart",
"customer_id": "cust_abc123",
"status": "active",
"items": [
{
"id": "ci_abc123",
"product_id": "prod_123",
"variant_id": "var_blue_large",
"product_name": "Wireless Headphones",
"variant_name": "Blue - Large",
"quantity": 3,
"unit_price": 9999,
"subtotal": 29997
},
{
"id": "ci_ghi789",
"product_id": "prod_789",
"variant_id": "var_red_medium",
"product_name": "T-Shirt",
"variant_name": "Red - Medium",
"quantity": 1,
"unit_price": 2499,
"subtotal": 2499
}
],
"item_count": 4,
"unique_item_count": 2,
"subtotal": 32496,
"discount_amount": 3000,
"total": 29496,
"updated_at": "2024-06-20T16:00:00Z",
"last_activity": "2024-06-20T16:00:00Z",
"messages": [
{
"type": "info",
"message": "Item removed from cart"
}
]
}
Remove Cart Item
Remove an item from the cart
DELETE
/
v1
/
carts
/
:id
/
items
/
:item_id
curl --location --request DELETE 'https://api.stateset.com/v1/carts/cart_0901f083-aa1c-43c5-af5c-0a9d2fc64e30/items/ci_def456' \
--header 'Authorization: Bearer YOUR_API_KEY'
{
"id": "cart_0901f083-aa1c-43c5-af5c-0a9d2fc64e30",
"object": "cart",
"customer_id": "cust_abc123",
"status": "active",
"items": [
{
"id": "ci_abc123",
"product_id": "prod_123",
"variant_id": "var_blue_large",
"product_name": "Wireless Headphones",
"variant_name": "Blue - Large",
"quantity": 3,
"unit_price": 9999,
"subtotal": 29997
},
{
"id": "ci_ghi789",
"product_id": "prod_789",
"variant_id": "var_red_medium",
"product_name": "T-Shirt",
"variant_name": "Red - Medium",
"quantity": 1,
"unit_price": 2499,
"subtotal": 2499
}
],
"item_count": 4,
"unique_item_count": 2,
"subtotal": 32496,
"discount_amount": 3000,
"total": 29496,
"updated_at": "2024-06-20T16:00:00Z",
"last_activity": "2024-06-20T16:00:00Z",
"messages": [
{
"type": "info",
"message": "Item removed from cart"
}
]
}
This endpoint removes a specific item from the cart completely. To update quantity instead, use the update item endpoint.
Authentication
This endpoint requires a valid API key withcarts:write permissions.
Authorization: Bearer YOUR_API_KEY
Path Parameters
The unique identifier of the cart
The unique identifier of the cart item to remove
Response
Returns the updated cart object without the removed item.curl --location --request DELETE 'https://api.stateset.com/v1/carts/cart_0901f083-aa1c-43c5-af5c-0a9d2fc64e30/items/ci_def456' \
--header 'Authorization: Bearer YOUR_API_KEY'
{
"id": "cart_0901f083-aa1c-43c5-af5c-0a9d2fc64e30",
"object": "cart",
"customer_id": "cust_abc123",
"status": "active",
"items": [
{
"id": "ci_abc123",
"product_id": "prod_123",
"variant_id": "var_blue_large",
"product_name": "Wireless Headphones",
"variant_name": "Blue - Large",
"quantity": 3,
"unit_price": 9999,
"subtotal": 29997
},
{
"id": "ci_ghi789",
"product_id": "prod_789",
"variant_id": "var_red_medium",
"product_name": "T-Shirt",
"variant_name": "Red - Medium",
"quantity": 1,
"unit_price": 2499,
"subtotal": 2499
}
],
"item_count": 4,
"unique_item_count": 2,
"subtotal": 32496,
"discount_amount": 3000,
"total": 29496,
"updated_at": "2024-06-20T16:00:00Z",
"last_activity": "2024-06-20T16:00:00Z",
"messages": [
{
"type": "info",
"message": "Item removed from cart"
}
]
}
⌘I