---
title: "Writes or updates the customer's review of a product."
---

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

Path: Sherpo customer API › review

`PUT /v1/stores/{store}/products/{product}/review`

## Authentication

- `bearer`, http, header `Authorization`, scopes: `review:write`

## Path parameters

- `store` (`writeReview.path.store`; string, required) — A hostname of the store.
- `product` (`writeReview.path.product`; string, required) — An id, or `slug:<slug>`.
  - minLength 1

## Request body

_Required._

- `rating` (`writeReview.rating`; integer, required)
  - min 1; max 5
- `notes` (`writeReview.notes`; any of, optional)
  - any of: `string`, `null`
- `username` (`writeReview.username`; any of, optional)
  - any of: `string`, `null`

## Example request

```json
{
  "rating": 1,
  "notes": "string",
  "username": "string"
}
```

## Code samples

### cURL

```bash
curl --request PUT \
  --url 'https://api.sherpo.io/customer/v1/stores/<store>/products/<product>/review' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "rating": 1,
  "notes": "string",
  "username": "string"
}
'
```

### TypeScript

```typescript
const url = 'https://api.sherpo.io/customer/v1/stores/<store>/products/<product>/review';
const options = {
  method: 'PUT',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({rating: 1, notes: 'string', username: 'string'})
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.sherpo.io/customer/v1/stores/<store>/products/<product>/review"

payload = {
    "rating": 1,
    "notes": "string",
    "username": "string"
}
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

response = requests.put(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 200

Writes or updates the customer's review of a product.

#### Example

```json
{
  "mine": true,
  "hidden_at": "string",
  "id": "string",
  "product_id": "string",
  "rating": 0,
  "username": "string",
  "notes": "string",
  "reply": "string",
  "replied_at": "string",
  "created_at": "string",
  "updated_at": "string"
}
```

- `mine` (`writeReview.response.200.mine`; boolean, required)
- `hidden_at` (`writeReview.response.200.hidden_at`; any of, required)
  - any of: `string`, `null`
- `id` (`writeReview.response.200.id`; string, required)
- `product_id` (`writeReview.response.200.product_id`; string, required)
- `rating` (`writeReview.response.200.rating`; number, required)
- `username` (`writeReview.response.200.username`; any of, required)
  - any of: `string`, `null`
- `notes` (`writeReview.response.200.notes`; any of, required)
  - any of: `string`, `null`
- `reply` (`writeReview.response.200.reply`; any of, required)
  - any of: `string`, `null`
- `replied_at` (`writeReview.response.200.replied_at`; any of, required)
  - any of: `string`, `null`
- `created_at` (`writeReview.response.200.created_at`; any of, required)
  - any of: `string`, `null`
- `updated_at` (`writeReview.response.200.updated_at`; any of, required) — When the customer last edited it; null until they do.
  - any of: `string`, `null`

### default

A problem; see https://api.sherpo.io/customer/docs/errors.

#### Example

```json
{
  "type": "http://example.com",
  "title": "string",
  "status": 0,
  "detail": "string",
  "code": "string",
  "context": {},
  "reached_core": true,
  "core_answer": "string"
}
```

- `type` (`writeReview.response.default.type`; string, required)
  - format `uri`
- `title` (`writeReview.response.default.title`; string, required)
- `status` (`writeReview.response.default.status`; integer, required)
- `detail` (`writeReview.response.default.detail`; string, required)
- `code` (`writeReview.response.default.code`; string, optional)
- `context` (`writeReview.response.default.context`; object, optional)
- `reached_core` (`writeReview.response.default.reached_core`; boolean, optional)
- `core_answer` (`writeReview.response.default.core_answer`; string, optional)


Source: https://docs.sherpo.io/customer-api/reference/write-review/index.md
