# /api/lite/products

### Запрос списка продуктов (GET /api/lite/products)

/api/lite/products

Метод возвращает перечень всех продуктов / товарных предложений (активных и неактивных).

Продукт всегда содержит хотя бы один вариант.

Правильно рассматривать Продукт - как виртуальную сущность (группу), а вариант - как физический товар. В рамках одного Продукта может быть несколько Вариантов (например, различные цвета и размеры).

Каждый Вариант имеет набор Опций, характеризующих именно этот вариант (например Цвет=blue, Размер=XL). Не может существовать более одного Варианта с одинаковым набором Опций.

####  

#### **Фильтрация по полям товара**

Можно задавать фильтр параметром ?query=test - для фильтрации по полям article, humanId, shortName, fullName, description

Дополнительно можно фильтровать по конкректному продукту параметром ?id=1000

Имеется поддержка фильтрации и по другим полям:

- по Id варианта - ?variantId=1001
- по ШК (штрихкоду товара) - ?barcode=0000000000001

#### **Фильтрация по фильтрам, атрибутам, вариантам товара**

Фронтенд при выборе покупателем значений тех или иных фильтров должен составить поисковый GET запрос и передать его в метод:

/pub/products

в виде суммы параметров:

`?filters=field_name1:field_value1,field_value2;field_name2:field_value3-field_value4 ` для всех фильтров в блоке OTHER

`?attributes=field_name1:field_value1,field_value2;field_name2:field_value3-field_value4` для всех фильтров в блоке ATTRIBUTES

`?features=field_name1:field_value1,field_value2;field_name2:field_value3-field_value4` для всех фильтров в блоке FEATURES

где field\_name - это значение поля filters.fields.name, field\_value - это значение поля filters.fields.stringValues для filters.fields.type: "string" или decimalValues для filters.fields.type: "decimal" или true/false для filters.fields.type: "boolean".

Для filters.fields.type: "decimal" также можно передавать диапазон, указывая начальное и конечное значение через дефис: `field_name2:field_value3-field_value4`

#### **Коллекции**

Можно задавать фильтр по коллекциям параметром ?collections=1007,1008 - для фильтрации по id коллекций (можно передавать списком)

#### **Архивные карточки**

Можно дополнительно выводить архивные карточки товаров параметром deleted=true

#### **Пейджинация**

Для пейджинации используются параметры page и size: size - продуктов на странице, page - номер страницы.

Пример: `/api/lite/products?page=0&size=200`

Если параметры не переданы, то дефолтные значения page=0&amp;size=100

<p class="callout info">Максимальное количество продуктов - 100. Даже если указано значение более 100</p>

Также, для отображение пейджинации следует анализировать параметр recordsTotal, возвращающий общее количество записей (с учетом примененной фильтрации, если она есть).

#### **Сортировка**

Для сортировки задается параметр order, принимающий код поля для сортировки и направление сортировки (asc, desc), отделенное символом плюса.

Пример сортировки по имени (**возрастание**): `/api/lite/products?order=shortname+<strong>asc</strong>`

Пример сортировки по имени (**убывание**): `/api/lite/products?order=shortname+<strong>desc</strong>`

Доступные коды сортировки:

- shortname
- article
- price
- amount
- <div>stockUpdateFrom</div>

Пример вызова с одновременной фильтрацией, пейджинацией и сортировкой:

`/api/lite/products?query=Поло&order=shortname+asc&page=0&size=200`

<span style="color: #ffffff;">**Структура ответа:**</span>

<table class="relative-table wrapped confluenceTable tablesorter tablesorter-default" id="bkmrk-%D0%9F%D0%BE%D0%BB%D0%B5-%D0%A2%D0%B8%D0%BF-%2F-%D1%84%D0%BE%D1%80%D0%BC%D0%B0%D1%82-%D0%9E%D0%BF" role="grid" style="width: 100%; height: 3061px;"><tbody aria-live="polite" aria-relevant="all"><tr style="height: 29px;"><td style="height: 29px;">**Поле**</td><td style="height: 29px;">**Тип / формат**</td><td style="height: 29px;">**Описание**</td></tr><tr role="row" style="height: 61px;"><td class="confluenceTd" style="height: 61px;">recordsTotal</td><td class="confluenceTd" style="height: 61px;">num</td><td class="confluenceTd" style="height: 61px;">Общее количество записей в рамках заданной фильтрации. Используется для пейджинации.</td></tr><tr role="row" style="height: 35px;"><td class="confluenceTd" style="height: 35px;">products

</td><td class="confluenceTd" style="height: 35px;">array</td><td class="confluenceTd" style="height: 35px;">Перечень товарных предложений</td></tr><tr role="row" style="height: 29px;"><td class="confluenceTd" style="height: 29px;">id</td><td class="confluenceTd" style="height: 29px;">string</td><td class="confluenceTd" style="height: 29px;">Идентификатор продукта</td></tr><tr role="row" style="height: 45px;"><td class="confluenceTd" style="height: 45px;">extId</td><td class="confluenceTd" style="height: 45px;">string</td><td class="confluenceTd" style="height: 45px;">Дополнительный идентификатор продукта</td></tr><tr style="height: 46px;"><td style="height: 46px;">extId2</td><td style="height: 46px;">string</td><td style="height: 46px;">Дополнительный идентификатор продукта</td></tr><tr style="height: 46px;"><td style="height: 46px;">extId3</td><td style="height: 46px;">string</td><td style="height: 46px;">Дополнительный идентификатор продукта</td></tr><tr style="height: 46px;"><td style="height: 46px;">extId4</td><td style="height: 46px;">string</td><td style="height: 46px;">Дополнительный идентификатор продукта</td></tr><tr style="height: 46px;"><td style="height: 46px;">extId5</td><td style="height: 46px;">string</td><td style="height: 46px;">Дополнительный идентификатор продукта</td></tr><tr role="row" style="height: 35px;"><td class="confluenceTd" style="height: 35px;">shortName

