> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # CreateReview # Package: reviews # Namespace: Reviews # Method link: https://dev.wix.com/docs/api-reference/crm/community/feedback-moderation/reviews/reviews/create-review.md ## Permission Scopes: Manage Reviews: SCOPE.DC-REVIEWS.MANAGE-REVIEWS ## Introduction Creates a new review using a contact ID. This method requires a contact ID, see the [Contacts API](https://dev.wix.com/docs/rest/crm/members-contacts/contacts/contacts/introduction.md). After a review is created, it may require moderation, see the introduction for the Reviews API for more information about moderation. If the `authorName` field is empty, and the review author: - is a site member, their member name is used. - isn't a site member, the field is set to `null`. --- ## REST API ### Schema ``` Method: createReview Description: Creates a new review using a contact GUID. This method requires a contact GUID, see the [Contacts API](https://dev.wix.com/docs/rest/crm/members-contacts/contacts/contacts/introduction.md). After a review is created, it may require moderation, see the introduction for the Reviews API for more information about moderation. If the `authorName` field is empty, and the review author: - is a site member, their member name is used. - isn't a site member, the field is set to `null`. URL: https://www.wixapis.com/reviews/api/v1/reviews Method: POST # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: review, review.namespace, review.entityId, review.content, review.content.rating Method parameters: param name: review | type: Review | description: A Review object includes all of the details related to the review of an entity. An entity is a specific resource to review, for example, a store product. You can manage existing reviews, create new reviews, and retrieve reviews. Read more about [Adding and Setting Up Wix Reviews](https://support.wix.com/en/article/wix-stores-adding-and-setting-up-wix-reviews). | required: true - name: namespace | type: string | description: Review namespace. Supported values: + Wix Stores: `stores` Currently, only Wix Stores is fully integrated with the Wix Reviews app. | required: true - name: entityId | type: string | description: GUID of the entity to review. For example, a Wix Stores product GUID. | required: true - name: content | type: ReviewContent | description: Review content. | required: true - name: title | type: string | description: Review title. - name: body | type: string | description: Review body. Max: 3,000 characters - name: media | type: array | description: List of media items associated with the review. Max: 10 items - ONE-OF: - name: image | type: Image | description: Image media item. - name: id | type: string | description: WixMedia image GUID. - name: url | type: string | description: Image URL. - name: video | type: VideoV2 | description: Video media item. - name: id | type: string | description: WixMedia video GUID. - name: url | type: string | description: Video URL. - name: rating | type: integer | description: Rating of the review. Min: `1`
Max: `5` | required: true - name: author | type: Author | description: Author of the review. - name: contactId | type: string | description: Contact GUID of the author. - name: authorName | type: string | description: Display name of the author. - name: reviewDate | type: string | description: Date and time when the review was written. This should match `createdDate`, except for reviews imported from another system. Return type: CreateReviewResponse - name: review | type: Review | description: Created review. - name: namespace | type: string | description: Review namespace. Supported values: + Wix Stores: `stores` Currently, only Wix Stores is fully integrated with the Wix Reviews app. - name: entityId | type: string | description: GUID of the entity to review. For example, a Wix Stores product GUID. - name: id | type: string | description: Review GUID. - name: content | type: ReviewContent | description: Review content. - name: title | type: string | description: Review title. - name: body | type: string | description: Review body. Max: 3,000 characters - name: media | type: array | description: List of media items associated with the review. Max: 10 items - ONE-OF: - name: image | type: Image | description: Image media item. - name: id | type: string | description: WixMedia image GUID. - name: url | type: string | description: Image URL. - name: height | type: integer | description: Original image height. - name: width | type: integer | description: Original image width. - name: altText | type: string | description: Alternative text is a short phrase that describes what the image depicts. The alternative text is used: + If the browser can't display the image. + If the visitor is utilizing a screen reader. + By search engines to understand what images are on a site. - name: filename | type: string | description: Image filename. - name: video | type: VideoV2 | description: Video media item. - name: id | type: string | description: WixMedia video GUID. - name: resolutions | type: array | description: Available resolutions for the video, starting with the optimal resolution. - name: url | type: string | description: Video URL. - name: height | type: integer | description: Video height. - name: width | type: integer | description: Video width. - name: poster | type: Image | description: Video thumbnail. - name: format | type: string | description: Video format for example, mp4, hls. - name: url | type: string | description: Video URL. - name: rating | type: integer | description: Rating of the review. Min: `1`
Max: `5` - name: createdDate | type: string | description: Date and time the review was created. - name: updatedDate | type: string | description: Date and time the review was updated. - name: author | type: Author | description: Author of the review. - name: contactId | type: string | description: Contact GUID of the author. - name: authorName | type: string | description: Display name of the author. - name: reply | type: Reply | description: Reply to the review. - name: message | type: string | description: Reply content. - name: createdDate | type: string | description: Date and time the reply was created. - name: updatedDate | type: string | description: Date and time the reply was updated. - name: foundHelpful | type: integer | description: Number of site visitors who found the review helpful. - name: foundUnhelpful | type: integer | description: Number of site visitors who found the review unhelpful. - name: helpfulness | type: integer | description: Helpfulness score. Calculated by subtracting `foundUnhelpful` from `foundHelpful`. - name: moderation | type: Moderation | description: Moderation status of the review. - name: moderationStatus | type: ModerationStatus | description: - enum: - UNKNOWN: Unknown moderation status. - APPROVED: The review is approved and published. - IN_MODERATION: The review is pending moderation. Moderation can be applied in the Wix user's [dashboard](https://www.wix.com/my-account/site-selector/?buttonText=Select%20Site&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https:%2F%2Fwww.wix.com%2Fdashboard%2F%7B%7BmetaSiteId%7D%7D%2Freviews/pending). - REJECTED: The review is rejected and not visible on the site. - SUBMITTED: Initial status of the review before the moderation process. - name: manuallyChanged | type: boolean | description: Indicates whether a moderator manually changed the `moderationStatus` of the review. If the `moderationStatus` changed automatically because the review passed the moderation rules or if moderation is turned off, this field is set to `false`. - name: revision | type: string | description: Revision number, which increments by 1 each time the review is updated. To prevent conflicting changes, the current `revision` must be passed when updating the review. Ignored when creating a review. - name: verified | type: boolean | description: Whether the review has been verified. - name: origin | type: Origin | description: Origin of a review. - name: type | type: OriginType | description: Origin type. - enum: - UNKNOWN: Unknown origin type. - ORGANIC: Review was created directly by members or site visitors. - APP: Review was created through an app. Includes reviews created through an app even if the author is a member or site visitor. - name: appId | type: string | description: The app GUID of the origin for the review. Only available when the `origin.type` is `"APP"`. - name: reviewDate | type: string | description: Date and time when the review was written. This should match `createdDate`, except for reviews imported from another system. - name: relevanceScore | type: number | description: Platform-calculated score of review's relevance to the item. Used to sort reviews by relevance. - name: publishCount | type: integer | description: Number of times a review has been published. ``` ### Examples ### Create Review Creates a review and rating for an entity ```curl curl POST \ 'https://www.wixapis.com/reviews/v1/reviews' \ -H 'Content-Type: application/json;charset=UTF-8' \ -H 'Authorization: ' \ -d '{ "review": { "namespace": "stores", "entityId": "df19c1f7-07d8-a265-42f8-e8dfa824cc6e", "content": { "title": "Excellent Laptop with Great Features", "body": "This laptop excels in speed, battery life, display quality, and is great for both work and gaming.", "media": [ { "image": { "id": "344592895_182127404391791_355010341914573594_n~mv2.jpeg" } } ], "rating": 4 }, "author": { "contactId": "453faee9-8e67-45f1-87dc-f247bdf3510e", "authorName": "Joey" } } }' ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.reviews.Reviews.createReview(review) Description: Creates a new review using a contact GUID. This method requires a contact GUID, see the [Contacts API](https://dev.wix.com/docs/rest/crm/members-contacts/contacts/contacts/introduction.md). After a review is created, it may require moderation, see the introduction for the Reviews API for more information about moderation. If the `authorName` field is empty, and the review author: - is a site member, their member name is used. - isn't a site member, the field is set to `null`. # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: review, review.namespace, review.entityId, review.content, review.content.rating Method parameters: param name: review | type: Review | description: A Review object includes all of the details related to the review of an entity. An entity is a specific resource to review, for example, a store product. You can manage existing reviews, create new reviews, and retrieve reviews. Read more about [Adding and Setting Up Wix Reviews](https://support.wix.com/en/article/wix-stores-adding-and-setting-up-wix-reviews). | required: true - name: namespace | type: string | description: Review namespace. Supported values: + Wix Stores: `stores` Currently, only Wix Stores is fully integrated with the Wix Reviews app. | required: true - name: entityId | type: string | description: GUID of the entity to review. For example, a Wix Stores product GUID. | required: true - name: content | type: ReviewContent | description: Review content. | required: true - name: title | type: string | description: Review title. - name: body | type: string | description: Review body. Max: 3,000 characters - name: media | type: array | description: List of media items associated with the review. Max: 10 items - ONE-OF: - name: image | type: string | description: Image media item. - name: video | type: string | description: Video media item. - name: rating | type: integer | description: Rating of the review. Min: `1`
Max: `5` | required: true - name: author | type: Author | description: Author of the review. - name: contactId | type: string | description: Contact GUID of the author. - name: authorName | type: string | description: Display name of the author. - name: reviewDate | type: Date | description: Date and time when the review was written. This should match `createdDate`, except for reviews imported from another system. Return type: PROMISE - name: namespace | type: string | description: Review namespace. Supported values: + Wix Stores: `stores` Currently, only Wix Stores is fully integrated with the Wix Reviews app. - name: entityId | type: string | description: GUID of the entity to review. For example, a Wix Stores product GUID. - name: _id | type: string | description: Review GUID. - name: content | type: ReviewContent | description: Review content. - name: title | type: string | description: Review title. - name: body | type: string | description: Review body. Max: 3,000 characters - name: media | type: array | description: List of media items associated with the review. Max: 10 items - ONE-OF: - name: image | type: string | description: Image media item. - name: video | type: string | description: Video media item. - name: rating | type: integer | description: Rating of the review. Min: `1`
Max: `5` - name: _createdDate | type: Date | description: Date and time the review was created. - name: _updatedDate | type: Date | description: Date and time the review was updated. - name: author | type: Author | description: Author of the review. - name: contactId | type: string | description: Contact GUID of the author. - name: authorName | type: string | description: Display name of the author. - name: reply | type: Reply | description: Reply to the review. - name: message | type: string | description: Reply content. - name: _createdDate | type: Date | description: Date and time the reply was created. - name: _updatedDate | type: Date | description: Date and time the reply was updated. - name: foundHelpful | type: integer | description: Number of site visitors who found the review helpful. - name: foundUnhelpful | type: integer | description: Number of site visitors who found the review unhelpful. - name: helpfulness | type: integer | description: Helpfulness score. Calculated by subtracting `foundUnhelpful` from `foundHelpful`. - name: moderation | type: Moderation | description: Moderation status of the review. - name: moderationStatus | type: ModerationStatus | description: - enum: - UNKNOWN: Unknown moderation status. - APPROVED: The review is approved and published. - IN_MODERATION: The review is pending moderation. Moderation can be applied in the Wix user's [dashboard](https://www.wix.com/my-account/site-selector/?buttonText=Select%20Site&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https:%2F%2Fwww.wix.com%2Fdashboard%2F%7B%7BmetaSiteId%7D%7D%2Freviews/pending). - REJECTED: The review is rejected and not visible on the site. - SUBMITTED: Initial status of the review before the moderation process. - name: manuallyChanged | type: boolean | description: Indicates whether a moderator manually changed the `moderationStatus` of the review. If the `moderationStatus` changed automatically because the review passed the moderation rules or if moderation is turned off, this field is set to `false`. - name: revision | type: string | description: Revision number, which increments by 1 each time the review is updated. To prevent conflicting changes, the current `revision` must be passed when updating the review. Ignored when creating a review. - name: verified | type: boolean | description: Whether the review has been verified. - name: origin | type: Origin | description: Origin of a review. - name: type | type: OriginType | description: Origin type. - enum: - UNKNOWN: Unknown origin type. - ORGANIC: Review was created directly by members or site visitors. - APP: Review was created through an app. Includes reviews created through an app even if the author is a member or site visitor. - name: appId | type: string | description: The app GUID of the origin for the review. Only available when the `origin.type` is `"APP"`. - name: reviewDate | type: Date | description: Date and time when the review was written. This should match `createdDate`, except for reviews imported from another system. - name: relevanceScore | type: number | description: Platform-calculated score of review's relevance to the item. Used to sort reviews by relevance. - name: publishCount | type: integer | description: Number of times a review has been published. ``` ### Examples ### createReview ```javascript import { reviews } from '@wix/reviews'; async function createReview(review) { const response = await reviews.createReview(review); }; ``` ### createReview (with elevated permissions) ```javascript import { reviews } from '@wix/reviews'; import { auth } from '@wix/essentials'; async function myCreateReviewMethod(review) { const elevatedCreateReview = auth.elevate(reviews.createReview); const response = await elevatedCreateReview(review); } ``` ### createReview (self-hosted) Self-hosted SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md). ```javascript import { createClient } from '@wix/sdk'; import { reviews } from '@wix/reviews'; // Import the auth strategy for the relevant access type // Import the relevant host module if needed const myWixClient = createClient ({ modules: { reviews }, // Include the auth strategy and host as relevant }); async function createReview(review) { const response = await myWixClient.reviews.createReview(review); }; ``` ---