> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rmz.gg/llms.txt
> Use this file to discover all available pages before exploring further.

# Store Reviews

> Get store-wide reviews, recent reviews, and review statistics.

These public endpoints return reviews at the store level. For product-specific reviews, see [Product Reviews](/storefront-api/products/product-reviews).

***

## GET /reviews/recent

Get recent high-rated reviews (4+ stars). Useful for homepage testimonial sections.

### Authentication

None required.

### Query Parameters

| Parameter | Type    | Required | Description                                                                                     |
| --------- | ------- | -------- | ----------------------------------------------------------------------------------------------- |
| limit     | integer | No       | Number of reviews (1-50). Default: `6`                                                          |
| type      | string  | No       | Filter by review type: `store` (order reviews) or `product` (product reviews). Default: `store` |

### Example Request

<CodeGroup>
  ```bash cURL theme={null}
  curl "https://front.rmz.gg/api/reviews/recent?limit=6&type=store"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch("https://front.rmz.gg/api/reviews/recent?limit=6&type=store");
  const data = await response.json();
  ```

  ```python Python theme={null}
  response = requests.get("https://front.rmz.gg/api/reviews/recent", params={
      "limit": 6, "type": "store"
  })
  data = response.json()
  ```

  ```php PHP theme={null}
  $response = Http::get("https://front.rmz.gg/api/reviews/recent", [
      "limit" => 6, "type" => "store"
  ]);
  $data = $response->json();
  ```
</CodeGroup>

### Response

#### Success (200)

```json theme={null}
{
  "success": true,
  "data": [
    {
      "id": 1,
      "rating": 5,
      "comment": "Amazing store with fast delivery!",
      "created_at": "2024-06-15T10:30:00.000000Z",
      "reviewer": {
        "id": 123,
        "name": "Ahmed Ali"
      },
      "product": null
    },
    {
      "id": 2,
      "rating": 4,
      "comment": "Great quality products",
      "created_at": "2024-06-14T08:15:00.000000Z",
      "reviewer": {
        "id": 456,
        "name": "Sara Mohammed"
      },
      "product": {
        "id": 101,
        "name": "Premium Game Key",
        "slug": "premium-game-key"
      }
    }
  ]
}
```

<Note>
  When `type=store`, only order-level reviews (not associated with a specific product) are returned. When `type=product`, only product-specific reviews are returned.
</Note>

***

## GET /reviews

List all published reviews with filtering, sorting, and pagination.

### Authentication

None required.

### Query Parameters

| Parameter   | Type    | Required | Description                                                            |
| ----------- | ------- | -------- | ---------------------------------------------------------------------- |
| per\_page   | integer | No       | Reviews per page (1-50). Default: `15`                                 |
| rating      | integer | No       | Filter by exact rating (1-5)                                           |
| type        | string  | No       | Filter: `store` (order reviews) or `product` (product reviews)         |
| product\_id | integer | No       | Filter by specific product ID                                          |
| sort        | string  | No       | Sort order: `newest`, `oldest`, `highest`, `lowest`. Default: `newest` |

### Example Request

<CodeGroup>
  ```bash cURL theme={null}
  curl "https://front.rmz.gg/api/reviews?sort=highest&per_page=10"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch("https://front.rmz.gg/api/reviews?sort=highest&per_page=10");
  const data = await response.json();
  ```

  ```python Python theme={null}
  response = requests.get("https://front.rmz.gg/api/reviews", params={
      "sort": "highest", "per_page": 10
  })
  data = response.json()
  ```

  ```php PHP theme={null}
  $response = Http::get("https://front.rmz.gg/api/reviews", [
      "sort" => "highest", "per_page" => 10
  ]);
  $data = $response->json();
  ```
</CodeGroup>

### Response

#### Success (200)

```json theme={null}
{
  "success": true,
  "data": [
    {
      "id": 1,
      "rating": 5,
      "comment": "Amazing store with fast delivery!",
      "created_at": "2024-06-15T10:30:00.000000Z",
      "reviewer": {
        "id": 123,
        "name": "Ahmed Ali"
      },
      "product": null
    }
  ],
  "pagination": {
    "current_page": 1,
    "last_page": 5,
    "per_page": 10,
    "total": 48,
    "from": 1,
    "to": 10,
    "has_more_pages": true,
    "next_page_url": "...",
    "prev_page_url": null
  }
}
```

***

## GET /reviews/stats

Get aggregate review statistics for the store.

### Authentication

None required.

### Query Parameters

| Parameter   | Type    | Required | Description                      |
| ----------- | ------- | -------- | -------------------------------- |
| type        | string  | No       | Filter: `store` or `product`     |
| product\_id | integer | No       | Get stats for a specific product |

### Example Request

<CodeGroup>
  ```bash cURL theme={null}
  curl "https://front.rmz.gg/api/reviews/stats"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch("https://front.rmz.gg/api/reviews/stats");
  const data = await response.json();
  ```

  ```python Python theme={null}
  response = requests.get("https://front.rmz.gg/api/reviews/stats")
  data = response.json()
  ```

  ```php PHP theme={null}
  $response = Http::get("https://front.rmz.gg/api/reviews/stats");
  $data = $response->json();
  ```
</CodeGroup>

### Response

#### Success (200)

```json theme={null}
{
  "success": true,
  "data": {
    "total_reviews": 142,
    "average_rating": 4.7,
    "rating_distribution": {
      "1": 2,
      "2": 5,
      "3": 15,
      "4": 38,
      "5": 82
    }
  }
}
```

<Tip>
  Use the `rating_distribution` to render star distribution bars on your storefront. The keys represent star counts (1-5) and the values represent the number of reviews with that rating.
</Tip>