</td><td class="confluenceTd" style="height: 35px;">string</td><td class="confluenceTd" style="height: 35px;">Наименование продукта</td></tr><tr role="row" style="height: 29px;"><td class="confluenceTd" style="height: 29px;">description</td><td class="confluenceTd" style="height: 29px;">string</td><td class="confluenceTd" style="height: 29px;">Описание (может содержать html)</td></tr><tr role="row" style="height: 29px;"><td class="confluenceTd" style="height: 29px;">tnvedCode</td><td class="confluenceTd" style="height: 29px;">string</td><td class="confluenceTd" style="height: 29px;">Код ТНВЭД</td></tr><tr role="row" style="height: 29px;"><td class="confluenceTd" style="height: 29px;">internationalDescription</td><td class="confluenceTd" style="height: 29px;">string</td><td class="confluenceTd" style="height: 29px;">Описание на анлийском</td></tr><tr style="height: 45px;"><td style="height: 45px;">additionalDescriptions</td><td style="height: 45px;">array</td><td style="height: 45px;">Блоки с дополнительным текстовым описанием</td></tr><tr role="row" style="height: 45px;"><td class="confluenceTd" style="height: 45px;">available</td><td class="confluenceTd" style="height: 45px;">boolean</td><td class="confluenceTd" style="height: 45px;">Отображение для продажи в онлайн-магазине</td></tr><tr style="height: 46px;"><td style="height: 46px;">boxNeeded</td><td style="height: 46px;">boolean</td><td style="height: 46px;">Требуется обрешётка (при отгрузке товара)</td></tr><tr role="row" style="height: 29px;"><td class="confluenceTd" style="height: 29px;">deleted</td><td class="confluenceTd" style="height: 29px;">boolean</td><td class="confluenceTd" style="height: 29px;">Архивная карточка</td></tr><tr role="row" style="height: 45px;"><td class="confluenceTd" style="height: 45px;">type</td><td class="confluenceTd" style="height: 45px;">enum</td><td class="confluenceTd" style="height: 45px;">Тип продукта.   
SKU - Товар  
PHYSICAL\_SET - физический комплект  
SERVICE- услуга  
<div>BUNDLE - виртуальный набор  
<div>PACKING_MATERIAL_BOXES - упаковочные материалы клиента - короба  
<div>PACKING_MATERIAL_ATTACHMENT - упаковочные материалы клиента - вложения</div><div>PACKING_MATERIAL_OTHER - упаковочные материалы клиента - другие материалы</div><div>COMMON_PACKING_MATERIAL - упаковочные материалы фулфилмент</div></div></div></td></tr><tr role="row" style="height: 45px;"><td class="confluenceTd" style="height: 45px;">vat</td><td class="confluenceTd" style="height: 45px;">enum</td><td class="confluenceTd" style="height: 45px;">НДС товара. NO\_VAT/VAT\_0/VAT\_10/VAT\_20</td></tr><tr style="height: 29px;"><td style="height: 29px;">reviewScore</td><td style="height: 29px;">decimal</td><td style="height: 29px;">Оценка товара</td></tr><tr role="row" style="height: 29px;"><td class="highlight-yellow confluenceTd" data-highlight-colour="yellow" style="height: 29px;" title="Цвет фона: Желтый">variants</td><td class="highlight-yellow confluenceTd" data-highlight-colour="yellow" style="height: 29px;" title="Цвет фона: Желтый">array</td><td class="highlight-yellow confluenceTd" data-highlight-colour="yellow" style="height: 29px;" title="Цвет фона: Желтый">Массив вариантов</td></tr><tr role="row" style="height: 29px;"><td class="highlight-yellow confluenceTd" data-highlight-colour="yellow" style="height: 29px;" title="Цвет фона: Желтый">id</td><td class="highlight-yellow confluenceTd" data-highlight-colour="yellow" style="height: 29px;" title="Цвет фона: Желтый">string</td><td class="highlight-yellow confluenceTd" data-highlight-colour="yellow" style="height: 29px;" title="Цвет фона: Желтый">Уникальный идентификатор варианта.</td></tr><tr role="row" style="height: 29px;"><td class="highlight-yellow confluenceTd" data-highlight-colour="yellow" style="height: 29px;" title="Цвет фона: Желтый">article</td><td class="highlight-yellow confluenceTd" data-highlight-colour="yellow" style="height: 29px;" title="Цвет фона: Желтый">string</td><td class="highlight-yellow confluenceTd" data-highlight-colour="yellow" style="height: 29px;" title="Цвет фона: Желтый">Артикул (sku) товара</td></tr><tr role="row" style="height: 29px;"><td class="highlight-yellow confluenceTd" data-highlight-colour="yellow" style="height: 29px;" title="Цвет фона: Желтый">price</td><td class="highlight-yellow confluenceTd" data-highlight-colour="yellow" style="height: 29px;" title="Цвет фона: Желтый">decimal</td><td class="highlight-yellow confluenceTd" data-highlight-colour="yellow" style="height: 29px;" title="Цвет фона: Желтый">Цена продажи</td></tr><tr role="row" style="height: 45px;"><td class="highlight-yellow confluenceTd" data-highlight-colour="yellow" style="height: 45px;" title="Цвет фона: Желтый">oldPrice</td><td class="highlight-yellow confluenceTd" data-highlight-colour="yellow" style="height: 45px;" title="Цвет фона: Желтый">decimal</td><td class="highlight-yellow confluenceTd" data-highlight-colour="yellow" style="height: 45px;" title="Цвет фона: Желтый">"Старая" цена. Для визуализации скидки. </td></tr><tr style="height: 29px;"><td style="height: 29px;"><div><div>isFfSynchronised</div></div></td><td style="height: 29px;">boolean</td><td style="height: 29px;">Статус выгрузки товара на ФФ</td></tr><tr style="height: 29px;"><td style="height: 29px;"><div><div>ffSyncError</div></div></td><td style="height: 29px;">string</td><td style="height: 29px;">Ошибка выгрузки товара на ФФ</td></tr><tr style="height: 46px;"><td style="height: 46px;"><div><div>isPhysicalSet</div></div></td><td style="height: 46px;">boolean</td><td style="height: 46px;">Является ли товар физическим набором</td></tr><tr style="height: 29px;"><td style="height: 29px;"><div><div>isFfPhysicalSetSynchronized</div></div></td><td style="height: 29px;">boolean</td><td style="height: 29px;">Статус выгрузки набора на ФФ</td></tr><tr style="height: 29px;"><td style="height: 29px;"><div><div>ffPhysicalSetSyncError</div></div></td><td style="height: 29px;">string</td><td style="height: 29px;">Ошибка выгрузки набора на ФФ</td></tr><tr style="height: 29px;"><td style="height: 29px;"><div><div><div><div>discountPercent</div></div></div></div></td><td style="height: 29px;">decimal</td><td style="height: 29px;">Скидка, в процентах</td></tr><tr style="height: 29px;"><td style="height: 29px;"><div><div><div><div>discountFix</div></div></div></div></td><td style="height: 29px;">decimal</td><td style="height: 29px;">Скидка, фикс</td></tr><tr style="height: 46px;"><td style="height: 46px;"><div><div><div><div>bundleOptionalCount</div></div></div></div></td><td style="height: 46px;">num</td><td style="height: 46px;">Размер опциональной части набора для выбора</td></tr><tr style="height: 29px;"><td style="height: 29px;"><div><div><div><div><div><div>autoPriceCalculation</div></div></div></div></div></div></td><td style="height: 29px;">boolean</td><td style="height: 29px;">Авторасчет цены набора</td></tr><tr style="height: 29px;"><td style="height: 29px;"><div><div><div><div><div><div>autoDimensionsCalculation</div></div></div></div></div></div></td><td style="height: 29px;">boolean</td><td style="height: 29px;">Авторасчет габаритов набора</td></tr><tr style="height: 29px;"><td style="height: 29px;">prices</td><td style="height: 29px;">object</td><td style="height: 29px;">Список всех присвоенных цен</td></tr><tr role="row" style="height: 45px;"><td class="highlight-green confluenceTd" data-highlight-colour="green" style="height: 45px;" title="Цвет фона: Зеленый">stock</td><td class="highlight-green confluenceTd" data-highlight-colour="green" style="height: 45px;" title="Цвет фона: Зеленый">array</td><td class="highlight-green confluenceTd" data-highlight-colour="green" style="height: 45px;" title="Цвет фона: Зеленый">Массив данных об остатках (если остатки на складах имеются)</td></tr><tr style="height: 46px;"><td style="height: 46px;"><div><div>taggedProductsStock</div></div></td><td style="height: 46px;">array</td><td style="height: 46px;">Массив данных об остатках по тегам (если остатки на складах имеются)</td></tr><tr role="row" style="height: 29px;"><td class="highlight-green confluenceTd" data-highlight-colour="green" style="height: 29px;" title="Цвет фона: Зеленый">warehouseCode</td><td class="highlight-green confluenceTd" data-highlight-colour="green" style="height: 29px;" title="Цвет фона: Зеленый">string</td><td class="highlight-green confluenceTd" data-highlight-colour="green" style="height: 29px;" title="Цвет фона: Зеленый">Код склада</td></tr><tr role="row" style="height: 45px;"><td class="highlight-green confluenceTd" data-highlight-colour="green" style="height: 45px;" title="Цвет фона: Зеленый">stockTotal</td><td class="highlight-green confluenceTd" data-highlight-colour="green" style="height: 45px;" title="Цвет фона: Зеленый">decimal</td><td class="highlight-green confluenceTd" data-highlight-colour="green" style="height: 45px;" title="Цвет фона: Зеленый"><span style="color: #333333;">Текущее количество на складе </span>*хранения*</td></tr><tr role="row" style="height: 61px;"><td class="highlight-green confluenceTd" data-highlight-colour="green" style="height: 61px;" title="Цвет фона: Зеленый">stockAvailable</td><td class="highlight-green confluenceTd" data-highlight-colour="green" style="height: 61px;" title="Цвет фона: Зеленый">decimal</td><td class="highlight-green confluenceTd" data-highlight-colour="green" style="height: 61px;" title="Цвет фона: Зеленый"><span style="color: #333333;">Количество товара, доступного к продаже (stockTotal за минусом резерва)</span></td></tr><tr role="row" style="height: 45px;"><td class="highlight-green confluenceTd" data-highlight-colour="green" style="height: 45px;" title="Цвет фона: Зеленый">stockReserved</td><td class="highlight-green confluenceTd" data-highlight-colour="green" style="height: 45px;" title="Цвет фона: Зеленый">decimal</td><td class="highlight-green confluenceTd" data-highlight-colour="green" style="height: 45px;" title="Цвет фона: Зеленый">Количество товара, зарезервированного под заказы.</td></tr><tr role="row" style="height: 45px;"><td class="highlight-yellow confluenceTd" data-highlight-colour="yellow" style="height: 45px;" title="Цвет фона: Желтый">pos</td><td class="highlight-yellow confluenceTd" data-highlight-colour="yellow" style="height: 45px;" title="Цвет фона: Желтый">num</td><td class="highlight-yellow confluenceTd" data-highlight-colour="yellow" style="height: 45px;" title="Цвет фона: Желтый">Порядковый номер варианта, относительно </td></tr><tr role="row" style="height: 61px;"><td class="highlight-yellow confluenceTd" data-highlight-colour="yellow" style="height: 61px;" title="Цвет фона: Желтый">optionsUsed</td><td class="highlight-yellow confluenceTd" data-highlight-colour="yellow" style="height: 61px;" title="Цвет фона: Желтый">array</td><td class="highlight-yellow confluenceTd" data-highlight-colour="yellow" style="height: 61px;" title="Цвет фона: Желтый">Массив, указывающий соответствие опции и её значения для конкретного продукта. </td></tr><tr role="row" style="height: 61px;"><td class="highlight-yellow confluenceTd" data-highlight-colour="yellow" style="height: 61px;" title="Цвет фона: Желтый">defaultImage</td><td class="highlight-yellow confluenceTd" data-highlight-colour="yellow" style="height: 61px;" title="Цвет фона: Желтый">string</td><td class="highlight-yellow confluenceTd" data-highlight-colour="yellow" style="height: 61px;" title="Цвет фона: Желтый">Ссылка на изображение из общего массива изображений. Может быть не задан.</td></tr><tr role="row" style="height: 29px;"><td class="highlight-yellow confluenceTd" data-highlight-colour="yellow" style="height: 29px;" title="Цвет фона: Желтый">weight</td><td class="highlight-yellow confluenceTd" data-highlight-colour="yellow" style="height: 29px;" title="Цвет фона: Желтый">decimal</td><td class="highlight-yellow confluenceTd" data-highlight-colour="yellow" style="height: 29px;" title="Цвет фона: Желтый">Вес товара</td></tr><tr role="row" style="height: 29px;"><td class="highlight-yellow confluenceTd" data-highlight-colour="yellow" style="height: 29px;" title="Цвет фона: Желтый">dimensions</td><td class="highlight-yellow confluenceTd" data-highlight-colour="yellow" style="height: 29px;" title="Цвет фона: Желтый">object</td><td class="highlight-yellow confluenceTd" data-highlight-colour="yellow" style="height: 29px;" title="Цвет фона: Желтый">Содержит информацию о размерах</td></tr><tr style="height: 29px;"><td style="height: 29px;">weightFact</td><td style="height: 29px;">decimal</td><td style="height: 29px;">Вес товара (по данным склада)</td></tr><tr style="height: 46px;"><td style="height: 46px;"><div><div>dimensionsFact</div></div></td><td style="height: 46px;">object</td><td style="height: 46px;">Содержит информацию о размерах (по данным склада)</td></tr><tr style="height: 46px;"><td style="height: 46px;"><div><div>canBeRotated</div></div></td><td style="height: 46px;">boolean</td><td style="height: 46px;">Определяет можно ли товар укладывать на бок при перевозке</td></tr><tr role="row" style="height: 29px;"><td class="highlight-red confluenceTd" data-highlight-colour="red" style="height: 29px;" title="Цвет фона: Красный">barcodes</td><td class="highlight-red confluenceTd" data-highlight-colour="red" style="height: 29px;" title="Цвет фона: Красный">object</td><td class="highlight-red confluenceTd" data-highlight-colour="red" style="height: 29px;" title="Цвет фона: Красный">Список штрихкодов товара</td></tr><tr role="row" style="height: 29px;"><td class="highlight-red confluenceTd" data-highlight-colour="red" style="height: 29px;" title="Цвет фона: Красный">isDefault</td><td class="highlight-red confluenceTd" data-highlight-colour="red" style="height: 29px;" title="Цвет фона: Красный">boolean</td><td class="highlight-red confluenceTd" data-highlight-colour="red" style="height: 29px;" title="Цвет фона: Красный">ШК является по умолчанию</td></tr><tr role="row" style="height: 29px;"><td class="highlight-red confluenceTd" data-highlight-colour="red" style="height: 29px;" title="Цвет фона: Красный">value</td><td class="highlight-red confluenceTd" data-highlight-colour="red" style="height: 29px;" title="Цвет фона: Красный">string</td><td class="highlight-red confluenceTd" data-highlight-colour="red" style="height: 29px;" title="Цвет фона: Красный">Значение ШК</td></tr><tr role="row" style="height: 61px;"><td class="highlight-green confluenceTd" data-highlight-colour="green" style="height: 61px;" title="Цвет фона: Зеленый">images</td><td class="highlight-green confluenceTd" data-highlight-colour="green" style="height: 61px;" title="Цвет фона: Зеленый">array</td><td class="highlight-green confluenceTd" data-highlight-colour="green" style="height: 61px;" title="Цвет фона: Зеленый">Массив изображений продукта. Первое изображение считается основным.</td></tr><tr role="row" style="height: 29px;"><td class="highlight-green confluenceTd" data-highlight-colour="green" style="height: 29px;" title="Цвет фона: Зеленый">id</td><td class="highlight-green confluenceTd" data-highlight-colour="green" style="height: 29px;" title="Цвет фона: Зеленый">string</td><td class="highlight-green confluenceTd" data-highlight-colour="green" style="height: 29px;" title="Цвет фона: Зеленый">Идентификатор изображения</td></tr><tr role="row" style="height: 29px;"><td class="highlight-green confluenceTd" data-highlight-colour="green" style="height: 29px;" title="Цвет фона: Зеленый">url</td><td class="highlight-green confluenceTd" data-highlight-colour="green" style="height: 29px;" title="Цвет фона: Зеленый">string</td><td class="highlight-green confluenceTd" data-highlight-colour="green" style="height: 29px;" title="Цвет фона: Зеленый">URL изображения</td></tr><tr role="row" style="height: 45px;"><td class="highlight-green confluenceTd" data-highlight-colour="green" style="height: 45px;" title="Цвет фона: Зеленый">pos</td><td class="highlight-green confluenceTd" data-highlight-colour="green" style="height: 45px;" title="Цвет фона: Зеленый">decimal</td><td class="highlight-green confluenceTd" data-highlight-colour="green" style="height: 45px;" title="Цвет фона: Зеленый">Позиция изображения в рамках продукта</td></tr><tr role="row" style="height: 45px;"><td class="highlight-yellow confluenceTd" data-highlight-colour="yellow" style="height: 45px;" title="Цвет фона: Желтый">collections</td><td class="highlight-yellow confluenceTd" data-highlight-colour="yellow" style="height: 45px;" title="Цвет фона: Желтый">array</td><td class="highlight-yellow confluenceTd" data-highlight-colour="yellow" style="height: 45px;" title="Цвет фона: Желтый">Массив коллекций, в которые входит продукт</td></tr><tr role="row" style="height: 29px;"><td class="highlight-yellow confluenceTd" data-highlight-colour="yellow" style="height: 29px;" title="Цвет фона: Желтый">id</td><td class="highlight-yellow confluenceTd" data-highlight-colour="yellow" style="height: 29px;" title="Цвет фона: Желтый">string</td><td class="highlight-yellow confluenceTd" data-highlight-colour="yellow" style="height: 29px;" title="Цвет фона: Желтый">Идентификатор коллекции</td></tr><tr role="row" style="height: 29px;"><td class="highlight-blue confluenceTd" data-highlight-colour="blue" style="height: 29px;" title="Цвет фона: Синий">attributes</td><td class="highlight-blue confluenceTd" data-highlight-colour="blue" style="height: 29px;" title="Цвет фона: Синий">array</td><td class="highlight-blue confluenceTd" data-highlight-colour="blue" style="height: 29px;" title="Цвет фона: Синий">Массив значений атрибутов продукта</td></tr><tr role="row" style="height: 29px;"><td class="highlight-blue confluenceTd" data-highlight-colour="blue" style="height: 29px;" title="Цвет фона: Синий">code</td><td class="highlight-blue confluenceTd" data-highlight-colour="blue" style="height: 29px;" title="Цвет фона: Синий">string</td><td class="highlight-blue confluenceTd" data-highlight-colour="blue" style="height: 29px;" title="Цвет фона: Синий">Код атрибута</td></tr><tr role="row" style="height: 29px;"><td class="highlight-blue confluenceTd" data-highlight-colour="blue" style="height: 29px;" title="Цвет фона: Синий">type</td><td class="highlight-blue confluenceTd" data-highlight-colour="blue" style="height: 29px;" title="Цвет фона: Синий">enum</td><td class="highlight-blue confluenceTd" data-highlight-colour="blue" style="height: 29px;" title="Цвет фона: Синий">Тип атрибута (см. описание атрибутов)</td></tr><tr role="row" style="height: 29px;"><td class="highlight-blue confluenceTd" data-highlight-colour="blue" style="height: 29px;" title="Цвет фона: Синий">stringValue</td><td class="highlight-blue confluenceTd" data-highlight-colour="blue" style="height: 29px;" title="Цвет фона: Синий">string</td><td class="highlight-blue confluenceTd" data-highlight-colour="blue" style="height: 29px;" title="Цвет фона: Синий">Значение атрибута (строка)</td></tr><tr role="row" style="height: 29px;"><td class="highlight-blue confluenceTd" data-highlight-colour="blue" style="height: 29px;" title="Цвет фона: Синий">decimalValue</td><td class="highlight-blue confluenceTd" data-highlight-colour="blue" style="height: 29px;" title="Цвет фона: Синий">decimal</td><td class="highlight-blue confluenceTd" data-highlight-colour="blue" style="height: 29px;" title="Цвет фона: Синий">Значение атрибута (число)</td></tr><tr role="row" style="height: 29px;"><td class="highlight-blue confluenceTd" data-highlight-colour="blue" style="height: 29px;" title="Цвет фона: Синий">ordering</td><td class="highlight-blue confluenceTd" data-highlight-colour="blue" style="height: 29px;" title="Цвет фона: Синий">decimal</td><td class="highlight-blue confluenceTd" data-highlight-colour="blue" style="height: 29px;" title="Цвет фона: Синий">Cортировка</td></tr><tr style="height: 29px;"><td style="height: 29px;"><div><div>accountingAttributes</div></div></td><td style="height: 29px;">array</td><td style="height: 29px;">Массив значений атрибутов учета</td></tr><tr style="height: 29px;"><td style="height: 29px;"><div><div>code</div></div></td><td style="height: 29px;">string</td><td style="height: 29px;">Код атрибута</td></tr><tr style="height: 29px;"><td style="height: 29px;">title</td><td style="height: 29px;">string</td><td style="height: 29px;">Название атрибута</td></tr><tr style="height: 29px;"><td style="height: 29px;">stringValue</td><td style="height: 29px;">string</td><td style="height: 29px;">Значение атрибута</td></tr><tr style="height: 45px;"><td style="height: 45px;">subscriptionInfo</td><td style="height: 45px;">object</td><td style="height: 45px;">Описание подписок (Не отображается, если пустой)</td></tr><tr style="height: 29px;"><td style="height: 29px;"><div><div>eshopSettings</div></div></td><td style="height: 29px;">array</td><td style="height: 29px;">Массив внешних кодов для интеграций</td></tr><tr style="height: 29px;"><td style="height: 29px;"><div><div>eshopId</div></div></td><td style="height: 29px;">string</td><td style="height: 29px;">ID интеграции</td></tr><tr style="height: 29px;"><td style="height: 29px;"><div><div>eshopType</div></div></td><td style="height: 29px;">string</td><td style="height: 29px;">Тип интеграции</td></tr><tr style="height: 29px;"><td style="height: 29px;"><div><div>eshopName</div></div></td><td style="height: 29px;">string</td><td style="height: 29px;">Название интеграции</td></tr><tr style="height: 29px;"><td style="height: 29px;"><div><div>enabled</div></div></td><td style="height: 29px;">boolean</td><td style="height: 29px;">Включает товар для интеграции</td></tr><tr style="height: 46px;"><td style="height: 46px;">zeroStock</td><td style="height: 46px;">boolean</td><td style="height: 46px;">Включает выгрузку нулевых остатков по товару</td></tr><tr style="height: 29px;"><td style="height: 29px;"><div><div>extId</div></div></td><td style="height: 29px;">string</td><td style="height: 29px;">Внешний код товара для интеграции</td></tr><tr style="height: 29px;"><td style="height: 29px;">useBatchAccounting</td><td style="height: 29px;">boolean</td><td style="height: 29px;">Флаг использования партионного учета

