---
title: "Rewords a product question, makes it required or not, changes its options or pattern, or moves it."
---

> 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 › product

`PATCH /v1/stores/{store}/products/{product}/questions/{question}`

## Authentication

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

## Path parameters

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

## Header parameters

- `Idempotency-Key` (`updateProductQuestion.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

_Optional._

- `position` (`updateProductQuestion.position`; integer, optional) — Where it goes among the product's questions, from zero; last when unset.
  - min 0; max 19
- `label` (`updateProductQuestion.label`; string, optional) — What the buyer is asked, trimmed, with no line break or control character; required unless a preset names it.
  - minLength 1; maxLength 200
- `required` (`updateProductQuestion.required`; boolean, optional) — Whether checkout asks for an answer before payment; a required checkbox must be ticked. False when unset.
- `options` (`updateProductQuestion.options`; array<string>, optional) — A select's or a multi select's options, in order and distinct, each trimmed with no line break or control character; refused for any other kind.
- `pattern` (`updateProductQuestion.pattern`; any of, optional) — A text answer's pattern, trimmed and matched against the whole answer: literals, `.`, classes, `\d \w \s`, groups, `|` and repeats up to 100; refused for any other kind and for what can't be matched safely.
  - any of: `string`, `null`
- `example` (`updateProductQuestion.example`; any of, optional) — An answer that fits the pattern, trimmed with no line break or control character, which checkout shows buyers as the format to follow; refused without a pattern or when the pattern doesn't match it, and cleared with the pattern.
  - any of: `string`, `null`
- `from_position` (`updateProductQuestion.from_position`; integer, optional) — Where the caller last read it; one moved since is refused, so two moves never compound.
  - min 0; max 19

## Example request

```json
{
  "position": 19,
  "label": "string",
  "required": true,
  "options": [
    "string",
    "string"
  ],
  "pattern": "string",
  "example": "string",
  "from_position": 19
}
```

## Code samples

### cURL

```bash
curl --request PATCH \
  --url 'https://api.sherpo.io/merchant/v1/stores/<store>/products/<product>/questions/<question>' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "position": 19,
  "label": "string",
  "required": true,
  "options": [
    "string",
    "string"
  ],
  "pattern": "string",
  "example": "string",
  "from_position": 19
}
'
```

### TypeScript

```typescript
const url = 'https://api.sherpo.io/merchant/v1/stores/<store>/products/<product>/questions/<question>';
const options = {
  method: 'PATCH',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({
    position: 19,
    label: 'string',
    required: true,
    options: ['string', 'string'],
    pattern: 'string',
    example: 'string',
    from_position: 19
  })
};

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>/questions/<question>"

payload = {
    "position": 19,
    "label": "string",
    "required": True,
    "options": ["string", "string"],
    "pattern": "string",
    "example": "string",
    "from_position": 19
}
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

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

print(response.text)
```

## Responses

### 200

Rewords a product question, makes it required or not, changes its options or pattern, or moves it.

#### Example

```json
{
  "id": "string",
  "product_id": "string",
  "position": 0,
  "kind": "string",
  "preset": "string",
  "label": "string",
  "required": true,
  "options": [
    "string"
  ],
  "pattern": "string",
  "example": "string",
  "created_at": "string",
  "updated_at": "string"
}
```

- `id` (`updateProductQuestion.response.200.id`; string, required)
- `product_id` (`updateProductQuestion.response.200.product_id`; string, required)
- `position` (`updateProductQuestion.response.200.position`; number, required) — Where it shows among the product's questions, from zero.
- `kind` (`updateProductQuestion.response.200.kind`; string, required) — `text`, `long_text`, `select`, `multi_select` or `checkbox`.
- `preset` (`updateProductQuestion.response.200.preset`; any of, required) — The standard detail it asks for (`name`, `phone`, `company` or `address`), or null for one of the seller's own.
  - any of: `string`, `null`
- `label` (`updateProductQuestion.response.200.label`; string, required)
- `required` (`updateProductQuestion.response.200.required`; boolean, required) — Whether checkout asks for an answer before payment; a required checkbox must be ticked.
- `options` (`updateProductQuestion.response.200.options`; any of, required) — A select's options, in order; null for any other kind.
  - any of: `array<string>`, `null`
- `pattern` (`updateProductQuestion.response.200.pattern`; any of, required) — The pattern a text answer must match whole, or null for none.
  - any of: `string`, `null`
- `example` (`updateProductQuestion.response.200.example`; any of, required) — An answer that fits the pattern, which checkout shows as the format to follow; null for none.
  - any of: `string`, `null`
- `created_at` (`updateProductQuestion.response.200.created_at`; string, required)
- `updated_at` (`updateProductQuestion.response.200.updated_at`; string, required)

### 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` (`updateProductQuestion.response.default.type`; string, required)
  - format `uri`
- `title` (`updateProductQuestion.response.default.title`; string, required)
- `status` (`updateProductQuestion.response.default.status`; integer, required)
- `detail` (`updateProductQuestion.response.default.detail`; string, required)
- `code` (`updateProductQuestion.response.default.code`; string, optional)
- `context` (`updateProductQuestion.response.default.context`; object, optional)
- `reached_core` (`updateProductQuestion.response.default.reached_core`; boolean, optional)
- `core_answer` (`updateProductQuestion.response.default.core_answer`; string, optional)


Source: https://docs.sherpo.io/merchant-api/reference/update-product-question/index.md
