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 ​

A bare JSON array of comparison rows. Each row identifies its product and customer by path reference, not as a nested object — the product's name, price, and attributes are not in this payload.

FieldTypeDescription
idintegerComparison row ID. Use it on Get One and Delete.
productstringPath of the compared product, e.g. /api/shop/products/126. The trailing segment is the product ID.
customerstringPath of the owning customer.
createdAt / updatedAtstringISO 8601 timestamps.

Pagination is reported in headers, not in the body: X-Total-Count, X-Page, X-Per-Page, X-Total-Pages.

Unlike the wishlist, the comparison list is not scoped to a channel — the same rows come back on every channel.

Over GraphQL the same rows expose product and customer as nested objects selectable in one query — see Get Compare Items.

Use Cases ​

  • Comparison table — read the rows, take the numeric ID from the end of each product path, and fetch those products with their attribute values to build the table columns.
  • "Compare (n)" badge — read X-Total-Count; the array holds only the current page.

Best Practices ​

  • Do not expect product attributes here — the row is a pointer, so a comparison view always needs a second round of product fetches, or the GraphQL query instead.
  • Fetch the products in one call — the product listing endpoint accepts filters, so a single request can return every compared product rather than one request per row.
  • Keep the row id alongside the product ID — deletion addresses the comparison row, not the product.

Released under the MIT License.