Skip to content

Delete Compare Item ​

Remove a single product from the authenticated customer's comparison list.

Endpoint ​

DELETE /api/shop/compare_items/{id}

Request Headers ​

HeaderRequiredDescription
Content-TypeYesapplication/json
X-STOREFRONT-KEYYesYour storefront API key
AuthorizationYesCustomer Bearer token (Bearer <accessToken>)

Path Parameters ​

ParameterTypeRequiredDescription
idintegerYesCompare item ID to delete

Response ​

204 No Content with an empty body. There is no confirmation message — the status is the confirmation.

Behaviour ​

  • Only the comparison row is removed; the product is untouched and can be added again immediately.
  • A row belonging to another customer answers 404, exactly as an ID that does not exist.
  • Repeating the call on an already-deleted row answers 404.

Use Cases ​

  • Remove one column from a comparison table — call with the row's id, then drop that column locally; the empty body leaves nothing to re-render from.
  • Undo an accidental add — the 400 returned by a duplicate Create means the row is already there, and this removes it.

Best Practices ​

  • Address the row, not the product — the path takes the comparison row ID; there is no remove-by-product-ID endpoint here.
  • Do not parse a body — a 204 carries none.
  • Use Delete All to clear the set — one call beats a loop over the rows.

Released under the MIT License.