Get Compare Item
Retrieve a single compare item by ID.
Endpoint
GET /api/shop/compare_items/{id}Request Headers
| Header | Required | Description |
|---|---|---|
Content-Type | Yes | application/json |
X-STOREFRONT-KEY | Yes | Your storefront API key |
Authorization | Yes | Customer Bearer token (Bearer <accessToken>) |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | Yes | Compare item ID |
Response Fields (200 OK)
One comparison row, with product and customer as path references, not nested objects.
| Field | Type | Description |
|---|---|---|
id | integer | Comparison row ID. |
product | string | Path of the compared product, e.g. /api/shop/products/126. |
customer | string | Path of the owning customer. |
createdAt / updatedAt | string | ISO 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
404mid-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
404as "not yours or not there" — the endpoint gives no separate signal for another customer's row.
Related Resources
- Get Compare Items — the customer's comparison rows
- Create Compare Item — add a product to the comparison list
- Delete Compare Item — remove one comparison row

