Delete All Compare Items
Remove every product from the authenticated customer's comparison list in a single request.
Endpoint
POST /api/shop/delete-all-compare-itemsRequest Headers
| Header | Required | Description |
|---|---|---|
Content-Type | Yes | application/json |
X-STOREFRONT-KEY | Yes | Your storefront API key |
Authorization | Yes | Customer Bearer token (Bearer <accessToken>) |
Request Body
No fields are required. Send an empty JSON object:
json
{}Response Fields (201 Created)
| Field | Type | Description |
|---|---|---|
message | string | All compare items have been removed successfully. |
deletedCount | integer | How many rows were removed. 0 when the list was already empty. |
Behaviour
- Clears only the authenticated customer's rows. The comparison list is not channel-scoped, so one call empties it everywhere.
- Repeating the call is safe; the second one answers
201withdeletedCount: 0. - The message reads the same whether rows were removed or not — read
deletedCountto know what happened.
Use Cases
- "Clear comparison" button — one call empties the table, and
deletedCounttells the UI how many columns to drop without a re-fetch. - Reset between comparison sessions — clearing is cheaper than deleting each row when the shopper starts a new set.
Best Practices
- Confirm in the UI first — the call takes no ID and is irreversible.
- Read
deletedCount, notmessage— the message is identical on an empty list.
Related Resources
- Get Compare Items — the customer's comparison rows
- Delete Compare Item — remove one comparison row

