Skip to main content
POST
Remove from Cart

Remove from Cart

Removes an item from the cart or changes its quantity.
Cart change is a storefront surface, not part of the OAuth /api/v1 app API. It follows the Shopify-AJAX cart contract: requests are made against the storefront origin (your store domain), identity is the cart cookie token (not a Bearer access token), and the response is the flat Shopify cart object — not wrapped in a { status, type, data } envelope.

Request

Body Parameters

Use one of the following to identify the item:
line
integer
Line item index (1-based)
id
string | integer
Variant ID of the line to change
key
string
Line item key ({variant_id}:{hash}, as returned in the cart items)
quantity
integer
required
New quantity. Set to 0 to remove the item.
properties
object
Update custom properties (when identifying by variant ID, properties help pinpoint the specific line item)
A legacy browser pattern is also supported: GET /cart/change?id={variantId}&quantity={qty} (or line=). It applies the change and then redirects (HTTP 302) to /cart.

Response

The response is the flat Shopify cart object (the same shape returned by Get Cart), reflecting the updated cart after the change.

Example Response

Remove by Variant ID

When the same variant appears multiple times (with different properties), use properties to identify which one to change:

Errors

On failure the endpoint returns a Shopify-style error body with the real HTTP status: