Skip to content

Get Compare Items

Retrieve the products in the authenticated customer's comparison list.

Endpoint

GET /api/shop/compare-items

Request Headers

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

Response Fields (200 OK)

FieldTypeDescription
idintegerCompare item ID
productobjectAssociated product (id, sku, type, name, price, formattedPrice, etc.)
customerobjectCustomer who added the item (id, firstName, lastName)
createdAtstringTimestamp when the item was added
updatedAtstringTimestamp when the item was last updated

TIP

The response is a plain JSON array of compare items. Pagination metadata is exposed via the X-Total-Count / X-Page / X-Per-Page / X-Total-Pages response headers.

Use Cases

  • Display the product comparison page
  • Build comparison tables across saved products
  • Show a compare count in navigation

Notes

  • Compare items are scoped to the authenticated customer (not channel-scoped).
  • Guests cannot have compare lists — a valid customer token is required.

Released under the MIT License.