> 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 # 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. - 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. - name: order | type: Order | description: Order that a review is requested for. - name: id | type: string | description: Order GUID. - name: items | type: array | description: Items that a review is requested for. - 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. - name: recipient | type: Recipient | description: Customer to send a review request to. - name: contactId | type: string | description: Recipient contact GUID. See the Contacts API for more information. - name: communicationChannel | type: CommunicationChannel | description: Communication channel for sending the review request. | required: true - 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. Return type: CreateReviewRequestResponse - name: reviewRequest | type: ReviewRequest | description: Created review request. - name: id | type: string | description: Review request 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. - name: createdDate | type: string | description: Date and time the review request was created. - name: updatedDate | type: string | description: Date and time the review request was last updated. - 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. - 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. - name: order | type: Order | description: Order that a review is requested for. - name: id | type: string | description: Order GUID. - name: items | type: array | description: Items that a review is requested for. - 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. - name: reviewId | type: string | description: GUID of the review created for this item by the review request recipient. - name: recipient | type: Recipient | description: Customer to send a review request to. - name: contactId | type: string | description: Recipient contact GUID. See the Contacts API for more information. - name: communicationChannel | type: CommunicationChannel | description: Communication channel for sending the review request. - enum: EMAIL - name: status | type: ReviewRequestStatus | description: Review request status. - 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. - name: requestedBy | type: IdentificationData | description: GUID of the user or app that generated the review request. - ONE-OF: - name: wixUserId | type: string | description: Wix user GUID. - name: appId | type: string | description: Wix app GUID. - name: identityType | type: IdentityType | description: Identity type. - 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: ' \ -d '{ "reviewRequest": { "sendDate": "2024-08-21T06:44:38.231Z", "namespace": "stores", "order": { "id": "6f4770fc-b8ee-4bf2-9977-d048a7f27987", "number": "10049" }, "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.ReviewRequestsV2.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. - 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. - name: order | type: Order | description: Order that a review is requested for. - name: _id | type: string | description: Order GUID. - name: items | type: array | description: Items that a review is requested for. - 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. - name: recipient | type: Recipient | description: Customer to send a review request to. - name: contactId | type: string | description: Recipient contact GUID. See the Contacts API for more information. - name: communicationChannel | type: CommunicationChannel | description: Communication channel for sending the review request. | required: true - 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. Return type: PROMISE - name: _id | type: string | description: Review request 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. - name: _createdDate | type: Date | description: Date and time the review request was created. - name: _updatedDate | type: Date | description: Date and time the review request was last updated. - 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. - 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. - name: order | type: Order | description: Order that a review is requested for. - name: _id | type: string | description: Order GUID. - name: items | type: array | description: Items that a review is requested for. - 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. - name: reviewId | type: string | description: GUID of the review created for this item by the review request recipient. - name: recipient | type: Recipient | description: Customer to send a review request to. - name: contactId | type: string | description: Recipient contact GUID. See the Contacts API for more information. - name: communicationChannel | type: CommunicationChannel | description: Communication channel for sending the review request. - enum: EMAIL - name: status | type: ReviewRequestStatus | description: Review request status. - 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. - name: requestedBy | type: IdentificationData | description: GUID of the user or app that generated the review request. - ONE-OF: - name: wixUserId | type: string | description: Wix user GUID. - name: appId | type: string | description: Wix app GUID. - name: identityType | type: IdentityType | description: Identity type. - 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-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 { 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); }; ``` ---