Skip to main content
POST
Clear Cart

Clear Cart

Removes all line items from the cart. The cart itself (and its token) is preserved, so the same token keeps working for subsequent add requests.
The cart is a storefront, cookie-based resource, not part of the OAuth /api/v1 app API. Requests go to the shop’s own domain (e.g. https://mystore.launchmystore.io/cart/clear.js) and the cart is identified by the cart cookie that the storefront sets — there is no Authorization: Bearer header. This mirrors the Shopify /cart/clear.js AJAX endpoint.

Request

Body Parameters

No parameters required. The request body is ignored — clearCart only ever deletes the cart’s line items.

Response

Returns the (now empty) cart as a bare Shopify-style cart object — not an { status, data } envelope.
token
string
The cart token (unchanged)
items
array
Line items — empty after a clear
item_count
integer
Number of items in the cart (0 after a clear)
total_price
integer
Cart total in the currency’s smallest unit (cents)
currency
string
Presentment currency code

Example Response

Errors

A failed clear returns the same bare Shopify-style body with an HTTP error status and a message/description: