---
metadata:
  - name: generator
    content: Diplodoc Platform v5.50.6
alternate:
  - https://yandex.ru/dev/kit/ru/openapi/Bejdzhi/UpdateBadge.md
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.ru/dev/kit/ru/llms.txt

<div class="openapi">

# Обновление бейджа

<!-- markdownlint-disable-file -->

Обновляет информацию о бейдже.

## Request

<div class="openapi__requests">

<div class="openapi__request__wrapper" style="--method: var(--dc-openapi-methods-patch);margin-bottom: 12px">

<div class="openapi__request">

PATCH {.openapi__method}
```text translate=no
https://api.kit.yandex.net/v1/badges/{badge_id}
```

</div>

</div>

</div>

<div class="openapi-entity">

### Body

{% cut "application/json" %}

```json translate=no
{
  "label": "Новинка",
  "color": "#FF0000FF",
  "tooltip": "Отображается для новых товаров",
  "binding_mode": "SELECTED_VARIANTS"
}
```

{% endcut %}

#|
|| **Name** | **Description** ||
||

_binding_mode_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: [BadgeBindingMode](#entity-BadgeBindingMode)

Режим привязки бейджа:
- `SELECTED_VARIANTS` — привязка к товарам.
- `SELECTED_CATEGORIES_COLLECTIONS` — привязка к категориям и коллекциям.

_Enum:_{.json-schema-reset .json-schema-value} `SELECTED_VARIANTS`, `SELECTED_CATEGORIES_COLLECTIONS`
{.table-cell}
||
||

_color_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

Цвет бейджа в формате hex.

_Pattern:_{.json-schema-reset .json-schema-assertion} `^#[0-9A-Fa-f]{8}$`

_Example:_{.json-schema-reset .json-schema-example} `#FF0000FF`
{.table-cell}
||
||

_label_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

Название бейджа.

_Min length:_{.json-schema-reset .json-schema-assertion} `1`

_Max length:_{.json-schema-reset .json-schema-assertion} `16`

_Example:_{.json-schema-reset .json-schema-example} `Новинка`
{.table-cell}
||
||

_tooltip_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

Текст описания по клику.

_Max length:_{.json-schema-reset .json-schema-assertion} `140`

_Example:_{.json-schema-reset .json-schema-example} `Отображается для новых товаров`
{.table-cell}
||
|#{.json-schema-properties}

</div>

<div class="openapi-entity">

### BadgeBindingMode {#entity-BadgeBindingMode}

Режим привязки бейджа:
- `SELECTED_VARIANTS` — привязка к товарам.
- `SELECTED_CATEGORIES_COLLECTIONS` — привязка к категориям и коллекциям.

**Type**: string

_Enum:_{.json-schema-reset .json-schema-value} `SELECTED_VARIANTS`, `SELECTED_CATEGORIES_COLLECTIONS`

</div>

## Responses

<div class="openapi__response__code__200">

## 200 OK

Бейдж обновлен.

<div class="openapi-entity">

### Body

{% cut "application/json" %}

```json translate=no
{
  "id": "019b21d9-c5d9-777d-80bd-d67c664bc6d9",
  "slug": "sale",
  "label": "Акция",
  "color": "#FFFFFFFF",
  "caption": "Отображается при наличии скидки",
  "tooltip": "Отображается при наличии скидки",
  "priority": 1,
  "is_system": true,
  "binding_mode": "SELECTED_VARIANTS"
}
```

{% endcut %}

#|
|| **Name** | **Description** ||
||

_binding_mode_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: [BadgeBindingMode](#entity-BadgeBindingMode)

Режим привязки бейджа:
- `SELECTED_VARIANTS` — привязка к товарам.
- `SELECTED_CATEGORIES_COLLECTIONS` — привязка к категориям и коллекциям.

_Enum:_{.json-schema-reset .json-schema-value} `SELECTED_VARIANTS`, `SELECTED_CATEGORIES_COLLECTIONS`
{.table-cell}
||
||

_caption_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

Описание системных бейджей в b2b кабинете. Нельзя выставить или обновить вручную.

_Example:_{.json-schema-reset .json-schema-example} `Отображается при наличии скидки`
{.table-cell}
||
||

_color_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

Цвет бейджа в формате hex.

_Example:_{.json-schema-reset .json-schema-example} `#FFFFFFFF`
{.table-cell}
||
||

_id_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: [BadgeID](#entity-BadgeID)

ID бейджа.

_Example:_{.json-schema-reset .json-schema-example} `019b21d9-c5d9-777d-80bd-d67c664bc6d9`
{.table-cell}
||
||

_is_system_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: boolean

Является ли бейдж системным. Системные бейджи предсозданы и их нельзя обновлять.
{.table-cell}
||
||

_label_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

Название бейджа.

_Example:_{.json-schema-reset .json-schema-example} `Акция`
{.table-cell}
||
||

_priority_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: integer

Приоритет бейджа.
{.table-cell}
||
||

_slug_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

URL-идентификатор бейджа.

_Example:_{.json-schema-reset .json-schema-example} `sale`
{.table-cell}
||
||

_tooltip_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

Текст описания по клику.

_Example:_{.json-schema-reset .json-schema-example} `Отображается при наличии скидки`
{.table-cell}
||
|#{.json-schema-properties}

</div>

<div class="openapi-entity">

### BadgeID {#entity-BadgeID}

ID бейджа.

**Type**: string&lt;uuid&gt;

_Example:_{.json-schema-reset .json-schema-example} `019b21d9-c5d9-777d-80bd-d67c664bc6d9`

</div>

</div>

<div class="openapi__response__code__400">

## 400 Bad Request

Некорректный запрос.

<div class="openapi-entity">

### Body

{% cut "application/json" %}

```json translate=no
{
  "code": "VALIDATION_ERROR",
  "message": "Invalid input",
  "trace_id": "00000000000000000000000000000000"
}
```

{% endcut %}

#|
|| **Name** | **Description** ||
||

_code_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `VALIDATION_ERROR`
{.table-cell}
||
||

_message_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `Invalid input`
{.table-cell}
||
||

_trace_id_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

Уникальный идентификатор запроса для отладки.

_Example:_{.json-schema-reset .json-schema-example} `00000000000000000000000000000000`
{.table-cell}
||
|#{.json-schema-properties}

</div>

</div>

<div class="openapi__response__code__401">

## 401 Unauthorized

Не авторизован.

<div class="openapi-entity">

### Body

{% cut "application/json" %}

```json translate=no
{
  "code": "VALIDATION_ERROR",
  "message": "Invalid input",
  "trace_id": "00000000000000000000000000000000"
}
```

{% endcut %}

#|
|| **Name** | **Description** ||
||

_code_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `VALIDATION_ERROR`
{.table-cell}
||
||

_message_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `Invalid input`
{.table-cell}
||
||

_trace_id_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

Уникальный идентификатор запроса для отладки.

_Example:_{.json-schema-reset .json-schema-example} `00000000000000000000000000000000`
{.table-cell}
||
|#{.json-schema-properties}

</div>

</div>

<div class="openapi__response__code__404">

## 404 Not Found

Ресурс не найден.

<div class="openapi-entity">

### Body

{% cut "application/json" %}

```json translate=no
{
  "code": "VALIDATION_ERROR",
  "message": "Invalid input",
  "trace_id": "00000000000000000000000000000000"
}
```

{% endcut %}

#|
|| **Name** | **Description** ||
||

_code_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `VALIDATION_ERROR`
{.table-cell}
||
||

_message_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `Invalid input`
{.table-cell}
||
||

_trace_id_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

Уникальный идентификатор запроса для отладки.

_Example:_{.json-schema-reset .json-schema-example} `00000000000000000000000000000000`
{.table-cell}
||
|#{.json-schema-properties}

</div>

</div>

<div class="openapi__response__code__500">

## 500 Internal Server Error

Внутренняя ошибка сервера.

<div class="openapi-entity">

### Body

{% cut "application/json" %}

```json translate=no
{
  "code": "VALIDATION_ERROR",
  "message": "Invalid input",
  "trace_id": "00000000000000000000000000000000"
}
```

{% endcut %}

#|
|| **Name** | **Description** ||
||

_code_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `VALIDATION_ERROR`
{.table-cell}
||
||

_message_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `Invalid input`
{.table-cell}
||
||

_trace_id_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

Уникальный идентификатор запроса для отладки.

_Example:_{.json-schema-reset .json-schema-example} `00000000000000000000000000000000`
{.table-cell}
||
|#{.json-schema-properties}

</div>

</div>

</div>

[*Deprecated]: No longer supported, please use an alternative and newer version.