Skip to content

Compare

The Compare menu lets a logged-in customer build a side-by-side comparison list of products. A customer can list their compare items, read a single one, add a product, remove one item, or clear the whole list.

When a client uses this

Use the compare list to power a "compare products" feature — add products as the shopper marks them, then read the list to render a comparison view. The list is per-customer.

Operations in this menu

OperationMethod & PathDescription
Get Compare ItemsGET /api/shop/compare-itemsList the customer's compare items.
Get Compare ItemGET /api/shop/compare-items/{id}A single compare item.
Create Compare ItemPOST /api/shop/compare-itemsAdd a product to the compare list.
Delete Compare ItemDELETE /api/shop/compare-items/{id}Remove one item.
Delete All Compare ItemsPOST /api/shop/delete-all-compare-itemsClear the whole compare list.

All Compare endpoints require the storefront key and a customer Bearer token — see Authentication.

Released under the MIT License.