---
metadata:
  - name: generator
    content: Diplodoc Platform v5.54.2
alternate:
  - https://yandex.ru/dev/kit/ru/openapi/Zakazy/SetOrderMarkingCodes.md
  - href: ru/openapi/Zakazy/SetOrderMarkingCodes.md
    type: text/markdown
    title: Markdown version
  - href: ../../llms.txt
    type: text/markdown
    title: llms.txt
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.ru/dev/kit/ru/llms.txt

<div class="openapi">

# Запись кодов маркировки «Честный знак»

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

Записывает коды маркировки «Честный знак» для позиций заказа.

Правила и ограничения:

- Каждая позиция заказа — это одна единица товара, поэтому позиции соответствует
ровно один код маркировки. Идентификаторы позиций возвращает `GET /v1/orders/{id}`
в поле `delivery_chunks[].items[].id`.

- Все переданные позиции должны принадлежать указанному заказу,
`order_item_id` не должны повторяться.

- Код передается целиком, вместе с криптохвостом.

- Для снятия ранее записанного кода передайте `"marking_code": null`.

- Метод идемпотентен: если любой код не проходит проверку, запрос отклоняется, при этом коды не записываются.

## Request

<div class="openapi__requests">

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

<div class="openapi__request">

POST {.openapi__method}
```text translate=no
https://api.kit.yandex.net/v1/orders/{id}/marking-codes
```

</div>

</div>

</div>

<div class="openapi-entity">

### Body

{% cut "application/json" %}

```json translate=no
{
  "items": [
    {
      "order_item_id": "00000000-0000-0000-0000-000000000001",
      "marking_code": "0104670147122765215Fx_t42mlIYny91EE1192Z5CcNr9XGy6luZHI79Fy20sQtEva56kNkxAPI5eGiIw="
    }
  ]
}
```

{% endcut %}

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

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

Позиции заказа с кодами маркировки. Позиция не может повторяться.

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

_Max items:_{.json-schema-reset .json-schema-assertion} `100`

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
[
  {
    "order_item_id": "00000000-0000-0000-0000-000000000001",
    "marking_code": "0104670147122765215Fx_t42mlIYny91EE1192Z5CcNr9XGy6luZHI79Fy20sQtEva56kNkxAPI5eGiIw="
  }
]
```

{% endcut %}
{.table-cell}
||
|#{.json-schema-properties}

</div>

<div class="openapi-entity">

### OrderItemID {#entity-OrderItemID}

Идентификатор позиции заказа.

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

_Example:_{.json-schema-reset .json-schema-example} `00000000-0000-0000-0000-000000000001`

</div>

<div class="openapi-entity">

### OrderMarkingCode {#entity-OrderMarkingCode}

Код маркировки «Честный знак» для позиции заказа.

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

_marking_code_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string &#124; null

Код маркировки «Честный знак» целиком, вместе с криптохвостом.
`null` — снять ранее записанный код с позиции.

_Example:_{.json-schema-reset .json-schema-example} `0104670147122765215Fx_t42mlIYny91EE1192Z5CcNr9XGy6luZHI79Fy20sQtEva56kNkxAPI5eGiIw=`
{.table-cell}
||
||

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

Идентификатор позиции заказа.

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

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{
  "order_item_id": "00000000-0000-0000-0000-000000000001",
  "marking_code": "0104670147122765215Fx_t42mlIYny91EE1192Z5CcNr9XGy6luZHI79Fy20sQtEva56kNkxAPI5eGiIw="
}
```

{% endcut %}

</div>

## Responses

<div class="openapi__response__code__204">

## 204 No Content

Коды маркировки успешно записаны.

</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.