Review Screen

This API is used to add and view reviews.

Product Review API

The Product Review API allows users to interact with product reviews on the e-commerce platform. It provides functionalities to add new product reviews and retrieve existing reviews for a specific product.

Review listing and adding interface

1. Add Product Review Endpoint

  • {{baseurl}}/api/v1/reviews/add

Method

  • POST

Request Body:

  • order_id: The unique identifier of the order associated with the product. This field can be used to link the review to a specific purchase.

  • product_id: The unique identifier of the product for which the review is being added.

  • review: The detailed content of the review, sharing the user's experience with the product.

  • rating: The numerical rating given by the user (e.g., 1 to 5) to represent their satisfaction with the product.

  • user_id: (Optional) The unique identifier of the user posting the review. If not provided, the API may automatically infer the user based on the authentication bearer token.

Authorization

The API requires a valid bearer token in the request header for authentication. Users must include their bearer token in the "Authorization" header of the HTTP request to add a product review successfully.

Response Format

The API responds with a JSON object indicating the success of the review submission.

2. Get Product Reviews Endpoint

  • {{baseurl}}/api/v1/product/reviews

Method

  • POST

Request Body

  • .product_id: The unique identifier of the product for which reviews are requested.

Authorization

The API requires a valid bearer token in the request header for authentication. Users must include their bearer token in the "Authorization" header of the HTTP request to add a product review successfully.

Response Format

The API responds with a JSON object containing a list of product reviews for the specified page.

Features:

  • The API allows users to submit reviews for a specific product and retrieve existing reviews for a product in a paginated manner.

  • Users can provide a rating and detailed feedback, helping other potential buyers make informed decisions.

Usage:

The Add Product Review API is used when a user wants to share their experience with a product by providing a review and rating. The Get Product Reviews API is used to display product reviews to users, promoting transparency and trust in the products offered.

Last updated