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

# Get Product Review Statistics

> Endpoint to retrieve aggregated rating statistics for a specific product

```bash Request Example theme={null}
curl --request GET 'https://api.mayar.id/hl/v2/products/e2b3f5d5-0c62-47ba-8a01-6c1c209e0f77/reviews/stats' \
--header 'Authorization: Bearer Paste-Your-API-Key-Here'
```

```json Response Example 200 theme={null}
{
    "statusCode": 200,
    "messages": "success",
    "data": {
        "total": 10,
        "average": 4.6,
        "stats": [
            { "rating": 5, "percentage": 70, "totalRating": 7 },
            { "rating": 4, "percentage": 20, "totalRating": 2 },
            { "rating": 3, "percentage": 10, "totalRating": 1 },
            { "rating": 2, "percentage": 0, "totalRating": 0 },
            { "rating": 1, "percentage": 0, "totalRating": 0 }
        ]
    }
}
```

Endpoint:

```Production Production theme={null}
https://api.mayar.id/hl/v2/products/{paymentLinkId}/reviews/stats
```

```Sandbox Sandbox theme={null}
https://api.mayar.io/hl/v2/products/{paymentLinkId}/reviews/stats
```

## Authorization

**Authorization** `string` *required*

Example:

`Authorization | Bearer Paste-Your-Api-Key-Here`

## Path Parameters

**paymentLinkId** `string\<uuid\>` *required*

ID of the payment link / product whose rating statistics you want to retrieve.

> [!NOTE]
>
> Statistics count only `ACTIVE` reviews. When the product has no active reviews, `data` is
> returned as an empty object (`{}`).

## Response

Successful Response

### Main Structure (Root)

**statusCode** `integer`

Status code returned by the API.

**messages** `string`

Status message that describes the API response.

**data** `object`

Aggregated rating statistics for the product. Empty object when there are no active reviews.

### data Structure (Object)

**total** `number`

Total number of active reviews for the product.

**average** `number`

Average rating across all active reviews, rounded to one decimal place.

**stats** `array of object`

Per-rating breakdown, one entry for each rating from 5 down to 1.

**stats.rating** `number`

Rating value (1–5) this breakdown entry refers to.

**stats.percentage** `number`

Percentage of total reviews that gave this rating.

**stats.totalRating** `number`

Number of reviews that gave this rating.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.