Get Product Reviews
Retrieve reviews for a specific product.
Updated
On this page
Overview
Fetch reviews for a specific product, or list all approved reviews across your store.
Product Reviews
import dash from "@/lib/dash"
const { reviews, stats, pagination } = await dash.products.getReviews("blue-dream", {
limit: 10,
offset: 0,
})
// stats = { avg_rating: 4.7, total: 42 }
// reviews = [{ id, rating, title, body, author_name, created_at, ... }]
All Store Reviews
const { reviews, avg_rating, total, pagination } = await dash.products.getAllReviews({
limit: 20,
sort: "newest", // "newest" | "highest" | "lowest"
rating: 5, // filter by star rating
has_media: true, // only reviews with photos
})
Review Object
{
"id": "rev_abc123",
"product_id": "prod_xyz",
"rating": 5,
"title": "Amazing quality",
"body": "This is the best product I've tried...",
"author_name": "John D.",
"verified_purchase": true,
"helpful_count": 12,
"media_urls": ["https://cdn.dashfordevs.com/review-photo.jpg"],
"variation_slug": "blue-dream",
"created_at": "2025-01-10T08:00:00Z"
}
Reviews Section Example
// components/ProductReviews.tsx
import dash from "@/lib/dash"
export default async function ProductReviews({ slug }: { slug: string }) {
const { reviews, stats } = await dash.products.getReviews(slug)
return (
<section>
<h2>Customer Reviews</h2>
<div>
<span>{stats.avg_rating.toFixed(1)} / 5</span>
<span>({stats.total} reviews)</span>
</div>
{reviews.map(review => (
<div key={review.id} className="border-b py-4">
<div className="flex items-center gap-2">
<span>{"★".repeat(review.rating)}{"☆".repeat(5 - review.rating)}</span>
{review.verified_purchase && <span className="text-green-500 text-sm">Verified</span>}
</div>
<h3 className="font-semibold">{review.title}</h3>
<p>{review.body}</p>
<p className="text-sm text-gray-400">
{review.author_name} · {new Date(review.created_at).toLocaleDateString()}
</p>
</div>
))}
</section>
)
}
REST API
# Product reviews
GET /storefront/products/blue-dream/reviews?limit=10
X-API-Key: pk_live_your_key
# All store reviews
GET /storefront/reviews?limit=20&sort=newest
X-API-Key: pk_live_your_key
Next Steps
- Submit Review — Let customers write reviews
- Get Product by Slug — Full product details