curl --location --request POST 'https://api.stateset.com/v1/carts/cart_0901f083-aa1c-43c5-af5c-0a9d2fc64e30/clear' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--data-raw '{
"preserve_coupons": false,
"reason": "customer_requested"
}'
{
"id": "cart_0901f083-aa1c-43c5-af5c-0a9d2fc64e30",
"object": "cart",
"customer_id": "cust_abc123",
"session_id": "sess_xyz789",
"channel": "web",
"currency": "USD",
"locale": "en-US",
"status": "active",
"items": [],
"item_count": 0,
"unique_item_count": 0,
"subtotal": 0,
"tax_amount": 0,
"shipping_amount": 0,
"discount_amount": 0,
"total": 0,
"shipping_address": {
"city": "San Francisco",
"state": "CA",
"postal_code": "94105",
"country": "US"
},
"applied_coupons": [],
"applied_promotions": [],
"expires_at": "2024-07-20T10:00:00Z",
"created_at": "2024-06-20T10:00:00Z",
"updated_at": "2024-06-20T17:30:00Z",
"last_activity": "2024-06-20T17:30:00Z",
"cleared_at": "2024-06-20T17:30:00Z",
"metadata": {
"clear_reason": "customer_requested",
"items_cleared": 3
},
"messages": [
{
"type": "info",
"message": "Cart has been cleared"
}
]
}
Remove all items from a cart
curl --location --request POST 'https://api.stateset.com/v1/carts/cart_0901f083-aa1c-43c5-af5c-0a9d2fc64e30/clear' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--data-raw '{
"preserve_coupons": false,
"reason": "customer_requested"
}'
{
"id": "cart_0901f083-aa1c-43c5-af5c-0a9d2fc64e30",
"object": "cart",
"customer_id": "cust_abc123",
"session_id": "sess_xyz789",
"channel": "web",
"currency": "USD",
"locale": "en-US",
"status": "active",
"items": [],
"item_count": 0,
"unique_item_count": 0,
"subtotal": 0,
"tax_amount": 0,
"shipping_amount": 0,
"discount_amount": 0,
"total": 0,
"shipping_address": {
"city": "San Francisco",
"state": "CA",
"postal_code": "94105",
"country": "US"
},
"applied_coupons": [],
"applied_promotions": [],
"expires_at": "2024-07-20T10:00:00Z",
"created_at": "2024-06-20T10:00:00Z",
"updated_at": "2024-06-20T17:30:00Z",
"last_activity": "2024-06-20T17:30:00Z",
"cleared_at": "2024-06-20T17:30:00Z",
"metadata": {
"clear_reason": "customer_requested",
"items_cleared": 3
},
"messages": [
{
"type": "info",
"message": "Cart has been cleared"
}
]
}
carts:write
permissions.
Authorization: Bearer YOUR_API_KEY
curl --location --request POST 'https://api.stateset.com/v1/carts/cart_0901f083-aa1c-43c5-af5c-0a9d2fc64e30/clear' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--data-raw '{
"preserve_coupons": false,
"reason": "customer_requested"
}'
{
"id": "cart_0901f083-aa1c-43c5-af5c-0a9d2fc64e30",
"object": "cart",
"customer_id": "cust_abc123",
"session_id": "sess_xyz789",
"channel": "web",
"currency": "USD",
"locale": "en-US",
"status": "active",
"items": [],
"item_count": 0,
"unique_item_count": 0,
"subtotal": 0,
"tax_amount": 0,
"shipping_amount": 0,
"discount_amount": 0,
"total": 0,
"shipping_address": {
"city": "San Francisco",
"state": "CA",
"postal_code": "94105",
"country": "US"
},
"applied_coupons": [],
"applied_promotions": [],
"expires_at": "2024-07-20T10:00:00Z",
"created_at": "2024-06-20T10:00:00Z",
"updated_at": "2024-06-20T17:30:00Z",
"last_activity": "2024-06-20T17:30:00Z",
"cleared_at": "2024-06-20T17:30:00Z",
"metadata": {
"clear_reason": "customer_requested",
"items_cleared": 3
},
"messages": [
{
"type": "info",
"message": "Cart has been cleared"
}
]
}