Skip to content

pos-list-product-reviews

Method: GET
Path: /pos/catalog/products/{product_id}/reviews

Tags: POS

Summary

List all product reviews

Description

List of reviews for a specified product. The reviews are returned sorted by submission date, with the most recent reviews appearing first. You can filter the reviews by rating, reviewer, or date for more detailed analysis.

Pos SDK Usage

SDK Method: pos.listProductReviews()

Example:

typescript
const { data, error } = await pos.listProductReviews(
  { product_id: "prod_123" }
);

if (error) {
  console.error("Failed to list product reviews:", error.message);
} else {
  console.log("Reviews found:", data.reviews?.length || 0);
  data.reviews?.forEach(review => {
    console.log(`Review by ${review.customer_name}: ${review.rating}/5`);
    console.log("Comment:", review.comment);
  });
}

// With pagination
const { data: reviewData, error: reviewError } = await pos.listProductReviews(
  { product_id: "prod_123" },
  {
    page: 1,
    limit: 5
  }
);

TypeScript Definition

typescript
"pos-list-product-reviews": {
        parameters: {
            query?: {
                /** @description page number of pagination list */
                page?: components["parameters"]["pageParam"];
                /** @description no of rows per page */
                limit?: components["parameters"]["pageLimitParam"];
                /** @description JSON string format: {"field1":"asc", "field2":"desc"} */
                sort_by?: components["parameters"]["sortingParam"];
                /** @description search keyword */
                search?: components["parameters"]["searchKeyword"];
                /** @description filter review with review tag */
                review_tag?: string;
            };
            header?: never;
            path: {
                /** @description id of a particular product */
                product_id: string;
            };
            cookie?: never;
        };
        requestBody?: never;
        responses: {
            /** @description Success response */
            200: {
                headers: {
                    [name: string]: unknown;
                };
                content: {
                    "application/json": {
                        message: string;
                        success: boolean;
                        content: {
                            reviews: components["schemas"]["ProductReview"][];
                            review_tags?: string[] | null;
                            pagination?: components["schemas"]["Pagination"];
                        };
                    };
                };
            };
            401: components["responses"]["Unauthorized"];
            404: components["responses"]["NotFound"];
        };
    };

Component References

ReferenceResolves To
components["parameters"]["pageParam"]pageParam
components["parameters"]["pageLimitParam"]pageLimitParam
components["parameters"]["sortingParam"]sortingParam
components["parameters"]["searchKeyword"]searchKeyword
components["schemas"]["ProductReview"]ProductReview
components["schemas"]["Pagination"]Pagination
components["responses"]["Unauthorized"]Unauthorized
components["responses"]["NotFound"]NotFound

Parameters

  • page (query): page number of pagination list
  • limit (query): no of rows per page
  • sort_by (query): JSON string format: {"field1":"asc", "field2":"desc"}
  • search (query): search keyword
  • product_id (path): id of a particular product
  • review_tag (query): filter review with review tag

Responses

200

Success response

401

Not authorized for given operation on the Resource

404

Requested resource not found

OpenAPI Definition

json
{
  "tags": [
    "POS"
  ],
  "operationId": "pos-list-product-reviews",
  "summary": "List all product reviews",
  "description": "List of reviews for a specified product. The reviews are returned sorted by submission date, with the most recent reviews appearing first. You can filter the reviews by rating, reviewer, or date for more detailed analysis.",
  "parameters": [
    {
      "$ref": "#/components/parameters/pageParam"
    },
    {
      "$ref": "#/components/parameters/pageLimitParam"
    },
    {
      "$ref": "#/components/parameters/sortingParam"
    },
    {
      "$ref": "#/components/parameters/searchKeyword"
    },
    {
      "name": "product_id",
      "in": "path",
      "description": "id of a particular product",
      "required": true,
      "schema": {
        "type": "string"
      }
    },
    {
      "name": "review_tag",
      "in": "query",
      "description": "filter review with review tag",
      "schema": {
        "type": "string"
      }
    }
  ],
  "responses": {
    "200": {
      "description": "Success response",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "required": [
              "message",
              "success",
              "content"
            ],
            "properties": {
              "message": {
                "type": "string"
              },
              "success": {
                "type": "boolean"
              },
              "content": {
                "properties": {
                  "reviews": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/ProductReview"
                    }
                  },
                  "review_tags": {
                    "type": [
                      "array",
                      "null"
                    ],
                    "items": {
                      "type": "string"
                    }
                  },
                  "pagination": {
                    "$ref": "#/components/schemas/Pagination"
                  }
                },
                "required": [
                  "reviews"
                ],
                "type": "object"
              }
            }
          }
        }
      }
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    },
    "404": {
      "$ref": "#/components/responses/NotFound"
    }
  },
  "security": [
    {
      "Authorization": []
    }
  ],
  "x-speakeasy-group": "pos",
  "x-speakeasy-ignore": true,
  "x-speakeasy-name-override": "listProductReviews"
}

Auto-generated from OpenAPI spec and TypeScript definitions

Last updated: