Skip to main content
POST
/
api
/
v1
/
cart
/
clear.json
Clear Cart
curl --request POST \
  --url https://api.launchmystore.io/api/v1/cart/clear.json \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "clear_attributes": true,
  "clear_note": true
}
'
{
  "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.

Clear Cart

Removes all items from the cart while preserving cart attributes and note.

Request

curl -X POST "https://api.launchmystore.io/api/v1/cart/clear.json" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Body Parameters

No parameters required.
clear_attributes
boolean
default:"false"
Also clear cart attributes
clear_note
boolean
default:"false"
Also clear cart note

Response

success
boolean
Whether the request succeeded
data
object
The cleared cart object

Example Response

{
  "success": true,
  "data": {
    "token": "cart_xyz789",
    "items": [],
    "item_count": 0,
    "total_price": 0,
    "total_weight": 0,
    "currency": "USD",
    "requires_shipping": false,
    "note": "",
    "attributes": {},
    "created_at": "2024-03-20T10:00:00Z",
    "updated_at": "2024-03-20T11:00:00Z"
  }
}

Clear Everything

To clear items, attributes, and note:
{
  "clear_attributes": true,
  "clear_note": true
}

Error Codes

CodeDescription
UNAUTHORIZEDInvalid or missing access token
NOT_FOUNDCart not found