Skip to content

Get Product Reviews

Retrieve reviews and ratings for a specific product. By default only approved reviews are returned; pass the status parameter to fetch a different status.

Endpoint

GET /api/shop/products/{productId}/reviews

Request Headers

HeaderRequiredDescription
Content-TypeYesapplication/json
X-STOREFRONT-KEYYesYour storefront API key

Path Parameters

ParameterTypeRequiredDescription
productIdintegerYesProduct ID

Query Parameters

ParameterTypeDefaultDescription
statusstringapprovedFilter by status (approved, pending). Omit to get approved reviews only.
ratingintegerFilter by star rating (1–5).
pageinteger1Page number (1-based).
per_pageinteger30Reviews per page. Alias: limit. Maximum 50.

Combining filters narrows the result — ?status=approved&rating=4 returns only four-star approved reviews. Sorting is not configurable; rows always come back oldest first, by ID.

A storefront product page shows approved reviews only, which is why status defaults to approved. Moderation or preview tooling has to ask for another status explicitly, one value per request.

Response (200 OK)

Returns a JSON array of review objects.

FieldTypeDescription
idintegerReview ID
namestringReviewer display name
titlestringReview title
ratingintegerRating (1–5 stars)
commentstringReview body
statusstringReview status (approved, pending)
createdAtstringReview creation date (ISO 8601)
updatedAtstringLast update date (ISO 8601)

Pagination

Pagination metadata is returned in response headers (not the body):

HeaderDescription
X-Total-CountTotal reviews matching the filters
X-PageCurrent page
X-Per-PageReviews per page
X-Total-PagesTotal page count

Use Cases

  • Review block on a product page — call with no parameters; the default already excludes anything unapproved, so nothing needs filtering client-side.
  • Rating breakdown — the endpoint returns rows, not aggregates, so a "5 star (12)" histogram needs one call per rating with ?rating=n, reading X-Total-Count from each.
  • "Your review is awaiting approval" state — after a customer submits, ?status=pending is the only way to show it back to them; it is absent from the default list.

Best Practices

  • Read the count from X-Total-Count — the body is one page, so array.length under-reports whenever a product has more than 30 reviews.
  • Raise the page size instead of loopingper_page accepts up to 50 and silently caps there; a larger value does not error, it just returns 50.
  • Do not expect newest-first — the order is by ID ascending, so a "latest reviews" widget must request the last page or reverse the array itself.
  • Ask for one status at a timestatus takes a single value; a moderation queue showing both pending and approved needs two calls.

Released under the MIT License.