> 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 # Package: reviews # Namespace: reviewRequests # Webhook link: https://dev.wix.com/docs/api-reference/crm/community/feedback-moderation/reviews/review-requests/review-request-created.md ## Introduction Triggered when a review request is created. --- ## REST API ### Schema ``` Webhook: Review Request Created Description: Triggered when a review request is created. Event body: - name: id | type: string | description: Unique event ID. Allows clients to ignore duplicate events. - name: entityFqdn | type: string | description: Fully qualified domain name of the entity associated with the event. - name: slug | type: string | description: Event name. - name: entityId | type: string | description: ID of the entity associated with the event. - name: eventTime | type: string (date-time) | description: Event timestamp. - name: triggeredByAnonymizeRequest | type: boolean | description: Whether the event was triggered as a result of a privacy regulation application such as GDPR. - name: originatedFrom | type: string | description: If present, indicates the action that triggered the event. - name: createdEvent | type: object | description: Created event details. - name: entity | type: ReviewRequest | description: The created entity. - 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 ``` ### Examples ```curl { "id": "0ec75a41-ae29-4e5e-8063-46f5a5d925d9", "entityFqdn": "wix.reviews.v2.review_request", "slug": "created", "entityId": "15f470a4-a960-43bb-b1ed-886e1050efcd", "createdEvent": { "entity": { "id": "15f470a4-a960-43bb-b1ed-886e1050efcd", "revision": "1", "createdDate": "2024-08-21T06:43:38.240Z", "updatedDate": "2024-08-21T07:22:40.086Z", "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", "status": "SCHEDULED", "automationActivationId": "73fff183-acf3-4770-b527-f65f9f10d5f6", "requestedBy": { "wixUserId": "28073e47-8038-4dd3-ad3c-343602992889", "identityType": "WIX_USER" } } }, "eventTime": "2023-05-15T13:09:26.856Z", "triggeredByAnonymizeRequest": false } ``` --- ## JavaScript SDK ### Schema ``` Webhook: onReviewRequestCreated Description: Triggered when a review request is created. Payload: ReviewRequestCreatedEnvelope - name: entity | type: ReviewRequest | description: none - 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 - name: metadata | type: EventMetadata | description: none - name: instanceId | type: string | description: App instance GUID. - name: eventType | type: string | description: Event type. - name: identity | type: IdentificationData | description: The identification type and identity data. - ONE-OF: - name: anonymousVisitorId | type: string | description: GUID of a site visitor that has not logged in to the site. - name: memberId | type: string | description: GUID of a site visitor that has logged in to the site. - name: wixUserId | type: string | description: GUID of a Wix user (site owner, contributor, etc.). - name: appId | type: string | description: GUID of an app. - name: identityType | type: WebhookIdentityType | description: - enum: UNKNOWN, ANONYMOUS_VISITOR, MEMBER, WIX_USER, APP - name: accountInfo | type: AccountInfo | description: Details related to the account - name: accountId | type: string | description: GUID of the Wix account associated with the event. - name: parentAccountId | type: string | description: GUID of the parent Wix account. Only included when accountId belongs to a child account. - name: siteId | type: string | description: GUID of the Wix site associated with the event. Only included when the event is tied to a specific site. - name: _id | type: string | description: Event GUID. With this GUID you can easily spot duplicated events and ignore them. - name: entityFqdn | type: string | description: Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities. For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`. - name: slug | type: string | description: Event action name, placed at the top level to make it easier for users to dispatch messages. For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`. - name: entityId | type: string | description: GUID of the entity associated with the event. - name: eventTime | type: Date | description: Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. - name: triggeredByAnonymizeRequest | type: boolean | description: Whether the event was triggered as a result of a privacy regulation application (for example, GDPR). - name: originatedFrom | type: string | description: If present, indicates the action that triggered the event. - name: entityEventSequence | type: string | description: A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number. You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it. ``` ### Examples ```javascript import { reviewRequests } from '@wix/reviews'; reviewRequests.onReviewRequestCreated((event) => { // handle your event here }); ``` ```javascript import { createClient, AppStrategy } from '@wix/sdk'; import { reviewRequests } from '@wix/reviews'; const wixClient = createClient({ auth: AppStrategy({ appId: 'MY-APP-ID', publicKey: 'YOUR_APP_PUBLIC_KEY', }), modules: { reviewRequests, }, }); wixClient.reviewRequests.onReviewRequestCreated((event) => { // handle your event here }); ``` ---