> ## Documentation Index
> Fetch the complete documentation index at: https://docs.salesive.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create review

> Create a product review.

## Request

```http theme={null}
POST /reviews
Authorization: Bearer {{token}}
x-shop-id: {{shopId}}
Content-Type: application/json

{
  "productId": "68e5bb463a1fc56a8ac150bf",
  "orderId": "690ff00acf4de460fd1f6114",
  "rating": 5,
  "comment": "Excellent product! Very satisfied with the quality."
}
```

## Headers

| Header          | Type   | Description                                   |
| --------------- | ------ | --------------------------------------------- |
| `Authorization` | string | Provide the customer token as `Bearer <jwt>`. |
| `x-shop-id`     | string | Identify the shop.                            |
| `Content-Type`  | string | Always set to `application/json`.             |

## Body parameters

| Field       | Type    | Required | Description                                  |
| ----------- | ------- | -------- | -------------------------------------------- |
| `productId` | string  | Yes      | Product identifier to review.                |
| `orderId`   | string  | Yes      | Order ID that includes the product.          |
| `rating`    | integer | Yes      | Rating from 1 to 5.                          |
| `title`     | string  | No       | Review title.                                |
| `comment`   | string  | No       | Review text.                                 |
| `images`    | array   | No       | Array of image URLs to attach to the review. |

## Successful response

```json theme={null}
{
    "status": 200,
    "success": true,
    "message": "Review created successfully",
    "data": {
        "_id": "6a27d8d4289b87893fcbdeca",
        "rating": 5,
        "title": "Great Product",
        "comment": "I loved this product, it was amazing!",
        "shop": "68b8f52575da81b332af29f1",
        "user": "69360693a7a8f7dc8ae32d6d",
        "product": "68bc52f0e15404b8e40a7c52",
        "order": "6938414ad9485f4d96134f8c",
        "images": [],
        "createdAt": "2026-06-09T09:11:48.272Z",
        "updatedAt": "2026-06-09T09:11:48.272Z",
        "__v": 0
    }
}
```

## Error response

```json theme={null}
{
    "status": 400,
    "success": false,
    "message": "You can only review products from completed orders",
    "data": {}
}
```


## OpenAPI

````yaml POST /reviews
openapi: 3.1.0
info:
  title: Salesive Store API
  description: >-
    REST interface for querying products, categories, and merchandising banners
    exposed by Salesive storefronts.
  version: 1.0.0
servers:
  - description: Production
    url: https://store.salesive.com/api/v1
security:
  - BearerAuth: []
    ShopIdHeader: []
paths:
  /reviews:
    post:
      summary: Create review
      description: Create a product review.
      parameters:
        - $ref: '#/components/parameters/XShopIdHeader'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - productId
                - rating
                - comment
              properties:
                productId:
                  type: string
                orderId:
                  type: string
                rating:
                  type: integer
                  minimum: 1
                  maximum: 5
                comment:
                  type: string
      responses:
        '201':
          description: Review created
components:
  parameters:
    XShopIdHeader:
      name: x-shop-id
      in: header
      description: >-
        Optional identifier that scopes responses to a specific storefront when
        the referer cannot be inferred.
      required: false
      schema:
        type: string
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: JWT issued by the Salesive Store API for authenticated shoppers.
    ShopIdHeader:
      type: apiKey
      in: header
      name: x-shop-id
      description: >-
        Optional storefront identifier sent as a header to scope responses to a
        specific shop. Try It requests remember this value once provided.

````