> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> 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`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# CreateReviewRequest

# Package: reviews

# Namespace: ReviewRequestsV2

# Method link: https://dev.wix.com/docs/api-reference/crm/community/feedback-moderation/reviews/review-requests/create-review-request.md

## Permission Scopes:
Manage Review Requests: SCOPE.DC_REVIEWS.MANAGE-REVIEW_REQUESTS

## Introduction

Creates a new review request.

A review request is a request sent to a customer to solicit a review for a specific order or specific items.
This method requires either the `order.id` or `items.catalogItemId`.

You must pass either an order ID or at least 1 item ID:
+ **Order ID only:** The review request automatically includes the 5 most expensive items from the order.
+ **Item IDs only:** The review request includes only the specified items.
+ **Order ID and item IDs:** The review request includes the specified items from the given order.

---

## REST API

### Schema

```
 Method: createReviewRequest
 Description: Creates a new review request.  A review request is a request sent to a customer to solicit a review for a specific order or specific items. This method requires either the `order.id` or `items.catalogItemId`.  You must pass either an order GUID or at least 1 item GUID: + **Order GUID only:** The review request automatically includes the 5 most expensive items from the order. + **Item GUIDs only:** The review request includes only the specified items. + **Order GUID and item GUIDs:** The review request includes the specified items from the given order.
 URL: https://www.wixapis.com/reviews/v2/review-requests
 Method: POST
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  reviewRequest, reviewRequest.communicationChannel
 Method parameters: 
   param name: reviewRequest | type: ReviewRequest | description: A review request is a request sent to a customer to solicit a review for a specific order or specific items. | required: true 
    - ONE-OF: - required: true
        - name: sendDate | type: string | description: Date and time the review request was, or will be, sent. This field is only informational and does not trigger a send action.  | validation: format date-time, immutable
        - name: namespace | type: string | description: Name of the Wix app whose catalog the items being reviewed belong to.  Supported values: + Wix Stores: `stores`  Currently, only Wix Stores is fully integrated with the Wix Reviews app.  | validation: minLength 1, maxLength 100, immutable
        - name: order | type: Order | description: Order that a review is requested for.  | validation: immutable
           - name: id | type: string | description: Order GUID.  | validation: format GUID
        - name: items | type: array<Item> | description: Items that a review is requested for.  | validation: maxItems 5, immutable
           - name: catalogItemId | type: string | description: GUID of the item within the catalog it belongs to.  For example, `product.id` for items from the Stores Catalog API.  | validation: minLength 1, maxLength 36, immutable
        - name: recipient | type: Recipient | description: Customer to send a review request to.  | validation: immutable
           - name: contactId | type: string | description: Recipient contact GUID. See the Contacts API for more information.  | validation: format GUID, immutable
        - name: communicationChannel | type: CommunicationChannel | description: Communication channel for sending the review request. | required: true | validation: immutable
             - enum: EMAIL
        - name: automationActivationId | type: string | description: GUID of the automation action that triggered the review request to be created.  This field is only used if a review request was created by the [automation included with Wix Reviews](https://support.wix.com/en/article/wix-stores-adding-and-setting-up-wix-reviews#step-3-optional-customize-review-requests). Also see the Automations API for more information.  | validation: format GUID, immutable
 Return type: CreateReviewRequestResponse
  - name: reviewRequest | type: ReviewRequest | description: Created review request.  
     - ONE-OF: 
        - name: sentOptions | type: SentOptions | description: Info if `status` is `SENT`.  | read-only: true 
           - name: opened | type: boolean | description: Whether the recipient opened the review request email.  
        - name: failedOptions | type: FailedOptions | description: Info if `status` is `FAILED`.  | read-only: true 
           - name: reason | type: FailureReason | description: Reason review request `status` is `FAILED`.  
                 - enum:
                 -     UNKNOWN_FAILURE_REASON: Unknown reason for review request failure.
                 -     ACTIVATION_FAILED: Review request failed due to a failure in the activation flow.
                 -     BOUNCED: Email bounced.
                 -     SUBSCRIPTION_INACTIVE: Review request failed because `deliverabilityStatus` is set to `inactiveSubscription` in the recipient's contact information.
           - name: message | type: string | description: Error message for review request failure.  | validation: maxLength 1000
     - name: id | type: string | description: Review request GUID.  | read-only: true | validation: format GUID
     - name: revision | type: string | description: Revision number, which increments by 1 each time the review request is updated. To prevent conflicting changes, the current revision must be passed when updating the review request.  Ignored when creating a review request.  | read-only: true | validation: format int64
     - name: createdDate | type: string | description: Date and time the review request was created.  | read-only: true | validation: format date-time
     - name: updatedDate | type: string | description: Date and time the review request was last updated.  | read-only: true | validation: format date-time
     - name: sendDate | type: string | description: Date and time the review request was, or will be, sent. This field is only informational and does not trigger a send action.  | validation: format date-time, immutable
     - name: namespace | type: string | description: Name of the Wix app whose catalog the items being reviewed belong to.  Supported values: + Wix Stores: `stores`  Currently, only Wix Stores is fully integrated with the Wix Reviews app.  | validation: minLength 1, maxLength 100, immutable
     - name: order | type: Order | description: Order that a review is requested for.  | validation: immutable
        - name: id | type: string | description: Order GUID.  | validation: format GUID
     - name: items | type: array<Item> | description: Items that a review is requested for.  | validation: maxItems 5, immutable
        - name: catalogItemId | type: string | description: GUID of the item within the catalog it belongs to.  For example, `product.id` for items from the Stores Catalog API.  | validation: minLength 1, maxLength 36, immutable
        - name: reviewId | type: string | description: GUID of the review created for this item by the review request recipient.  | read-only: true | validation: format GUID
     - name: recipient | type: Recipient | description: Customer to send a review request to.  | validation: immutable
        - name: contactId | type: string | description: Recipient contact GUID. See the Contacts API for more information.  | validation: format GUID, immutable
     - name: communicationChannel | type: CommunicationChannel | description: Communication channel for sending the review request.  | validation: immutable
         - enum: EMAIL
     - name: status | type: ReviewRequestStatus | description: Review request status.  | read-only: true 
         - enum:
         -     UNKNOWN_REVIEW_REQUEST_STATUS: Unknown review request status.
         -     SCHEDULED: Review request scheduled.
         -     CANCELED: Review request canceled.
         -     FAILED: Review request failed to send.
         -     SENT: Review request sent.
     - name: automationActivationId | type: string | description: GUID of the automation action that triggered the review request to be created.  This field is only used if a review request was created by the [automation included with Wix Reviews](https://support.wix.com/en/article/wix-stores-adding-and-setting-up-wix-reviews#step-3-optional-customize-review-requests). Also see the Automations API for more information.  | validation: format GUID, immutable
     - name: requestedBy | type: IdentificationData | description: GUID of the user or app that generated the review request.  | read-only: true 
        - ONE-OF: 
           - name: wixUserId | type: string | description: Wix user GUID.  | validation: format GUID
           - name: appId | type: string | description: Wix app GUID.  | validation: format GUID
        - name: identityType | type: IdentityType | description: Identity type.  | read-only: true 
             - enum: WIX_USER, APP

 Possible Errors:
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: EITHER_ORDER_OR_ITEMS_REQUIRED | Description: Must specify either the `order.id` or at least 1 `items.catalogItemId`.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: ORDER_NOT_FOUND | Description: Couldn't find the order.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: ORDER_IS_EMPTY | Description: Order has no items.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: INITIATOR_IDENTITY_NOT_SUPPORTED | Description: The [identity](https://dev.wix.com/docs/api-reference/articles/authentication/about-identities.md) used to call the method isn't supported for creating review requests.


```

### Examples

### Create Review Request
```curl
curl -X POST \
  'https://www.wixapis.com/reviews/v2/review-requests'  \
  -H 'Content-Type: application/json;charset=UTF-8' \
  -H 'Authorization: <AUTH>' \
  -d '{
    "reviewRequest":
        {
          "sendDate": "2024-08-21T06:44:38.231Z",
          "namespace": "stores",
          "order": {
            "id": "6f4770fc-b8ee-4bf2-9977-d048a7f27987"
          },
          "items": [
            {
              "catalogItemId": "cd59cd36-b6d2-2cf3-9d48-81793a7bdbbd"
            }
          ],
          "recipient": {
            "contactId": "8d141741-5caf-455b-9775-64b64119fa9a"
          },
          "communicationChannel": "EMAIL",
          "automationActivationId": "73fff183-acf3-4770-b527-f65f9f10d5f6"
        }
    }'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.reviews.reviewRequests.createReviewRequest(reviewRequest)
 Description: Creates a new review request.  A review request is a request sent to a customer to solicit a review for a specific order or specific items. This method requires either the `order.id` or `items.catalogItemId`.  You must pass either an order GUID or at least 1 item GUID: + **Order GUID only:** The review request automatically includes the 5 most expensive items from the order. + **Item GUIDs only:** The review request includes only the specified items. + **Order GUID and item GUIDs:** The review request includes the specified items from the given order.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  reviewRequest, reviewRequest.communicationChannel
 Method parameters: 
   param name: reviewRequest | type: ReviewRequest | description: A review request is a request sent to a customer to solicit a review for a specific order or specific items. | required: true 
    - ONE-OF: - required: true
        - name: sendDate | type: Date | description: Date and time the review request was, or will be, sent. This field is only informational and does not trigger a send action.  | validation: immutable
        - name: namespace | type: string | description: Name of the Wix app whose catalog the items being reviewed belong to.  Supported values: + Wix Stores: `stores`  Currently, only Wix Stores is fully integrated with the Wix Reviews app.  | validation: minLength 1, maxLength 100, immutable
        - name: order | type: Order | description: Order that a review is requested for.  | validation: immutable
           - name: _id | type: string | description: Order GUID.  | validation: format GUID
        - name: items | type: array<Item> | description: Items that a review is requested for.  | validation: maxItems 5, immutable
           - name: catalogItemId | type: string | description: GUID of the item within the catalog it belongs to.  For example, `product.id` for items from the Stores Catalog API.  | validation: minLength 1, maxLength 36, immutable
        - name: recipient | type: Recipient | description: Customer to send a review request to.  | validation: immutable
           - name: contactId | type: string | description: Recipient contact GUID. See the Contacts API for more information.  | validation: format GUID, immutable
        - name: communicationChannel | type: CommunicationChannel | description: Communication channel for sending the review request. | required: true | validation: immutable
             - enum: EMAIL
        - name: automationActivationId | type: string | description: GUID of the automation action that triggered the review request to be created.  This field is only used if a review request was created by the [automation included with Wix Reviews](https://support.wix.com/en/article/wix-stores-adding-and-setting-up-wix-reviews#step-3-optional-customize-review-requests). Also see the Automations API for more information.  | validation: format GUID, immutable
 Return type: PROMISE<ReviewRequest>
  - ONE-OF: 
     - name: sentOptions | type: SentOptions | description: Info if `status` is `SENT`.  | read-only: true 
        - name: opened | type: boolean | description: Whether the recipient opened the review request email.  
     - name: failedOptions | type: FailedOptions | description: Info if `status` is `FAILED`.  | read-only: true 
        - name: reason | type: FailureReason | description: Reason review request `status` is `FAILED`.  
             - enum:
             -     UNKNOWN_FAILURE_REASON: Unknown reason for review request failure.
             -     ACTIVATION_FAILED: Review request failed due to a failure in the activation flow.
             -     BOUNCED: Email bounced.
             -     SUBSCRIPTION_INACTIVE: Review request failed because `deliverabilityStatus` is set to `inactiveSubscription` in the recipient's contact information.
        - name: message | type: string | description: Error message for review request failure.  | validation: maxLength 1000
  - name: _id | type: string | description: Review request GUID.  | read-only: true | validation: format GUID
  - name: revision | type: string | description: Revision number, which increments by 1 each time the review request is updated. To prevent conflicting changes, the current revision must be passed when updating the review request.  Ignored when creating a review request.  | read-only: true | validation: format int64
  - name: _createdDate | type: Date | description: Date and time the review request was created.  | read-only: true 
  - name: _updatedDate | type: Date | description: Date and time the review request was last updated.  | read-only: true 
  - name: sendDate | type: Date | description: Date and time the review request was, or will be, sent. This field is only informational and does not trigger a send action.  | validation: immutable
  - name: namespace | type: string | description: Name of the Wix app whose catalog the items being reviewed belong to.  Supported values: + Wix Stores: `stores`  Currently, only Wix Stores is fully integrated with the Wix Reviews app.  | validation: minLength 1, maxLength 100, immutable
  - name: order | type: Order | description: Order that a review is requested for.  | validation: immutable
     - name: _id | type: string | description: Order GUID.  | validation: format GUID
  - name: items | type: array<Item> | description: Items that a review is requested for.  | validation: maxItems 5, immutable
     - name: catalogItemId | type: string | description: GUID of the item within the catalog it belongs to.  For example, `product.id` for items from the Stores Catalog API.  | validation: minLength 1, maxLength 36, immutable
     - name: reviewId | type: string | description: GUID of the review created for this item by the review request recipient.  | read-only: true | validation: format GUID
  - name: recipient | type: Recipient | description: Customer to send a review request to.  | validation: immutable
     - name: contactId | type: string | description: Recipient contact GUID. See the Contacts API for more information.  | validation: format GUID, immutable
  - name: communicationChannel | type: CommunicationChannel | description: Communication channel for sending the review request.  | validation: immutable
     - enum: EMAIL
  - name: status | type: ReviewRequestStatus | description: Review request status.  | read-only: true 
     - enum:
     -     UNKNOWN_REVIEW_REQUEST_STATUS: Unknown review request status.
     -     SCHEDULED: Review request scheduled.
     -     CANCELED: Review request canceled.
     -     FAILED: Review request failed to send.
     -     SENT: Review request sent.
  - name: automationActivationId | type: string | description: GUID of the automation action that triggered the review request to be created.  This field is only used if a review request was created by the [automation included with Wix Reviews](https://support.wix.com/en/article/wix-stores-adding-and-setting-up-wix-reviews#step-3-optional-customize-review-requests). Also see the Automations API for more information.  | validation: format GUID, immutable
  - name: requestedBy | type: IdentificationData | description: GUID of the user or app that generated the review request.  | read-only: true 
     - ONE-OF: 
        - name: wixUserId | type: string | description: Wix user GUID.  | validation: format GUID
        - name: appId | type: string | description: Wix app GUID.  | validation: format GUID
     - name: identityType | type: IdentityType | description: Identity type.  | read-only: true 
         - enum: WIX_USER, APP

 Possible Errors:
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: EITHER_ORDER_OR_ITEMS_REQUIRED | Description: Must specify either the `order.id` or at least 1 `items.catalogItemId`.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: ORDER_NOT_FOUND | Description: Couldn't find the order.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: ORDER_IS_EMPTY | Description: Order has no items.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: INITIATOR_IDENTITY_NOT_SUPPORTED | Description: The [identity](https://dev.wix.com/docs/api-reference/articles/authentication/about-identities.md) used to call the method isn't supported for creating review requests.


```

### Examples

### createReviewRequest
```javascript
import { reviewRequests } from '@wix/reviews';

async function createReviewRequest(reviewRequest) {
  const response = await reviewRequests.createReviewRequest(reviewRequest);
};
```

### createReviewRequest (with elevated permissions)
```javascript
import { reviewRequests } from '@wix/reviews';
import { auth } from '@wix/essentials';

async function myCreateReviewRequestMethod(reviewRequest) {
  const elevatedCreateReviewRequest = auth.elevate(reviewRequests.createReviewRequest);
  const response = await elevatedCreateReviewRequest(reviewRequest);
}
```

### createReviewRequest (self-managed)
Self-managed 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 { reviewRequests } from '@wix/reviews';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

const myWixClient = createClient ({
  modules: { reviewRequests },
  // Include the auth strategy and host as relevant
});


async function createReviewRequest(reviewRequest) {
  const response = await myWixClient.reviewRequests.createReviewRequest(reviewRequest);
};
```

---