<span style="color: #999999;">Для ведения учёта сроков годности в партиях необходимо также передать значение USE\_EXPIRATION в поле expirationMode и указать срок годности товара в поле expirationMonthsLimit</span>

</td></tr><tr style="height: 29px;"><td style="height: 29px;">expirationMode</td><td style="height: 29px;">enum</td><td style="height: 29px;">NO\_EXPIRATION, USE\_EXPIRATION - использование сроков годности в партиях</td></tr><tr style="height: 29px;"><td style="height: 29px;">expirationMonthsLimit</td><td style="height: 29px;">integer</td><td style="height: 29px;">Срок годности в мес</td></tr><tr style="height: 29px;"><td style="height: 29px;">manufacturedBy</td><td style="height: 29px;">string</td><td style="height: 29px;">Производитель</td></tr><tr style="height: 29px;"><td style="height: 29px;">composition</td><td style="height: 29px;">string</td><td style="height: 29px;">Состав продукта</td></tr><tr style="height: 29px;"><td style="height: 29px;">warranty</td><td style="height: 29px;">integer</td><td style="height: 29px;">Срок гарантии в мес</td></tr><tr style="height: 29px;"><td style="height: 29px;"><div><div>warehouseCategoryCode</div></div></td><td style="height: 29px;">string</td><td style="height: 29px;">Код категории товара (из WMS)</td></tr><tr style="height: 29px;"><td style="height: 29px;"><div><div>warehouseCategoryTitle</div></div></td><td style="height: 29px;">string</td><td style="height: 29px;">Наименование категории товара (из WMS)</td></tr><tr style="height: 29px;"><td style="height: 29px;"><div><div>tag</div></div></td><td style="height: 29px;">string</td><td style="height: 29px;">Тег, присвоенный товару</td></tr></tbody></table>

