---
title: "Sets, swaps or clears a product's thumbnail, its first poster, if it is still the one the caller saw."
---

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

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

## Authentication

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

## Path parameters

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

## Header parameters

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

- `asset` (`setProductPoster.asset`; any of, required) — The file to show, or null to show none.
  - any of: `object`, `null`
- `from` (`setProductPoster.from`; any of, required) — The first poster the caller saw, or null for none; a product showing another refuses.
  - any of: `object`, `null`

## Example request

```json
{
  "asset": {
    "id": "string"
  },
  "from": {
    "attachment": {
      "id": "string"
    },
    "asset": {
      "id": "string"
    }
  }
}
```

## Code samples

### cURL

```bash
curl --request PUT \
  --url 'https://api.sherpo.io/merchant/v1/stores/<store>/products/<product>/poster' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "asset": {
    "id": "string"
  },
  "from": {
    "attachment": {
      "id": "string"
    },
    "asset": {
      "id": "string"
    }
  }
}
'
```

### TypeScript

```typescript
const url = 'https://api.sherpo.io/merchant/v1/stores/<store>/products/<product>/poster';
const options = {
  method: 'PUT',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({
    asset: {id: 'string'},
    from: {attachment: {id: 'string'}, asset: {id: '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/merchant/v1/stores/<store>/products/<product>/poster"

payload = {
    "asset": { "id": "string" },
    "from": {
        "attachment": { "id": "string" },
        "asset": { "id": "string" }
    }
}
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

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

print(response.text)
```

## Responses

### 200

Sets, swaps or clears a product's thumbnail, its first poster, if it is still the one the caller saw.

#### Example

```json
{
  "product": {
    "id": "string"
  },
  "poster": null
}
```

Any of:

- `object`
- `object`

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


Source: https://docs.sherpo.io/merchant-api/reference/set-product-poster/index.md
