---
title: "Answers a product's registration questions for a customer who holds it, such as answers they gave elsewhere."
---

> 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 merchant API › customer

`PUT /v1/stores/{store}/products/{product}/customers/{customer}/answers`

## Authentication

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

## Path parameters

- `store` (`setCustomerAnswers.path.store`; string, required) — The store's id.
- `product` (`setCustomerAnswers.path.product`; string, required) — An id, or `slug:<slug>`.
  - minLength 1
- `customer` (`setCustomerAnswers.path.customer`; string, required)
  - minLength 1

## Header parameters

- `Idempotency-Key` (`setCustomerAnswers.header.Idempotency-Key`; string, optional) — Repeats within 24 hours answer the first result; the same key with other arguments is a conflict.
  - minLength 1; maxLength 255; pattern `^[\x21-\x7E]+$`

## Request body

_Required._

- `answers` (`setCustomerAnswers.answers`; array<object>, required) — One answer per question; a question left out keeps what it holds.
  - `question` (`setCustomerAnswers.answers.question`; string, required)
    - maxLength 64
  - `value` (`setCustomerAnswers.answers.value`; any of, required) — A trimmed text for a `text` (one line, at most 300) or `long_text` (at most 3000) question, an option for a `select`, options for a `multi_select`, a boolean for a `checkbox`; null or a blank text clears an optional one.
    - any of: `boolean`, `string`, `array<string>`, `null`

## Example request

```json
{
  "answers": [
    {
      "question": "string",
      "value": true
    }
  ]
}
```

## Code samples

### cURL

```bash
curl --request PUT \
  --url 'https://api.sherpo.io/merchant/v1/stores/<store>/products/<product>/customers/<customer>/answers' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "answers": [
    {
      "question": "string",
      "value": true
    }
  ]
}
'
```

### TypeScript

```typescript
const url = 'https://api.sherpo.io/merchant/v1/stores/<store>/products/<product>/customers/<customer>/answers';
const options = {
  method: 'PUT',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({answers: [{question: 'string', value: true}]})
};

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/merchant/v1/stores/<store>/products/<product>/customers/<customer>/answers"

payload = { "answers": [
        {
            "question": "string",
            "value": True
        }
    ] }
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

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

print(response.text)
```

## Responses

### 200

Answers a product's registration questions for a customer who holds it, such as answers they gave elsewhere.

#### Example

```json
{
  "product_id": "string",
  "customer_id": "string",
  "answers": [
    {
      "question_id": "string",
      "value": true
    }
  ]
}
```

- `product_id` (`setCustomerAnswers.response.200.product_id`; string, required)
- `customer_id` (`setCustomerAnswers.response.200.customer_id`; string, required)
- `answers` (`setCustomerAnswers.response.200.answers`; array<object>, required) — The customer's answers in the questions' order, read back for a caller holding `customer:read`; none for anyone else.
  - `question_id` (`setCustomerAnswers.response.200.answers.question_id`; string, required)
  - `value` (`setCustomerAnswers.response.200.answers.value`; any of, required)
    - any of: `boolean`, `string`, `array<string>`

### default

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

#### Example

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

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


Source: https://docs.sherpo.io/merchant-api/reference/set-customer-answers/index.md