#### **Пример результата запроса**:

```JSON
{
    "success": true,
    "recordsTotal": 1,
    "products": [
        {
            "id": "1000",
            "extId": null,
          	"extId2": null,
            "extId3": null,
            "extId4": null,
            "extId5": null,
            "shortName": "Кактус Эуфобия Триангуларис",
            "description": "Кактус Эуфобия Триангуларис",
            "tnvedCode": "123",
            "internationalDescription": "abc",
            "additionalDescriptions":[{"title":"some title", "description":"some description"}],
            "available": true,
            "deleted": false,
            "brandName": null,
            "countryOfOrigin": null,
            "isBestseller": null,
            "isNovelty": null,
            "type": "SKU",
            "vat": "VAT_20",
            "reviewScore": 4.0,
            "options": null,
            "images": null,
          	"useBatchAccounting": true,
            "expirationMode": "USE_EXPIRATION",
            "expirationMonthsLimit": 6,
          	"warranty": 12,
            "warehouseCategoryCode": "000000001",
            "warehouseCategoryTitle": "Парфюмерия"
          	"manufacturedBy": "Название производителя",
            "composition": "Состав",            
            "variants": [
                {
                    "id": "1000",
                    "extId": null,
                  	"extId2": null,
                    "extId3": null,
                    "extId4": null,
                    "extId5": null,
                    "article": null,
                    "price": 2190,
                    "oldPrice": 1590,
                    "isFfSynchronised": true,
                    "ffSyncError": null,
                    "isPhysicalSet": false,
                    "isFfPhysicalSetSynchronized": false,
                    "ffPhysicalSetSyncError": null,
                  	"discountPercent": 0,
                    "discountFix": 0,
                    "bundleOptionalCount": 0,
                    "autoPriceCalculation": false,
                    "autoDimensionsCalculation": false,
                  	"prices":[
                        {
                           "priceCode":"Розничная цена",
                           "priceName":"Розничная цена",
                           "value":2190
                        },
                      	{
                           "priceCode":"Цена до скидки",
                           "priceName":"Цена до скидки",
                           "value":1590
                        }
                     ],
                    "stock": [
                        {
                            "warehouseCode": "9a84e96f-3e8c-8f74-3b7a-50a1d3c2a130",
                            "stockTotal": 111,
                            "stockAvailable": 111,
                            "stockReserved": 0
                        }
                    ],
                    "taggedProductsStock": [
                        {
                            "outOfStock": 0,
                            "stockAvailable": 10,
                            "stockDefective": 0,
                            "stockDefectiveReserved": 0,
                            "stockReserved": 0,
                            "stockTotal": 10,
                            "tag": "ROZNECHNIE_SETY",
                            "warehouseCode": "9a84e96f-3e8c-8f74-3b7a-50a1d3c2a130"
                        }
                     ],
                    "ordering": "123.000000000000000",
                    "defaultImage": null,
                    "weight": 500,
                    "dimensions": {
                        "height": 4,
                        "width": 20,
                        "depth": 4
                    },
                    "weightFact": 500,
                    "dimensionsFact": {
                        "height": 4,
                        "width": 20,
                        "depth": 4
                    },
                    "canBeRotated": true,
                    "barcodes": [
                        {
                            "value": "42353456345345",
                            "isDefault": true,
                            "type": "COMMON"
                        },
                        {
                            "value": "34234232343",
                            "isDefault": false,
                          	"type": "WILDBERRIES"
                        }
                    ],                 
                    "optionsUsed": null,
                  	"eshopSettings": [
                        {
                            "eshopId": "e4a1920d-f154-7284-bad4-a7b9546032fe",
                            "eshopType": "BERU",
                            "eshopName": "Магазин на Беру",
                            "enabled": true,
                          	"zeroStock": false,
                            "extId": "variant-ext-id-for-beru"
                        }
                    ]
                }
            ],
            "collections": [
                "1001"
            ],
            "attributes": null,
            "accountingAttributes": [
                {
                    "code": "chestnyznak",
                    "title": "Честный знак",
                    "stringValue": "11111"
                }
            ],
          	"eshopSettings": [
                {
                  "eshopId": "e4a1920d-f154-7284-bad4-a7b9546032fe",
                  "eshopType": "BERU",
                  "eshopName": "Магазин на Беру",
                  "enabled": true,
                  "extId": "product-ext-id-for-beru"
                }
            ]
          	"subscriptionInfo": {
              "productId": "1002",
              "variantId": "1002",
              "onlinePaymentType": "recurrent",
              "type": "SUBSCRIPTION",
              "useShipmentDelayInterval": true,
              "items": [
                  {
                      "productId": "1002",
                      "variantId": "1006",
                      "count": 1,
                      "subscriptionShipmentNum": 1,
                      "shipmentDelayIntervalDays": 30,
                      "subscriptionStartDate": "2020-09-10",
                      "itemPrice": 120.0
                  },
                  {
                      "productId": "1002",
                      "variantId": "1007",
                      "count": 1,
                      "subscriptionShipmentNum": 1,
                      "shipmentDelayIntervalDays": 30,
                      "subscriptionStartDate": "2020-09-10",
                      "itemPrice": 120.0
                  },
                  {
                      "productId": "1002",
                      "variantId": "1008",
                      "count": 1,
                      "subscriptionShipmentNum": 2,
                      "shipmentDelayIntervalDays": 20,
                      "subscriptionStartDate": "2020-09-30",
                      "itemPrice": 150.0
                  },
                  {
                      "productId": "1002",
                      "variantId": "1009",
                      "count": 1,
                      "subscriptionShipmentNum": 2,
                      "shipmentDelayIntervalDays": 20,
                      "subscriptionStartDate": "2020-09-30",
                      "itemPrice": 150.0
                  },
                  {
                      "productId": "1002",
                      "variantId": "1010",
                      "count": 1,
                      "subscriptionShipmentNum": 3,
                      "shipmentDelayIntervalDays": 20,
                      "subscriptionStartDate": "2020-10-20",
                      "itemPrice": 250.0
                    }
                   ]
                }
          }
        }
    ]
}
```

