remove-item Function
Removes a line item from the cart.
The order item ID should be pulled from the id
field of the cart line item.
Example
fetch('/s/api/v1/cart/remove-item', {
method: 'POST',
headers: {
'X-CSRF-TOKEN': 'csrf_token_from_csrf_meta_tag',
},
body: JSON.stringify({
"order_item_id": "ORDER_ITEM_ID"
})
})
.then((response) => ...);
You can use the Site Theme SDK instead of calling the Cart API directly. The SDK is intended to simplify cart actions.