Setup

To use the Reviews API, install the @wix/reviews package using npm or Yarn:

Copy
1
npm install @wix/reviews

or

Copy
1
yarn add @wix/reviews

Then import { reviews } from @wix/reviews:

Copy
1
import { reviews } from '@wix/reviews'
Was this helpful?
Yes
No

createReview( )

Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Creates a review.

The createReview() function returns a promise that resolves to the created review.

This function requires a contactId.

If the review author does not have a contact ID, use createReviewAndContact().

If authorName is left empty, the member's name will be used. If the author is not a member, the field is left null.

Permission Scopes

For app development, you must have one of the following permission scopes:
Manage Reviews
Learn more about permission scopes.
Copy
function createReview(review: Review): Promise<Review>
Method Parameters
reviewReviewRequired
Review data.
Returns
Return Type:Promise<Review>
Was this helpful?
Yes
No

deleteReview( )

Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Deletes a review.

The deleteReview() function returns a promise that resolves to the deleted review.

Permission Scopes

For app development, you must have one of the following permission scopes:
Manage Reviews
Learn more about permission scopes.
Copy
function deleteReview(reviewId: string): Promise<DeleteReviewResponse>
Method Parameters
reviewIdstringRequired
Review ID.
Returns
Return Type:Promise<DeleteReviewResponse>
Was this helpful?
Yes
No

getReview( )

Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Retrieves a review.

The getReview() function returns a Promise that resolves to the retrieved review.

By default, an unpublished review is not returned. To retrieve an unpublished review, pass returnPrivateReviews as true.

Permission Scopes

For app development, you must have one of the following permission scopes:
Manage Bookings Services and Settings
Read reviews
Manage Reviews
Learn more about permission scopes.
Copy
function getReview(reviewId: string, options: GetReviewOptions): Promise<Review>
Method Parameters
reviewIdstringRequired
Review ID.

optionsGetReviewOptions
Information about the reviews to retrieve.
Returns
Return Type:Promise<Review>
Was this helpful?
Yes
No

queryReviews( )

Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Creates a query to retrieve a list of reviews.

The queryReviews() function builds a query to retrieve a list of reviews and returns a ReviewsQueryBuilder object.

The returned object contains the query definition, which is typically used to run the query using the find() function.

You can refine the query by chaining ReviewsQueryBuilder functions onto the query.

ReviewsQueryBuilder functions enable you to sort, filter, and control the results that queryReviews() returns.

The queryReviews() function runs with the following defaults, which you can override:

  • ascending("_createdDate")
  • limit(100)

The functions that are chained to queryReviews() are applied in the order they're called. For example, if you apply descending("_createdDate") and then descending("content.rating"), the results are sorted first by the _createdDate, and then, if there are multiple results with the same _createdDate, the items are sorted by content.rating.

PROPERTYSUPPORTED FILTERS & SORTING
namespaceeq(),ne(),in()
_ideq(),ne(),in()
content.ratingeq(),ne(),in(),lt(),le(),gt(),ge(),ascending(),descending()
_createdDateeq(),ne(),in(),lt(),le(),gt(),ge(),ascending(),descending()
helpfulnesseq(),ne(),in(),lt(),le(),gt(),ge(),ascending(),descending()
moderation.moderationStatuseq(),ne(),in()

Permission Scopes

For app development, you must have one of the following permission scopes:
Manage Bookings Services and Settings
Read reviews
Manage Reviews
Learn more about permission scopes.
Copy
function queryReviews(options: QueryReviewsOptions): ReviewsQueryBuilder
Method Parameters
optionsQueryReviewsOptions
Information about the reviews to retrieve.
Returns
Return Type:ReviewsQueryBuilder
Was this helpful?
Yes
No

updateReview( )

Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Updates a review.

The updateReview() function returns a promise that resolves to the updated review.

Each time the review is updated, revision increments by 1. The existing revision must be included when updating the review. This ensures you're working with the latest review information, and it prevents unintended overwrites.

This function is not a universal function and runs only on the backend.

Permission Scopes

For app development, you must have one of the following permission scopes:
Manage Reviews
Learn more about permission scopes.
Copy
function updateReview(_id: string, review: UpdateReview): Promise<Review>
Method Parameters
_idstringRequired
Review ID.

reviewUpdateReviewRequired
Review to update.
Returns
Return Type:Promise<Review>
Was this helpful?
Yes
No