#### **Выгружать только остатки (специальный режим выгрузки)**

Дополнительно можно передать параметр ?only\_stock=true. Если он присутствует в запросе, то выгружается минимально необходимое кол-во полей.

Пример: `/api/lite/products?only_stock=true`

<p class="callout info">Максимальное количество продуктов в режиме остатков - 1000. Даже если указано значение более 1000</p>

#### **Пример результата запроса(режим остатков)**:

``

```JSON
{
    "success": true,
    "recordsTotal": 1322,
    "products": [
        {
            "id": "1000",
            "extId": null,
            "extId2": null,
            "extId3": null,
            "extId4": null,
            "extId5": null,
            "variants": [
                {
                    "id": "1000",
                    "extId": null,
                    "extId2": null,
                    "extId3": null,
                    "extId4": null,
                    "extId5": null,
                    "stock": [
                        {
                            "warehouseCode": "5a93f7e7-4785-0332-8324-bf3a03ee8211",
                            "stockTotal": 10,
                            "stockAvailable": 8,
                            "stockReserved": 2,
                            "stockDefective": 0,
                            "stockDefectiveReserved": 0
                        }
                    ],
                    "taggedProductsStock": [
                        {
                            "outOfStock": 0,
                            "stockAvailable": 10,
                            "stockDefective": 0,
                            "stockDefectiveReserved": 0,
                            "stockReserved": 0,
                            "stockTotal": 10,
                            "tag": "ROZNECHNIE_SETY",
                            "warehouseCode": "5a93f7e7-4785-0332-8324-bf3a03ee8211"
                        }
                     ]
                }
            ]
        }
    ]
}
```

####  

### Создание/обновление продукта (POST /api/lite/products)

/api/lite/products

Создает или обновляет продукт.

Если id указан - проводится обновление продукта с указанным id, если не указан - создается новый.

Если проводится обновление продукта (или варианта) - то обновляются все поля на те, что переданы. Если какие то поля в продукте были непустые, а в запросе они не переданы - то после обновления поля очищаются.

Опционально можно передавать список вариантов товара для обновления, в поле variantsToUpdate. Обновление продукта выполняется первым, если успешно - то начинается обновление вариантов.

Этот список не означает, что коллекция вариантов данного продукта будет приведена к виду в переданном списке вариантов. Будет выполнено только обновление указанных вариантов, безотносительно остальных вариантов их продукта.

Если передан список вариантов - то в ответе в поле variantsResult будет список результатов обновления по каждому варианту, для сопоставления на вызывающей стороне (по полям productId + variantId)

<table class="relative-table wrapped confluenceTable tablesorter tablesorter-default" id="bkmrk-%D0%9F%D0%BE%D0%BB%D0%B5-%D0%A2%D0%B8%D0%BF-%2F-%D1%84%D0%BE%D1%80%D0%BC%D0%B0%D1%82-%D0%9E%D0%BF-0" role="grid" style="height: 834px;"><tbody aria-live="polite" aria-relevant="all"><tr style="height: 35px;"><td style="width: 171.163px; height: 35px;">**Поле**</td><td style="width: 125px; height: 35px;">**Тип / формат**</td><td style="width: 511.997px; height: 35px;">**Описание**

</td></tr><tr role="row" style="height: 57px;"><td class="confluenceTd" style="width: 171.163px; height: 57px;">id</td><td class="confluenceTd" style="width: 125px; height: 57px;">string</td><td class="confluenceTd" style="width: 511.997px; height: 57px;">Идентификатор продукта. Если не указан, создается новый продукт. Если указан, обновляется продукт с данным id<span style="color: #999999;"> или создаётся новый продукт с пользовательским id.</span>

