Skip to content

Product Reviews Endpoint

TIP

Refer to products page for Base URL

* Add Product Review

Endpoint: POST

products/review/

Request Headers

AuthorizationValueDescriptionRequired
Bearer*******Firebase access token✔️

Payload Description

NameTypeDescriptionRequired
productIduuidproduct id✔️
commentstringuser comment about product
userNamestringauthenticated user displayName✔️
ratingfloat in string formeg. 3.0

Sample Payload

{
  "comment": "Nice",
  "userName": "sam",
  "productId": "ba3cb694-c2ff-41cf-82d4-49eb63a81dc2",
  "rating": "4.0",
}

Sample Response

{
  "id": "eefdbddc-c79a-4c92-88f8-31b60b2123ed",
  "userId": "gxxjx22P3eNvGjvenIkvCjEkxh63",
  "comment": "Just a review",
  "userName": "Sam",
  "dateCreated": "2023-08-05T14:34:54.712934Z",
  "rating": "3.0",
  "productId": "ba3cb694-c2ff-41cf-82d4-49eb63a81dc2"
}

* List Product Reviews

Get all the reviews for a particular product

Endpoint: GET

products/reviews/product_id

Parameters

NameTypeDescriptionRequired
product_iduuidproduct id✔️

Sample Request

products/reviews/ba3cb694-c2ff-41cf-82d4-49eb63a81dc2

Sample Response

{
  "count": 10,
  "next": null,
  "previous": null,
  "results": [
    {
        "id": "eefdbddc-c79a-4c92-88f8-31b60b2123ed",
        "userId": "gxxjx22P3eNvGjvenIkvCjEkxh63",
        "comment": "Just a review",
        "userName": "Sam",
        "dateCreated": "2023-08-05T14:34:54.712934Z",
        "rating": "3.0",
        "productId": "ba3cb694-c2ff-41cf-82d4-49eb63a81dc2"
    },
  ]
}

Released under the MIT License.