{
"rating": 3,
"customerId": "01FYM6EDTRC0270J2TRXHQ1EZX",
"customerName": "Test Customer",
"reviewTitle": "My review",
"review": "3 stars"
}
Customers are able to submit ratings and reviews for products and variants. They can also view, edit and delete their reviews.
Send a POST request to /product/{productId}
to post a new rating for a product.
Send a POST request to /product/{productId}/variant/{variantId}
to post a new rating for a variant.
The body of the request should be a RatingRequest. Not all fields are required.
Here is an example of a typical add request:
{
"rating": 3,
"customerId": "01FYM6EDTRC0270J2TRXHQ1EZX",
"customerName": "Test Customer",
"reviewTitle": "My review",
"review": "3 stars"
}
This module supports ratings by anonymous customers, but that feature is disabled by default.
To enable ratings by anonymous customers, set the property broadleaf.ratings.service.allow-anonymous-rating=true
.
Ratings by anonymous customers cannot be updated or deleted by the customer.
Send a PUT or PATCH request to /customer/{customerId}/rating-detail/{detailId}
to update an existing RatingDetail.
After an update, the status is changed back to PENDING if there is review or title text.
The request for an update is nearly the same as an add. Not all fields are required. However, the fields in the example below will be updated, so omitting a parameter or sending null would result in the RatingDetail field being updated to null.
{
"rating": 5,
"customerName": "Test Customer",
"reviewTitle": "My review",
"review": "My updated review"
}