Skip to main content
POST
/
api
/
v1
/
cart
/
change.json
Remove from Cart
curl --request POST \
  --url https://api.launchmystore.io/api/v1/cart/change.json \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "line": 123,
  "id": "<string>",
  "quantity": 123,
  "properties": {}
}
'
{
  "success": true,
  "data": {}
}

Documentation Index

Fetch the complete documentation index at: https://docs.launchmystore.io/llms.txt

Use this file to discover all available pages before exploring further.

Remove from Cart

Removes an item from the cart or changes its quantity.

Request

curl -X POST "https://api.launchmystore.io/api/v1/cart/change.json" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "line": 1,
    "quantity": 0
  }'

Body Parameters

Use one of the following to identify the item:
line
integer
Line item index (1-based)
id
string
Line item ID or variant ID
quantity
integer
required
New quantity. Set to 0 to remove the item.
properties
object
Update custom properties (when using variant ID, properties help identify the specific line item)

Response

success
boolean
Whether the request succeeded
data
object
Updated cart object

Example Response

{
  "success": true,
  "data": {
    "token": "cart_xyz789",
    "items": [
      {
        "id": "li_002",
        "product_id": "prod_ghi789",
        "variant_id": "var_jkl012",
        "title": "Baseball Cap",
        "variant_title": "One Size / Navy",
        "quantity": 1,
        "price": 1500,
        "line_price": 1500
      }
    ],
    "item_count": 1,
    "total_price": 1500,
    "note": "",
    "attributes": {}
  }
}

Remove by Variant ID

When the same variant appears multiple times (with different properties), use properties to identify which one to remove:
{
  "id": "var_gift001",
  "quantity": 0,
  "properties": {
    "Engraving": "Happy Birthday!"
  }
}

Error Codes

CodeDescription
UNAUTHORIZEDInvalid or missing access token
NOT_FOUNDCart or line item not found
VALIDATION_ERRORInvalid request body