Skip to content

ProductReviewState ​

Type: schema

Description ​

A product review as its events carry it: a store's review, or a marketplace store's review of one of its products (the event's store_type is then marketplace), which also names the shopper, their order and the dates.

TypeScript Definition ​

typescript
ProductReviewState: {{
            /** @description The review's id; the event's `review_id` as a string. */
            id: number;
            /** @description From 1 to 5, in steps of 0.5. */
            rating: number;
            review_text: string;
            /** @description The store's reply; `null` until it replies. */
            review_reply: string | null;
            /**
             * @description Only `approved` reviews are shown to shoppers.
             * @enum {string}
             */
            status: "pending" | "approved" | "rejected" | "archived";
            is_featured: boolean;
            tags: string[] | null;
            images: {
                id?: string;
                thumbnail_url?: string;
                blur_url?: string;
                standard_url?: string;
            }[] | null;
            videos: {
                id?: string;
                cover_image_url?: string | null;
                video_preview_url?: string | null;
                playback?: Record<string, never> | null;
                duration?: string;
                size?: number | string;
            }[] | null;
        } & ({
            /** @description The reviewer's name. */
            name: string | null;
            /** @description The reviewer's email; empty when none was given. */
            email: string;
        } | {
            /** @description The marketplace product reviewed. */
            product_id: string;
            /** @description The shopper who wrote it. */
            user_id: string | null;
            user_name: string | null;
            user_email: string | null;
            /** @description The order the shopper bought it in. */
            order_number: string | null;
            /** Format: date-time */
            review_date: string;
            /** Format: date-time */
            created_at: string;
            /** Format: date-time */
            modified_at: string;
        });
        /** ProductShipping */
}

OpenAPI Schema ​

json
{
  "title": "ProductReviewState",
  "description": "A product review as its events carry it: a store's review, or a marketplace store's review of one of its products (the event's `store_type` is then `marketplace`), which also names the shopper, their order and the dates.",
  "type": "object",
  "externalDocs": {
    "url": "https://llm-docs.commercengine.io/storefront/schemas/ProductReviewState",
    "description": "API reference for the ProductReviewState schema"
  },
  "required": [
    "id",
    "rating",
    "review_text",
    "review_reply",
    "status",
    "is_featured",
    "tags",
    "images",
    "videos"
  ],
  "properties": {
    "id": {
      "description": "The review's id; the event's `review_id` as a string.",
      "type": "integer"
    },
    "rating": {
      "description": "From 1 to 5, in steps of 0.5.",
      "type": "number"
    },
    "review_text": {
      "type": "string"
    },
    "review_reply": {
      "description": "The store's reply; `null` until it replies.",
      "type": [
        "string",
        "null"
      ]
    },
    "status": {
      "description": "Only `approved` reviews are shown to shoppers.",
      "type": "string",
      "enum": [
        "pending",
        "approved",
        "rejected",
        "archived"
      ]
    },
    "is_featured": {
      "type": "boolean"
    },
    "tags": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "string"
      }
    },
    "images": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "object",
        "description": "An image the reviewer uploaded.",
        "properties": {
          "id": {
            "type": "string"
          },
          "thumbnail_url": {
            "type": "string"
          },
          "blur_url": {
            "type": "string"
          },
          "standard_url": {
            "type": "string"
          }
        }
      }
    },
    "videos": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "object",
        "description": "A video the reviewer uploaded.",
        "properties": {
          "id": {
            "type": "string"
          },
          "cover_image_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "video_preview_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "playback": {
            "type": [
              "object",
              "null"
            ]
          },
          "duration": {
            "type": "string"
          },
          "size": {
            "type": [
              "integer",
              "string"
            ]
          }
        }
      }
    }
  },
  "oneOf": [
    {
      "title": "StoreProductReview",
      "type": "object",
      "properties": {
        "name": {
          "description": "The reviewer's name.",
          "type": [
            "string",
            "null"
          ]
        },
        "email": {
          "description": "The reviewer's email; empty when none was given.",
          "type": "string"
        }
      },
      "required": [
        "name",
        "email"
      ]
    },
    {
      "title": "MarketplaceProductReview",
      "type": "object",
      "properties": {
        "product_id": {
          "description": "The marketplace product reviewed.",
          "type": "string"
        },
        "user_id": {
          "description": "The shopper who wrote it.",
          "type": [
            "string",
            "null"
          ]
        },
        "user_name": {
          "type": [
            "string",
            "null"
          ]
        },
        "user_email": {
          "type": [
            "string",
            "null"
          ]
        },
        "order_number": {
          "description": "The order the shopper bought it in.",
          "type": [
            "string",
            "null"
          ]
        },
        "review_date": {
          "type": "string",
          "format": "date-time"
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        },
        "modified_at": {
          "type": "string",
          "format": "date-time"
        }
      },
      "required": [
        "product_id",
        "user_id",
        "user_name",
        "user_email",
        "order_number",
        "review_date",
        "created_at",
        "modified_at"
      ]
    }
  ]
}

Auto-generated from OpenAPI spec and TypeScript definitions

Last updated: