Delete Product Review
About
The deleteProductReview mutation permanently removes a review. Use it to:
- Let a shopper withdraw a review they submitted
- Remove a review a shopper asked to have taken down
- Clear reviews created while testing an integration
Deletion is immediate and cannot be undone — the row is removed rather than flagged, so the review disappears from every query at once.
A review can only be deleted by the customer who wrote it. Send that customer's Bearer token — an unauthenticated request, a different customer's token, or a review submitted by a guest is refused.
Arguments
| Argument | Type | Required | Description |
|---|---|---|---|
id | ID! | ✅ Yes | Identifies the review. Accepts the IRI form (/api/shop/reviews/93) or a plain numeric ID. |
clientMutationId | String | ❌ No | Arbitrary string echoed back in the payload, useful for correlating a response with its request. |
Possible Returns
| Field | Type | Description |
|---|---|---|
productReview | ProductReview | The review that was removed. Only id is populated — the record is already gone, so its other fields are not available to select meaningfully. |
productReview.id | ID! | IRI of the deleted review, returned as confirmation. |
clientMutationId | String | The clientMutationId sent with the request, echoed back. |
A successful delete looks like this:
{
"data": {
"deleteProductReview": {
"productReview": {
"id": "/api/shop/reviews/76"
},
"clientMutationId": "review-cleanup-76"
}
}
}Use Cases
1. Withdrawing a shopper's own review
Read the review ID back from the list the shopper is looking at, then delete it and drop the row from the rendered list on success.
mutation removeReview($input: deleteProductReviewInput!) {
deleteProductReview(input: $input) {
productReview {
id
}
clientMutationId
}
}{
"input": {
"id": "/api/shop/reviews/76",
"clientMutationId": "review-cleanup-76"
}
}2. Cleaning up integration test data
A review created while testing stays in the catalog and counts toward a product's review total. Delete it with the _id returned by the create mutation.
3. Confirming the review is gone
Re-run Get Product Reviews for the same product_id. The deleted review is absent and totalCount has dropped by one.
Best Practices
- Prefer an admin status change to a deletion — marking a review disapproved hides it from the storefront while keeping the record; deleting destroys it with no way back
- Confirm with the shopper first — there is no soft delete and no recovery path short of a database restore
- Only offer the action on the shopper's own reviews — the API refuses a review written by anyone else, and a guest review can never be removed through the storefront
- Delete by the ID you were handed — take it from the review list or the create response rather than assembling the IRI by hand
- Treat a repeat delete as already-done — a second call for the same ID fails because the review no longer exists, which is a successful outcome from the shopper's point of view
- Refresh the product's review counts afterwards —
totalCountand any cached rating breakdown are stale the moment a review is removed
Error Scenarios
| Scenario | Cause |
|---|---|
| Missing ID | The id field was omitted from input. GraphQL rejects the document before the mutation runs. |
| Review not found | The ID resolves to a review that does not exist, including one already deleted. |
| Not signed in | No customer Bearer token was sent, so ownership cannot be established. |
| Not your review | The review belongs to another customer, or was submitted by a guest and has no owner. |
Related Resources
- Get Product Reviews - Query product reviews
- Create Product Review - Submit a new review
- Update Product Review - Edit an existing review
- Get Product - Query product details
- Shop API Overview - Overview of Shop API resources

