Skip to content

Get Compare Item ​

Retrieve a single compare item by ID.

Endpoint ​

GET /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

Response Fields (200 OK) ​

One comparison row, with product and customer as path references, not nested objects.

FieldTypeDescription
idintegerComparison row ID.
productstringPath of the compared product, e.g. /api/shop/products/126.
customerstringPath of the owning customer.
createdAt / updatedAtstringISO 8601 timestamps.

A row belonging to another customer answers 404, the same as an ID that does not exist.

Use Cases ​

  • Confirm a row still exists — before offering "remove", check the ID rather than reacting to a 404 mid-action.

Best Practices ​

  • Prefer the list endpoint — this returns the same four fields for one row, so fetching the whole list is usually one call instead of many.
  • Read 404 as "not yours or not there" — the endpoint gives no separate signal for another customer's row.

Released under the MIT License.