Skip to content

Create Product Review

Submit a new review and rating for a product. Reviews are typically pending approval before being displayed.

Endpoint

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

Request Headers

HeaderRequiredDescription
Content-TypeYesapplication/json
X-STOREFRONT-KEYYesYour storefront API key
AuthorizationYesBearer token (customer login required)

Path Parameters

ParameterTypeRequiredDescription
productIdintegerYesProduct ID being reviewed

Request Body

json
{
  "title": "string",
  "comment": "string",
  "rating": "integer (1-5)",
  "authorName": "string",
  "authorEmail": "string"
}
FieldTypeRequiredDescription
titlestringYesReview title (max 255 characters)
commentstringYesReview content/comment (min 10 characters)
ratingintegerYesRating (1=Poor, 5=Excellent)
authorNamestringNoReviewer name (defaults to customer name)
authorEmailstringNoReviewer email (defaults to customer email)

Response Fields (201 Created)

FieldTypeDescription
idintegerReview ID
productIdintegerProduct ID
titlestringReview title
commentstringReview content
ratingintegerStar rating
authorNamestringReviewer name
authorEmailstringReviewer email
statusstringReview status (pending, approved, rejected)
createdAtstringCreation timestamp

Use Cases

  • Allow customers to submit product reviews
  • Collect product feedback and ratings
  • Build social proof on product pages
  • Moderate reviews before publishing
  • Track customer satisfaction

Rules

  • Customer must be authenticated
  • One review per customer per product recommended
  • Reviews require approval before display
  • Minimum comment length: 10 characters
  • Rating must be 1-5 stars

Released under the MIT License.