Shop Review
Base URL: https://api.nextgate.com/api/v1
Short Description: The Shop Review API allows users to write, manage, and retrieve reviews (text reviews+ star rating) for shops. Users canSupports create, update, anddelete, deletelisting theirwith reviews while viewing comprehensive review analyticspagination, and filteringsummary by status.statistics.
Hints:
- All
reviewendpoints use the prefixapi/v1/e-commerce/shops/reviews/{shopId} - All operations require Bearer token authentication
Users can only have oneOne review per user per shop(— use PUT to updatetoanchange)existing one- Shop owners cannot review their own shops
ReviewreviewTexttextandratingValueare both optional fields, but at least one should be providedratingValuemust be10-1–5 if providedreviewTextmust be 10–1000 characters if providedReviewsisMyReviewhaveflagstatus:isACTIVE,onlyHIDDEN,populatedFLAGGED,whenUNDER_REVIEWthe authenticated user is included in the response builder
Standard Response Format
Success Response Structure
{
"success": true,
"httpStatus": "OK",
"message": "Operation completed successfully"...",
"action_time": "2025-09-23T10:2026-05-19T10:30:45",
"data": { // Actual response data goes here
}
}
Error Response Structure
{
"success": false,
"httpStatus": "BAD_REQUEST",
"message": "Error description",
"action_time": "2025-09-23T10:30:45",
"data": "Error description"
}
Endpoints
1. Create Review (Feedback)
Purpose: Creates a new text review for a shop
Endpoint: POST {base_url}/api/v1/e-commerce/shops/reviews/{shopId}
Access Level: 🔒 Protected (Requires Bearer Token)
Authentication: Bearer Token
Path Parameters:
| Parameter | Type | Description | ||
|---|---|---|---|---|
| shopId | UUID |
Request HeadersBody:
| Type | Required | ||
|---|---|---|---|
| string | |||
Request JSON Sample:
{
"reviewText": "Amazing food and excellent service! The staff was very friendly and the atmosphere was perfect for a family dinner. Highly recommend the local dishes.",
"ratingValue": 5
}
Request Body Parameters:
Success Response JSON Sample:
{
"success": true,
"httpStatus": "OK",
"message": "ReviewFeedback createdsubmitted successfully",
"action_time": "2025-09-23T10:2026-05-19T10:30:45",
"data": {
"reviewId": "review-123e4567-e89b-12d3-a456-426614174000",
"shopId": "123e4567-456e7890-e89b-12d3-a456-426614174000"426614174001",
"shopName": "Mama Lucy's Restaurant",
"userId": "456e7890-789e0123-e89b-12d3-a456-426614174001"426614174002",
"userName": "John Doe",
"reviewText": "Amazing food and excellent service! The staff was very friendly and the atmosphere was perfect for a family dinner. Highly recommend the local dishes.",
"ratingValue": 5,
"status": "ACTIVE",
"createdAt": "2025-09-23T10:2026-05-19T10:30:45",
"updatedAt": "2025-09-23T10:2026-05-19T10:30:45",
"isMyReview": false
}
}
Error Response ExamplesResponses:
Review
400: Already Exists (400):
{
"success": false,
"httpStatus": "BAD_REQUEST",
"message": "You have already reviewed this shop.shop, Useor updateshop toowner changereviewing yourown review.",shop
"action_time"401: "2025-09-23T10:30:45",Authentication "data"required
404: "You have already reviewed this shop. Use update to change your review."
}
Shop Owner Cannot Review Own Shop (400):
{found
"success": false,
"httpStatus": "BAD_REQUEST",
"message": "Shop owners cannot review their own shops",
"action_time": "2025-09-23T10:30:45",
"data": "Shop owners cannot review their own shops"
}
2. Update Review (Feedback)
Purpose: Updates user's existing review for a shop
Endpoint: PUT {base_url}/api/v1/e-commerce/shops/reviews/{shopId}
Access Level: 🔒 Protected (Review Owner Only)
Authentication: Bearer Tokenonly)
Path Parameters:
| Parameter | Type | Description | ||
|---|---|---|---|---|
| shopId | UUID |
Request JSONBody Sample:
{as "reviewText":Create "Updated— review:all Stillfields amazing food but service could be improved. The local dishes are definitely worth trying and the prices are reasonable."
}
Request Body Parametersoptional):
| Parameter | Type | Validation | ||
|---|---|---|---|---|
| reviewText | string | Min: 10, Max: 1000 |
||
| ratingValue | integer | Min: 1, Max: 5 |
Success Response JSON Sample:
{
"success": true,
"httpStatus": "OK",
"message": "ReviewFeedback updated successfully",
"action_time": "2025-09-23T10:30:45"2026-05-19T11:15:30",
"data": {
"reviewId": "review-123e4567-e89b-12d3-a456-426614174000",
"shopId": "123e4567-456e7890-e89b-12d3-a456-426614174000"426614174001",
"shopName": "Mama Lucy's Restaurant",
"userId": "456e7890-789e0123-e89b-12d3-a456-426614174001"426614174002",
"userName": "John Doe",
"reviewText": "Updated review: Still amazing foodfood. but service could be improved. The localLocal dishes are definitely worth trying and the prices are reasonable.it.",
"ratingValue": 4,
"status": "ACTIVE",
"createdAt": "2025-09-23T10:2026-05-19T10:30:45",
"updatedAt": "2025-09-23T11:2026-05-19T11:15:30",
"isMyReview": false
}
}
Error Response ExamplesResponses:
Review
Not Found (404):
{
"success"401: 404: 3. Delete Review (Feedback)
Purpose: Soft deletes user's review for a shop
Endpoint: DELETE {base_url}/api/v1/e-commerce/shops/reviews/{shopId}
Access Level: 🔒 Protected (Review Owner Only)
Authentication: Bearer Tokenonly)
Path Parameters:
| Parameter | Type | Description | ||
|---|---|---|---|---|
| shopId | UUID |
Soft-deletes the review. Deleted reviews no longer appear in listings or counts.
Success Response JSON Sample:
{
"success": true,
"httpStatus": "OK",
"message": "ReviewFeedback deleted successfully",
"action_time": "2025-09-23T10:2026-05-19T10:30:45",
"data": null
}
Error Responses:
401: Authentication required404: Review not found
4. Get Active Reviews for Shop
Purpose: Retrieves all active reviews for a specific shop
Endpoint: GET {base_url}/api/v1/e-commerce/shops/reviews/{shopId}/active-reviews-by-shop
Access Level: 🔒 Protected (Requiresauth Authenticationrequired to showpopulate isMyReview flag)
Authentication: Bearer Token)
Path Parameters:
| Parameter | Type | Description | ||
|---|---|---|---|---|
| shopId | UUID |
Returns all ACTIVE reviews. isMyReview is set to true for the authenticated user's own review.
Success Response JSON Sample:
{
"success": true,
"httpStatus": "OK",
"message": "Shop reviewsReviews retrieved successfully",
"action_time": "2025-09-23T10:2026-05-19T10:30:45",
"data": [
{
"reviewId": "review-123e4567-e89b-12d3-a456-426614174000",
"shopId": "123e4567-e89b-12d3-a456-426614174000",
"shopName": "Mama Lucy's Restaurant",
"userId": "456e7890-e89b-12d3-a456-426614174001",
"userName": "John Doe",
"reviewText": "Amazing food and excellent service!",
"status": "ACTIVE",
"createdAt": "2025-09-23T10:30:45",
"updatedAt": "2025-09-23T10:30:45",
"isMyReview": true
},
{
"reviewId": "review-456e7890-e89b-12d3-a456-426614174001",
"shopId": "123e4567-e89b-12d3-a456-426614174000",
"shopName": "Mama Lucy's Restaurant",
"userId": "789e0123-e89b-12d3-a456-426614174002",
"userName": "JaneJohn Smith"Doe",
"reviewText": "GreatAmazing local dishes, very authentic taste!food!",
"ratingValue": 5,
"status": "ACTIVE",
"createdAt": "2025-09-22T15:20:30"2026-05-19T10:30:45",
"updatedAt": "2025-09-22T15:20:30"2026-05-19T10:30:45",
"isMyReview": falsetrue
}
]
}
Error Responses:
401: Authentication required404: Shop not found
5. Get Active Reviews for Shop (Paginated)
Purpose: Retrieves active reviews for a shop with pagination
Endpoint: GET {base_url}/api/v1/e-commerce/shops/reviews/{shopId}/paged
Access Level: 🔒 Protected (Requires Authentication)
Authentication: Bearer Token
Path Parameters:
Query Parameters:
| Parameter | Description | ||||
|---|---|---|---|---|---|
| page | Page number (1-based) | ||||
| size |
Success Response JSON Sample:
{
"success": true,
"httpStatus": "OK",
"message": "Shop reviewsReviews retrieved successfully",
"action_time": "2025-09-23T10:2026-05-19T10:30:45",
"data": {
"reviews": [
{
"reviewId": "review-123e4567-e89b-12d3-a456-426614174000",
"shopId": "123e4567-e89b-12d3-a456-426614174000",
"shopName": "Mama Lucy's Restaurant",
"userName": "John Doe",
"reviewText": "Amazing food and excellent service!food!",
"ratingValue": 5,
"status": "ACTIVE",
"createdAt": "2025-09-23T10:2026-05-19T10:30:45",
"isMyReview": true
}
],
"currentPage": 1,
"pageSize": 10,
"totalElements": 25,
"totalPages": 3,
"hasNext": true,
"hasPrevious": false,
"isFirst": true,
"isLast": false
}
}
Error Responses:
401: Authentication required404: Shop not found
6. Get My Review for Shop
Purpose: Retrieves authenticated user's review for a specific shop
Endpoint: GET {base_url}/api/v1/e-commerce/shops/reviews/{shopId}/my-review
Access Level: 🔒 Protected
Returns Userthe Only)authenticated user's review for the shop, or null if they haven't reviewed it yet.
Authentication: Bearer Token
Path Parameters:
Success Response JSON Sample (has review):
{
"success": true,
"httpStatus": "OK",
"message": "Your reviewfeedback retrieved successfully",
"action_time": "2025-09-23T10:30:45",
"data": {
"reviewId": "review-123e4567-e89b-12d3-a456-426614174000",
"shopId": "123e4567-456e7890-e89b-12d3-a456-426614174000"426614174001",
"shopName": "Mama Lucy's Restaurant",
"userId": "456e7890-789e0123-e89b-12d3-a456-426614174001"426614174002",
"userName": "John Doe",
"reviewText": "Amazing food and excellent service!food!",
"ratingValue": 5,
"status": "ACTIVE",
"createdAt": "2025-09-23T10:2026-05-19T10:30:45",
"updatedAt": "2025-09-23T10:2026-05-19T10:30:45",
"isMyReview": false
}
}
Success Response (Nowhen Reviewno Found)review exists:
{
"success": true,
"httpStatus": "OK",
"message": "Your reviewfeedback retrieved successfully",
"action_time": "2025-09-23T10:30:45",
"data": null
}
7. Get Shop Review Summary
Purpose: Retrieves comprehensive review statistics for a shop by status
Endpoint: GET {base_url}/api/v1/e-commerce/shops/reviews/{shopId}/summary-shop-reviewsummary
Access Level: 🌐 Public
Returns authenticationaggregated required)rating and review counts for a shop.
Authentication: None
Path Parameters:
Success Response JSON Sample:
{
"success": true,
"httpStatus": "OK",
"message": "Shop reviewfeedback summary retrieved successfully",
"action_time": "2025-09-23T10:30:45",
"data": {
"shopId": "123e4567-456e7890-e89b-12d3-a456-426614174000"426614174001",
"shopName": "Mama Lucy's Restaurant",
"totalReviews"averageRating": 4.5,
"totalRatings": 25,
"ratingDistribution": { "1": 1, "2": 2, "3": 5, "4": 7, "5": 10 },
"totalReviews": 15,
"activeReviews": 22,12,
"hiddenReviews": 2,
"flaggedReviews": 1
}
}
Success Response Fields:
DataQuick ModelsReference
Review StatusReviewStatus Enum
| Value | Description |
|---|---|
ACTIVE |
|
HIDDEN |
|
FLAGGED |
|
UNDER_REVIEW |
ReviewResponse Business Rules
Review Creation RulesFields
Users
must
beField
authenticatedType
toDescription
create
reviews
One
reviewId
UUID
Unique review perID
shopId
UUID
Shop that was reviewed
shopName
string
Shop name
userId
UUID
Reviewer's user perID
shop
(use
updateuserName
tostring
modify)Reviewer's Shopdisplay ownersname
cannot
review
theirreviewText
ownstring
shops
Cannot review deleted shops
Review text mustcontent
be
10-1000
charactersratingValue
Newinteger
reviewsStar defaultrating to(1–5), ACTIVEnullable
status
ReviewStatus
Review Update Rules
OnlyCurrent review ownerstatus
can
createdAt
LocalDateTime
Creation timestamp
updatedAt
LocalDateTime
Last update theirtimestamp
review
Must
haveisMyReview
existingboolean
review to update
Same validation rules apply as creation
Updates set new updatedAt timestamp
Review Deletion Rules
Only review owner can delete their review
Soft delete (sets isDeleted = true)
Deleted reviews don't appear in listings or counts
Review Status Rules
Only ACTIVE reviews appear in public listings
All statuses count in summary statistics
isMyReview flag showsTrue if reviewthis belongsis tothe current useruser's review
Error
Types
Standard Error Codes
-
Code
Meaning
400
BAD_REQUEST: Business logicrule violations,violation already(duplicate existsreview, - owner self-review)
401
UNAUTHORIZED:Authentication Invalid/missingrequired
token
404
NOT_FOUND:Shop Shop/or review not found,found
user
not
authenticated
422
UNPROCESSABLE_ENTITY:Field Validationvalidation errors
Validation
Error
Example
| Field | Type | Description |
|---|---|---|
| reviewId | UUID | Unique review |
| shopId | UUID | Shop that was reviewed |
| shopName | string | Shop name |
| userId | UUID | Reviewer's user |
| userName | string | Reviewer's |
| reviewText | string | Review text |
| ratingValue | integer | Star |
| status | ReviewStatus | Current review |
| createdAt | LocalDateTime | Creation timestamp |
| updatedAt | LocalDateTime | Last update |
| isMyReview | boolean | True if |
Standard Error Codes
-
Code Meaning 400BAD_REQUEST:Business logicruleviolations,violationalready(duplicateexistsreview,- owner self-review)
401UNAUTHORIZED:Authentication Invalid/missingrequiredtoken404NOT_FOUND:Shop Shop/or review notfound,foundusernotauthenticated422UNPROCESSABLE_ENTITY:Field Validationvalidation errorsValidationError
{
"success": false,
"httpStatus": "UNPROCESSABLE_ENTITY",
"message": "Validation failed",
"action_time": "2025-09-23T10:30:45",
"data": {
"reviewText": "Review must be between 10 and 1000 characters"
}
}