---
title: "Remove a line item"
---

> Documentation Index
> Fetch the complete documentation index at: https://edgecart.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Remove a line item

Path: EdgeCart API › Storefront

`DELETE /store/carts/{id}/line-items/{line_id}`

URL: `https://{store_domain}/api/store/carts/{id}/line-items/{line_id}`

Removes a line item from the cart.

## Authentication

- `publishableKey`, apiKey, in header, header `x-publishable-api-key`

## Path parameters

- `id` (`removeStorefrontCartLineItem.path.id`; string, required)
- `line_id` (`removeStorefrontCartLineItem.path.line_id`; string, required)

## Code samples

### cURL

```bash
curl --request DELETE \
  --url 'https://your-store.example.com/api/store/carts/<id>/line-items/<line_id>' \
  --header 'x-publishable-api-key: <x-publishable-api-key>'
```

### TypeScript

```typescript
const url = 'https://your-store.example.com/api/store/carts/<id>/line-items/<line_id>';
const options = {
  method: 'DELETE',
  headers: {'x-publishable-api-key': '<x-publishable-api-key>'}
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://your-store.example.com/api/store/carts/<id>/line-items/<line_id>"

headers = {"x-publishable-api-key": "<x-publishable-api-key>"}

response = requests.delete(url, headers=headers)

print(response.text)
```

## Responses

### 200

The deleted line item.

#### Example

```json
{
  "id": "string",
  "object": "line_item",
  "deleted": true
}
```

- `id` (`removeStorefrontCartLineItem.response.200.id`; string, required)
- `object` (`removeStorefrontCartLineItem.response.200.object`; string, required)
- `deleted` (`removeStorefrontCartLineItem.response.200.deleted`; boolean, required)
  - one of `true`

### 404

The cart or line item does not exist.

#### Example

```json
{
  "type": "not_found",
  "message": "No active store is available for this deployment",
  "code": "store_not_configured"
}
```

- `type` (`removeStorefrontCartLineItem.response.404.type`; string, required)
- `message` (`removeStorefrontCartLineItem.response.404.message`; string, required)
- `code` (`removeStorefrontCartLineItem.response.404.code`; string, optional)


Source: https://edgecart.dev/api/store/carts/line-items/remove/index.md
