> For the complete documentation index, see [llms.txt](https://docs.commercelayer.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.commercelayer.io/how-tos/placing-orders/shopping-cart/remove-from-cart.md).

# Removing products from cart

How to remove an item from your shopping cart

## Problem

You have some items in your shopping cart and you want to remove one of them.

![A sample cart item removal](https://2610849379-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lk-ezuDClaMavTqnRi0%2Fuploads%2FKHueyYNFPhFV7kxG9LtS%2Fremove-from-cart-cover.jpg?alt=media\&token=e8168c03-3f05-4c51-83c4-1e13ea11c9de)

## Solution

Removing a product (SKU) from your shopping cart means deleting an existing line item. To do that, send a `DELETE` request to the `/api/line_items/:id` endpoint.

### Example

{% tabs %}
{% tab title="Request" %}
The following request removes the line item identified by the "aBmNkPQRst" ID from your shopping cart:

```javascript
curl -g -X DELETE \
  'http://yourdomain.commercelayer.io/api/line_items/aBmNkPQRst' \
  -H 'Accept: application/vnd.api+json' \
  -H 'Authorization: Bearer your-access-token' \
  -H 'Content-Type: application/vnd.api+json' \
```

{% endtab %}

{% tab title="Response" %}
On success, the API responds with a `204 No Content` status code.
{% endtab %}
{% endtabs %}

## More to read

See our documentation if you need more information on how to [delete a line item](https://docs.commercelayer.io/developers/v/api-reference/line_items/delete).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.commercelayer.io/how-tos/placing-orders/shopping-cart/remove-from-cart.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
