Skip to main content

reviewCreate

Overview

Allow customers to submit reviews after fulfilling orders. Provide the order key, overall shipping rate, and product-specific ratings via CreateReviewPayload.

Mutation

mutation CreateReview($input: CreateReviewPayload!) {
createReview(input: $input) {
success
data {
_id
app
order
shippingRate
note
isApproved
productRatings {
product
rating
note
_id
}
}
message
}
}

Variables

{
"input": {
"orderKey": "<ORDER_KEY>",
"shippingRate": 4,
"note": "Great delivery",
"productRatings": [
{
"product": "<PRODUCT_ID>",
"rating": 5,
"note": "Loved the quality"
}
]
}
}

Examples

curl -X POST \
https://subdomain.com\
-H "Content-Type": "application/json" \
-H "Authorization: Bearer <TOKEN>" \
--data-binary @- << 'EOF'
{
"query": "mutation CreateReview($input: CreateReviewPayload!) { createReview(input: $input) { success message data { _id shippingRate productRatings { product rating } } } }",
"variables": {
"input": {
"orderKey": "<ORDER_KEY>",
"shippingRate": 4,
"productRatings": [
{ "product": "<PRODUCT_ID>", "rating": 5, "note": "Great" }
]
}
}
}
EOF

Notes

  • Validate orderKey server-side to ensure the order belongs to the customer.
  • productRatings can include multiple entries for each purchased product/variant.
  • Gate review creation with rate-limiting or completion status to avoid spam.