</td></tr><tr role="row" style="height: 29px;"><td class="confluenceTd" style="width: 171.163px; height: 29px;">extId</td><td class="confluenceTd" style="width: 125px; height: 29px;">string</td><td class="confluenceTd" style="width: 511.997px; height: 29px;">Дополнительный идентификатор продукта</td></tr><tr role="row" style="height: 29px;"><td class="confluenceTd" style="width: 171.163px; height: 29px;">shortName</td><td class="confluenceTd" style="width: 125px; height: 29px;">string</td><td class="confluenceTd" style="width: 511.997px; height: 29px;">Наименование продукта</td></tr><tr role="row" style="height: 29px;"><td class="confluenceTd" style="width: 171.163px; height: 29px;">description</td><td class="confluenceTd" style="width: 125px; height: 29px;">string</td><td class="confluenceTd" style="width: 511.997px; height: 29px;">Описание (может содержать html)</td></tr><tr role="row" style="height: 29px;"><td class="confluenceTd" style="width: 171.163px; height: 29px;">tnvedCode</td><td class="confluenceTd" style="width: 125px; height: 29px;">string</td><td class="confluenceTd" style="width: 511.997px; height: 29px;">Код ТНВЭД</td></tr><tr role="row" style="height: 29px;"><td class="confluenceTd" style="width: 171.163px; height: 29px;">internationalDescription</td><td class="confluenceTd" style="width: 125px; height: 29px;">string</td><td class="confluenceTd" style="width: 511.997px; height: 29px;">Описание на анлийском</td></tr><tr role="row" style="height: 29px;"><td class="confluenceTd" style="width: 171.163px; height: 29px;">available</td><td class="confluenceTd" style="width: 125px; height: 29px;">boolean</td><td class="confluenceTd" style="width: 511.997px; height: 29px;">Отображение для продажи в онлайн-магазине</td></tr><tr role="row" style="height: 29px;"><td class="confluenceTd" style="width: 171.163px; height: 29px;">deleted</td><td class="confluenceTd" style="width: 125px; height: 29px;">boolean</td><td class="confluenceTd" style="width: 511.997px; height: 29px;">Архивная карточка</td></tr><tr role="row" style="height: 29px;"><td class="confluenceTd" style="width: 171.163px; height: 29px;">type</td><td class="confluenceTd" style="width: 125px; height: 29px;">enum</td><td class="confluenceTd" style="width: 511.997px; height: 29px;">Тип продукта. SKU/PHYSICAL\_SET/SERVICE. Товар, набор товаров, услуга</td></tr><tr role="row" style="height: 29px;"><td class="confluenceTd" style="width: 171.163px; height: 29px;">vat</td><td class="confluenceTd" style="width: 125px; height: 29px;">enum</td><td class="confluenceTd" style="width: 511.997px; height: 29px;">НДС товара. NO\_VAT/VAT\_0/VAT\_10/VAT\_20</td></tr><tr role="row" style="height: 29px;"><td class="confluenceTd" style="width: 171.163px; height: 29px;">collections</td><td class="confluenceTd" style="width: 125px; height: 29px;">array</td><td class="confluenceTd" style="width: 511.997px; height: 29px;">Массив идентификаторов коллекций, в который входит данный продукт</td></tr><tr role="row" style="height: 29px;"><td class="highlight-red confluenceTd" data-highlight-colour="red" style="width: 171.163px; height: 29px;" title="Цвет фона: Красный">attributes</td><td class="highlight-red confluenceTd" data-highlight-colour="red" style="width: 125px; height: 29px;" title="Цвет фона: Красный">array</td><td class="highlight-red confluenceTd" data-highlight-colour="red" style="width: 511.997px; height: 29px;" title="Цвет фона: Красный">Массив значений атрибутов продукта</td></tr><tr role="row" style="height: 29px;"><td class="highlight-red confluenceTd" data-highlight-colour="red" style="width: 171.163px; height: 29px;" title="Цвет фона: Красный">code</td><td class="highlight-red confluenceTd" data-highlight-colour="red" style="width: 125px; height: 29px;" title="Цвет фона: Красный">string</td><td class="highlight-red confluenceTd" data-highlight-colour="red" style="width: 511.997px; height: 29px;" title="Цвет фона: Красный">Код атрибута</td></tr><tr role="row" style="height: 29px;"><td class="highlight-red confluenceTd" data-highlight-colour="red" style="width: 171.163px; height: 29px;" title="Цвет фона: Красный">stringValue</td><td class="highlight-red confluenceTd" data-highlight-colour="red" style="width: 125px; height: 29px;" title="Цвет фона: Красный">string</td><td class="highlight-red confluenceTd" data-highlight-colour="red" style="width: 511.997px; height: 29px;" title="Цвет фона: Красный">Значение атрибута (строка)</td></tr><tr role="row" style="height: 29px;"><td class="highlight-red confluenceTd" data-highlight-colour="red" style="width: 171.163px; height: 29px;" title="Цвет фона: Красный">decimalValue</td><td class="highlight-red confluenceTd" data-highlight-colour="red" style="width: 125px; height: 29px;" title="Цвет фона: Красный">decimal</td><td class="highlight-red confluenceTd" data-highlight-colour="red" style="width: 511.997px; height: 29px;" title="Цвет фона: Красный">Значение атрибута (число)</td></tr><tr style="height: 29px;"><td style="width: 171.163px; height: 29px;">accountingAttributes</td><td style="width: 125px; height: 29px;">array</td><td style="width: 511.997px; height: 29px;">Массив значений атрибутов учета</td></tr><tr style="height: 29px;"><td style="width: 171.163px; height: 29px;">code</td><td style="width: 125px; height: 29px;">string</td><td style="width: 511.997px; height: 29px;">Код атрибута</td></tr><tr style="height: 29px;"><td style="width: 171.163px; height: 29px;">stringValue</td><td style="width: 125px; height: 29px;">string</td><td style="width: 511.997px; height: 29px;">Значение атрибута</td></tr><tr style="height: 29px;"><td style="width: 171.163px; height: 29px;"><div><div>eshopSettings</div></div></td><td style="width: 125px; height: 29px;">array</td><td style="width: 511.997px; height: 29px;">Массив внешних кодов для интеграций</td></tr><tr style="height: 29px;"><td style="width: 171.163px; height: 29px;"><div><div>eshopId</div></div></td><td style="width: 125px; height: 29px;">string</td><td style="width: 511.997px; height: 29px;">ID интеграции</td></tr><tr style="height: 29px;"><td style="width: 171.163px; height: 29px;">enabled</td><td style="width: 125px; height: 29px;">boolean</td><td style="width: 511.997px; height: 29px;">Включает товар для интеграции</td></tr><tr style="height: 29px;"><td style="width: 171.163px; height: 29px;"><div><div>extId</div></div></td><td style="width: 125px; height: 29px;">string</td><td style="width: 511.997px; height: 29px;">Внешний код продукта для интеграции</td></tr><tr role="row" style="height: 29px;"><td class="confluenceTd" style="width: 171.163px; height: 29px;">variantsToUpdate</td><td class="confluenceTd" style="width: 125px; height: 29px;">объект</td><td class="confluenceTd" style="width: 511.997px; height: 29px;">Объект варианта товара (см. [POST /api/lite/products/variants](http://wiki.kak2c.ru/books/kaktus-dlya-razrabotchikov/page/apiliteproductsvariants))</td></tr><tr style="height: 46px;"><td style="width: 171.163px; height: 46px;">warehouseCategoryCode</td><td style="width: 125px; height: 46px;">string</td><td style="width: 511.997px; height: 46px;">Код категории товара (из WMS)</td></tr><tr style="height: 29px;"><td style="width: 171.163px; height: 29px;"><span class="name" title="parentPackageId">parentPackageId</span></td><td style="width: 125px; height: 29px;">string</td><td style="width: 511.997px; height: 29px;">Родительский вариант для монокороба</td></tr><tr><td style="width: 171.163px;"><div><div>countryOfOrigin</div></div></td><td style="width: 125px;">string</td><td style="width: 511.997px;"><div><div>Страна изготовления, указывается код страны RU</div></div></td></tr><tr><td style="width: 171.163px;"><div><div>brandName</div></div></td><td style="width: 125px;">string</td><td style="width: 511.997px;"><div><div>Наименование бренда</div></div></td></tr><tr style="height: 29px;"><td style="width: 171.163px; height: 29px;"><span class="name" title="multiplicity">multiplicity</span></td><td style="width: 125px; height: 29px;">string</td><td style="width: 511.997px; height: 29px;">Кратность монокороба</td></tr></tbody></table>

####  

#### **Пример вызова:**

<div id="bkmrk-%D0%9F%D1%80%D0%B8%D0%BC%D0%B5%D1%80-%D0%B7%D0%B0%D0%BF%D1%80%D0%BE%D1%81%D0%B0-%E2%84%961.">Пример запроса №1.</div>```JSON
{
      "id": "1015",
      "extId": "FAQ-D-000112",
      "extId2": null,
      "extId3": null,
      "extId4": null,
      "extId5": null,
      "shortName": "Limited Edition Паста (помада) для укладки волос Bro Cosmetics // средняя фиксация, матовый эффект",
      "description": "Limited Edition Паста (помада) для укладки волос Bro Cosmetics // средняя фиксация, матовый эффект",
  	  "additionalDescriptions":[{"title":"some title", "description":"some description"}],
      "available": true,
      "deleted": false,
      "brandName": null,
      "countryOfOrigin": null,
      "tnvedCode": "123",
      "internationalDescription": "abc",
      "isBestseller": null,
      "isNovelty": null,
      "type": "SKU",
      "vat": "NO_VAT",
      "warehouseCategoryCode": "000000001",
    "collections": [
        "1029",
        "1031"
    ], 
    "attributes": [
        {
            "code": "material",        
            "stringValue": "Хлопок 97%, эластан 3%"        
        }
    ],
    "accountingAttributes": [
        {
          "code": "chestnyznak",
          "stringValue": "11111"
        }
    ],
  	"eshopSettings": [
        {
          "eshopId": "e4a1920d-f154-7284-bad4-a7b9546032fe",
          "enabled": true,
          "extId": "product-ext-id-for-beru"
        }
    ],
    "variantsToUpdate": [
            {
                    "productId":"1002",
                    "variantId": "1007",
              		"extId": null,
                    "extId2": null,
                    "extId3": null,
                    "extId4": null,
                    "extId5": null,
                    "article": "well done",
                    "price": 6000, //deprecated
                    "oldPrice": 6500, //deprecated
              		"prices":[
                        {
                           "priceCode":"Розничная цена",
                           "value":6000
                        },
                      	{
                           "priceCode":"Цена до скидки",
                           "value":6500
                        }
                     ],
                    "stock": [
                        {
                           "warehouseCode": "9a84e96f-3e8c-8f74-3b7a-50a1d3c2a130",                         
                           "stockTotal": 111                          
                        }
                    ],
                    "updateStockTotal": true,                  
                    "ordering": "300.000000000000000",
                    "defaultImage": null,
                    "weight": 500,
                    "dimensions": {
                        "height": 30,
                        "width": 31,
                        "depth": 32
                    },
                    "canBeRotated": true,
                    "optionsUsed": [
                        {
                            "code": "color",
                            "stringValue": "синий",
                            "decimalValue": null,
                            "name": "Цвет"
                        }
                    ],
                    "eshopSettings": [
                        {
                          "eshopId": "e4a1920d-f154-7284-bad4-a7b9546032fe",
                          "enabled": true,
                          "extId": "variant-ext-id-for-beru"
                        }
                    ],
              		"discountType": "PERCENT", // FIX
              		"discountValue": 50
                }
        ]
}
```

Пример запроса №2. Минимальный набор данных для создания карточки товара.

```JSON
{
      "id": "1065", // id продукта      
      "shortName": "Limited Edition Паста (помада) для укладки волос Bro Cosmetics ", //Наименование продукта
      "description": "Limited Edition Паста (помада) для укладки волос Bro Cosmetics ",  //Описание (может содержать html)    
      "available": true, //Отображение для продажи в онлайн-магазине
      "deleted": false, //Архивная карточка
      "brandName": null,//Наименование бренда
      "countryOfOrigin": null, //Страна изготовления, указывается код страны RU
      "tnvedCode": "1234567890", //Код ТНВЭД
      "internationalDescription": "abc",    
      "type": "SKU", //Тип продукта. SKU/PHYSICAL_SET/SERVICE.    Товар, набор товаров, услуга
      "vat": "VAT_20", //НДС товара. NO_VAT/VAT_0/VAT_10/VAT_20 
        "variantsToUpdate": [
            {
                    "productId":"1065", // id продукта 
                    "variantId": "1066",  // id варианта              
                    "article": "well done", //Артикул (sku) товара
                    "price": 6000, //Цена продажи
                    "oldPrice": 6500,//"Старая" цена. Для визуализации скидки.         
                    "weight": 500, //Вес
                    "dimensions": {
                        "height": 30, //Высота
                        "width": 31, //Ширина
                        "depth": 32 //Глубина
                    }                  
                  
                }
        ]
}
```

####  **Пример положительного ответа:**

<div id="bkmrk-%D0%92-%D0%B7%D0%B0%D0%B2%D0%B8%D1%81%D0%B8%D0%BC%D0%BE%D1%81%D1%82%D0%B8-%D0%BE%D1%82-%D1%81%D0%BE%D1%81">В зависимости от состояния конфига needApiProductsReturnDetails в настройках аккаунта([http://app.kak2c.ru/#!settings/lite](http://app.kak2c.ru/#!settings/lite)) есть два варианта ответа: развернутый и сокращенный. Время выполнения сокращенного ответа значительно меньше, что позволяет загружать товары большими массивами. По умолчанию новые аккаунты создаются с сокращенным вариантом ответа.</div><div id="bkmrk--0"></div><div id="bkmrk-%D0%9F%D1%80%D0%B8%D0%BC%D0%B5%D1%80-%D1%81%D0%BE%D0%BA%D1%80%D0%B0%D1%89%D0%B5%D0%BD%D0%BD%D0%BE%D0%B3%D0%BE-">Пример сокращенного ответа:</div>```JSON
{
    "success": true,
    "id": "1002"
}
```

<div id="bkmrk-%D0%9F%D1%80%D0%B8%D0%BC%D0%B5%D1%80-%D1%80%D0%B0%D0%B7%D0%B2%D0%B5%D1%80%D0%BD%D1%83%D1%82%D0%BE%D0%B3%D0%BE-">Пример развернутого ответа:</div>```JSON
{
    "success": true,
    "id": "1002",
    "product": {
        "id": "1002",
        "extId": "FAQ-D-000112",
        "extId2": null,
        "extId3": null,
        "extId4": null,
        "extId5": null,
        "shortName": "Limited Edition Паста (помада) для укладки волос Bro Cosmetics // средняя фиксация, матовый эффект",
        "description": "Limited Edition Паста (помада) для укладки волос Bro Cosmetics // средняя фиксация, матовый эффект",
      	"additionalDescriptions":[{"title":"some title", "description":"some description"}],
        "available": true,
        "deleted": false,
        "brandName": null,
        "countryOfOrigin": null,
        "tnvedCode": "123",
        "internationalDescription": "abc",
        "isBestseller": null,
        "isNovelty": null,
        "type": "SKU",
        "vat": "NO_VAT",
        "reviewScore": null,
        "options": null,
        "images": null,
        "variants": [
            {
                "productId":"1002",
                "variantId": "1007",
              	"extId": null,
                "extId2": null,
                "extId3": null,
                "extId4": null,
                "extId5": null,
                "article": "well done",
                "price": 6000,
                "oldPrice": 6500,
              	"prices":[
                        {
                           "priceCode":"Розничная цена",
                           "priceName":"Розничная цена",
                           "value":6000
                        },
                      	{
                           "priceCode":"Цена до скидки",
                           "priceName":"Цена до скидки",
                           "value":6500
                        }
                     ],
                "stock": [
                        {
                            "warehouseCode": "9a84e96f-3e8c-8f74-3b7a-50a1d3c2a130",
                            "stockTotal": 111,
                            "stockAvailable": 111,
                            "stockReserved": 0
                        }
                    ],
                "ordering": "300.000000000000000",
                "defaultImage": null,
                "weight": 500,
                "dimensions": {
                    "height": 30,
                    "width": 31,
                    "depth": 32
                },
                "barcodes": null,
                "vat": "NO_VAT",
                "type": "SKU",
                "optionsUsed": [
                    {
                        "code": "color",
                        "stringValue": "синий",
                        "decimalValue": null,
                        "name": "Цвет"
                    }
                ]
            }
        ],
        "collections": [
            "1029",
            "1031"
        ], 
        "attributes": [
            {
                "code": "material",        
                "stringValue": "Хлопок 97%, эластан 3%"        
            }
        ],
        "accountingAttributes": [
            {
              "code": "chestnyznak",
              "title": "Честный знак",
              "stringValue": "11111"
            }
        ],
    },
    "variantsResult": [
        {
            "success": true,
            "productId": "1002",
            "variantId": "1003"
        }
    ]
}
```

####  

#### **Пример положительного ответа с ошибкой сохранения по указанному варианту:**

<div id="bkmrk-%D0%9F%D1%80%D0%B8%D0%BC%D0%B5%D1%80-%D0%BE%D1%82%D0%B2%D0%B5%D1%82%D0%B0">Пример ответа</div>```JSON
{
    "success": true,
    "id": "1002",
    "variantsResult": [
        {
            "success": false,
            "errors": [
                {
                    "code": 0,
                    "message": "Вариант с указанным id не найден"
                }
            ],
            "productId": "1002",
            "variantId": "100343"
        }
    ],
    "product": {
        "id": "1002",
        "extId": "FAQ-D-000112",
      	"extId2": null,
        "extId3": null,
        "extId4": null,
        "extId5": null,
        "shortName": "Limited Edition Паста (помада) для укладки волос Bro Cosmetics // средняя фиксация, матовый эффект",
        "description": "Limited Edition Паста (помада) для укладки волос Bro Cosmetics // средняя фиксация, матовый эффект",
        "available": true,
        "deleted": false,
        "brandName": null,
        "countryOfOrigin": null,
        "tnvedCode": "123",
        "internationalDescription": "abc",
        "isBestseller": null,
        "isNovelty": null,
        "type": "SKU",
        "vat": "NO_VAT",
        "reviewScore": null,
        "options": null,
        "images": null,
        "variants": [
            {
                "productId":"1002",
                "variantId": "1007",
               	"extId": null,
                "extId2": null,
                "extId3": null,
                "extId4": null,
                "extId5": null,
                "article": "well done",
                "price": 6000,
                "oldPrice": 6500,
                "stock": [
                        {
                            "warehouseCode": "9a84e96f-3e8c-8f74-3b7a-50a1d3c2a130",
                            "stockTotal": 111,
                            "stockAvailable": 111,
                            "stockReserved": 0
                        }
                    ],
                "ordering": "300.000000000000000",
                "defaultImage": null,
                "weight": 500,
                "dimensions": {
                    "height": 30,
                    "width": 31,
                    "depth": 32
                },
                "barcodes": null,
                "vat": "NO_VAT",
                "type": "SKU",
                "optionsUsed": [
                    {
                        "code": "color",
                        "stringValue": "синий",
                        "decimalValue": null,
                        "name": "Цвет"
                    }
                ]
            }
        ],
        "collections": [
            "1029",
            "1031"
        ], 
        "attributes": [
            {
                "code": "material",        
                "stringValue": "Хлопок 97%, эластан 3%"        
            }
        ],
        "accountingAttributes": [
            {
              "code": "chestnyznak",
              "title": "Честный знак",
              "stringValue": "11111"
            }
        ],
    }
}
```

#### **Пример вызова c изменением карточки монокороба:**

**Пример запроса**

```
{
    "dimensions": {
        "width": "11",
        "height": "11",
        "depth": "5"
    },
    "id": "566335465",
    "isFfPhysicalSetSynchronized": false,
    "isFfSynchronised": true,
    "isPhysicalSet": false,
    "marginParams": {
        "marketplaceCosts": []
    },
    "multiplicity": 5,
    "parentPackageId": "566335464",
    "shortName": "test (Короб 5 шт, test monokorob)",
    "stock": [
        {
            "outOfStock": 0,
            "stockAvailable": 0,
            "stockDefective": 0,
            "stockDefectiveReserved": 0,
            "stockExpired": 0,
            "stockReserved": 0,
            "stockTotal": 0,
            "warehouseCode": "21ad85be-09a9-c4f8-72e1-4976f9d5bda6"
        },
        {
            "outOfStock": 0,
            "stockAvailable": 0,
            "stockDefective": 0,
            "stockDefectiveReserved": 0,
            "stockExpired": 0,
            "stockReserved": 0,
            "stockTotal": 0,
            "warehouseCode": "6a50a3fe-29b6-42d7-2be0-a19a01d1f288"
        },
        {
            "outOfStock": 0,
            "stockAvailable": 0,
            "stockDefective": 0,
            "stockDefectiveReserved": 0,
            "stockExpired": 0,
            "stockReserved": 0,
            "stockTotal": 0,
            "warehouseCode": "9c639eca-7c7d-9231-5c1c-fbc3a84ac7f9"
        },
        {
            "outOfStock": 0,
            "stockAvailable": 0,
            "stockDefective": 0,
            "stockDefectiveReserved": 0,
            "stockExpired": 0,
            "stockReserved": 0,
            "stockTotal": 0,
            "warehouseCode": "a25965c4-06bd-9691-d468-1221371f1e71"
        }
    ],
    "type": "SKU",
    "vat": "VAT_0",
    "prices": [
        {
            "priceCode": "Розничная цена",
            "priceName": "Розничная цена",
            "value": 0
        },
        {
            "priceCode": "Цена до скидки",
            "priceName": "Цена до скидки",
            "value": 0
        }
    ],
    "weight": 1000,
    "weightType": "kg",
    "barcodes": [],
    "updateStockTotal": false,
    "eshopSettings": [],
    "productId": "1256635834",
    "isArchived": false,
    "variantId": "566335465"
}
```

### Обновление отдельных полей продукта (PATCH /api/lite/products)

/api/lite/products

Обновляет одно или несколько полей продукта, значения отсутствующих в запросе полей при этом не изменяются.

Тело запроса аналогично [POST /api/lite/products](http://wiki.kak2c.ru/link/62#bkmrk-%D0%A1%D0%BE%D0%B7%D0%B4%D0%B0%D0%BD%D0%B8%D0%B5%2F%D0%BE%D0%B1%D0%BD%D0%BE%D0%B2%D0%BB%D0%B5%D0%BD%D0%B8%D0%B5-)

id - необходимо указывать обязательно

#### **Пример вызова:**

<div id="bkmrk-%D0%9F%D1%80%D0%B8%D0%BC%D0%B5%D1%80-%D0%B7%D0%B0%D0%BF%D1%80%D0%BE%D1%81%D0%B0">Пример запроса</div>```JSON
{
      "id": "1015",
      "shortName": "Limited Edition Паста (помада) для укладки волос",
  	  "internationalDescription": "abc"
}
```

ответ аналогичен [POST /api/lite/products](http://wiki.kak2c.ru/link/62#bkmrk-%D0%9F%D1%80%D0%B8%D0%BC%D0%B5%D1%80-%D0%BF%D0%BE%D0%BB%D0%BE%D0%B6%D0%B8%D1%82%D0%B5%D0%BB%D1%8C%D0%BD%D0%BE%D0%B3)

### Копирование продукта

/api/lite/products/copy

id - код существующего продукта для копирования

#### **Запрос**

```JSON
{
     "id": "1234"            
}
```

####  

#### **Пример успешного ответа**

```JSON
{
    "success": true,
    "id": "1234-copy"
}
```

<div id="bkmrk--1"></div>#### **В случае ошибки:**

```JSON
{
    "success": false,
    "errors": [
        {
            "code": 0,
            "message": "Текст ошибки"
        }
    ]  
}
```