product_review.deleted
Fired when a product review is deleted from the store.
Event Structure
{
"event_type": "product_review.deleted",
"payload": { ... }
}
Payload
{
"id": "6753a1b2c3d4e5f6a7b8c9d0",
"product_id": "6753a1b2c3d4e5f6a7b8c9d1",
"store_id": "store_abc123",
"customerName": "Ahmed Ali",
"email": "ahmed@example.com",
"avatar": {
"id": "img_avatar_001",
"fileName": "avatar.jpg",
"fileUrl": "https://cdn.example.com/images/avatar.jpg"
},
"images": [
{
"id": "img_review_001",
"fileName": "review-photo.jpg",
"fileUrl": "https://cdn.example.com/images/review-photo.jpg"
}
],
"rating": 5,
"comment": "Excellent product quality, highly recommended!",
"status": "approved",
"createdAt": "2025-12-01T10:30:00.000Z",
"updatedAt": "2025-12-05T14:15:00.000Z"
}
Payload Fields
| Field | Type | Description |
|---|---|---|
id | string | Unique review ID |
product_id | string | The reviewed product ID |
store_id | string | Store ID that owns this review |
customerName | string | Name of the reviewer |
email | string | Reviewer email address |
avatar | object | null | Reviewer avatar image |
avatar.id | string | Avatar image ID |
avatar.fileName | string | Avatar file name |
avatar.fileUrl | string | Full avatar URL |
images | array | Review attached images |
images[].id | string | Image ID |
images[].fileName | string | Image file name |
images[].fileUrl | string | Full image URL |
rating | number | Review rating |
comment | string | Review text content |
status | string | Review status (e.g. approved, pending) |
createdAt | string | ISO 8601 creation timestamp |
updatedAt | string | ISO 8601 last update timestamp |
Example Handler
app/routes/webhooks.reviews.tsx
import { authenticate } from "~/qumra.server";
export async function action({ request }: { request: Request }) {
const { payload, topic, storeId } =
await authenticate.admin(request);
if (topic === "product_review.deleted") {
console.log(`Review deleted: ${payload.id} for product ${payload.product_id}`);
// Recalculate product rating, clean up related data, etc.
}
return Response.json({ success: true });
}