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

# Remove an item from the cart

**Publié le** : 2026-08-19
**Catégorie** : Commerce

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

**Remove an item from the cart**

Removes the line for the `:variantId` variant (its `var_` wire id) from the
caller's cart and recomputes the totals, returning the updated cart. A
malformed variant id, a variant that is not in the cart, and having no cart at
all all return the same 404, deliberately indistinguishable.

Removing also SELF-HEALS the cart (Phase 5): any OTHER line whose variant has
since stopped being sellable is auto-removed and reported in `removedLines`. A
still-addressable target pruned this way returns the healed cart. If the target's
variant was hard-deleted, its FK is already NULL and the former id cannot be
correlated: the heal persists, but DELETE returns the uniform 404 with no report
body, indistinguishable from an absent target.

> **Note:** This endpoint requires the e-commerce feature to be enabled on your site.

### 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 |


---