Skip to main content

📝 Create a Product Review

This guide explains how to create a new product review using the Alphabite Reviews Plugin.


✅ Prerequisites

  • A Medusa backend with the Reviews plugin installed and configured.
  • A product to review.
  • (Optional) Customer authentication if allowOnlyVerifiedPurchases is true.

🔨 Step-by-Step Implementation

1. Prepare Review Data

Gather the necessary information for the review:

  • product_id: The ID of the product being reviewed.
  • rating: A number between 1 and 5.
  • content: The text of the review.
  • image_base64s: (Optional) An array of base64 encoded images.
  • title: (Optional) A title for the review.

2. Send the Request

Use the SDK or REST API to create the review.

const createdReview = await sdk.alphabite.reviews.create({
product_id: "prod_...",
rating: 5,
content: "This product is amazing!",
title: "Highly Recommended",
});
API Reference

Learn more about our Medusa SDK Wrapper Alphabite Medusa SDK Wrapper 🔗

You can view the full endpoint documentation for Create Review 🔗


📝 Notes

  • Ensure the product_id is valid.
  • If allowOnlyVerifiedPurchases is true in your plugin configuration, the customer must have purchased the product to leave a review.
  • If allowMultipleReviewsPerProduct is false, a customer can only leave one review per product.
  • Image uploads are optional. If enabled, ensure images are base64 encoded.