> For the complete Lynkow documentation index in agent-friendly format, see [llms.txt](/llms.txt).

# Remove an item from the cart

**Published**: 2026-11-30
**Category**: Commerce

## `DELETE /cart/lines/:variantId`

**Remove an item from the cart**

Removes the line of the `{variantId}` variant (a `var_` id) from the caller's cart and
returns the cart. The other lines that can no longer be sold are removed too and
reported in `removedLines`.

A malformed id, a variant not in the cart, or no cart returns 404 `CART_NOT_FOUND`.

> **Note:** Available only on sites with e-commerce enabled.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `variantId` | path | string | Yes | Product variant identifier (var_ prefixed id) |


### Responses

| Status | Description |
| --- | --- |
| `200` | Success |
| `401` | Missing or invalid storefront publishable key |
| `402` | The site subscription does not currently permit this operation |
| `403` | The storefront key origin is not allowed |
| `404` | Not found |


### SDK

```typescript
import { createClient } from 'lynkow'

const lynkow = createClient({
  siteId: process.env.LYNKOW_SITE_ID!,
  publishableKey: process.env.LYNKOW_PK,
})

const line = cart.items[0]
if (line.variantId) {
  const updated = await lynkow.cart.removeLine(line.variantId)
  render(updated.items)
}
```

---