Skip to content

Цены товаров ​

Установленные цены продажи товаров компании — раздел «Переоценка товаров»: список цен, сводка и минимальная цена продажи.

МетодАдресНазначение
GET/company/product/price/statsСводка переоценки
PATCH/company/product/price/min-price-percentЗадать процент мин. цены
PATCH/company/product/price/{model}/min-priceЗадать мин. цену товара
GET/company/product/priceСписок цен
GET/company/product/price/{model}Просмотр цены

Сводка переоценки ​

GET/company/product/price/stats

Шапка раздела «Переоценка товаров»: avg_markup_percent — средняя наценка по последней переоценке каждого товара, potential_profit_uzs — сумма (цена продажи − себестоимость последнего прихода) по всем товарам с ценой в UZS по курсам компании, price_tag — первый ценник компании для печати.

Заголовки ​

ЗаголовокЗначениеОписание
AuthorizationBearer {token}Токен из POST /common/auth/login
Acceptapplication/jsonОтвет в JSON
Accept-LanguageruЯзык сообщений и названий: ru, uz, oz

Ответ · 200 ​

Поля ответа
ПолеТипОписание
avg_markup_percentnull
potential_profit_uzsinteger
price_tagobject
price_tag.idintegerID
price_tag.creator_idintegerСоздатель
price_tag.company_idintegerКомпания
price_tag.namestringНазвание
price_tag.widthintegerШирина
price_tag.heightintegerВысота
price_tag.elementsobject[]Элементы
price_tag.elements[].xinteger
price_tag.elements[].yinteger
price_tag.elements[].textstringТекст
price_tag.elements[].typestringТип
price_tag.elements[].colorstringЦвет
price_tag.elements[].fontSizeinteger
price_tag.is_defaultboolean
price_tag.created_atstringСоздано
price_tag.updated_atstringОбновлено
price_tag.is_deletedboolean
json
{
    "avg_markup_percent": null,
    "potential_profit_uzs": 2398100,
    "price_tag": {
        "id": 1,
        "creator_id": 2,
        "company_id": 1,
        "name": "Price tag 1",
        "width": 512,
        "height": 512,
        "elements": [
            {
                "x": 20,
                "y": 20,
                "text": "АКЦИЯ",
                "type": "text",
                "color": "#e11d48",
                "fontSize": 28
            },
            {
                "x": 380,
                "y": 20,
                "src": "https://api-minio.icangroup.uz/wasyt/uploads/logo.png",
                "type": "image",
                "width": 110,
                "height": 60
            }
        ],
        "is_default": false,
        "created_at": "2026-09-30 12:47:59",
        "updated_at": "2026-09-30 12:47:59",
        "is_deleted": false
    }
}

Задать процент мин. цены ​

PATCH/company/product/price/min-price-percent

Устанавливает min_price_percent (мин. цена = себестоимость + процент) товарам из product_ids, а без них — всем ценам компании; явные суммы min_price при этом сбрасываются, процент 0 снимает минимум. Требует права «Мин. цена продажи» (иначе 403); возвращает count — число обновлённых цен.

Из формы (multipart/form-data) метод PATCH отправляется как POST с параметром ?_method=PATCH.

Заголовки ​

ЗаголовокЗначениеОписание
AuthorizationBearer {token}Токен из POST /common/auth/login
Acceptapplication/jsonОтвет в JSON
Accept-LanguageruЯзык сообщений и названий: ru, uz, oz

Тело запроса ​

ПолеТипОбязательноОписание
min_price_percentnumberДаПроцент над себестоимостью, от 0 до 10000
product_idsarrayНетID товаров; без поля — все товары компании
json
{
    "min_price_percent": 5,
    "product_ids": [
        1
    ]
}
bash
curl -X PATCH "https://api.wasyt.uz/company/product/price/min-price-percent" \
  -H "Accept: application/json" \
  -H "Accept-Language: ru" \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -d '{"min_price_percent":5,"product_ids":[1]}'

Ответ · 200 ​

Поля ответа
ПолеТипОписание
countintegerКоличество
json
{
    "count": 1
}

Задать мин. цену товара ​

PATCH/company/product/price/{model}/min-price

Задаёт точную минимальную цену продажи строки цены в её валюте. Она не может быть ниже себестоимости товара (422); null возвращает товар к проценту, 0 снимает минимум. Требует права «Мин. цена продажи» (иначе 403); возвращает обновлённую цену.

Из формы (multipart/form-data) метод PATCH отправляется как POST с параметром ?_method=PATCH.

Заголовки ​

ЗаголовокЗначениеОписание
AuthorizationBearer {token}Токен из POST /common/auth/login
Acceptapplication/jsonОтвет в JSON
Accept-LanguageruЯзык сообщений и названий: ru, uz, oz

Параметры пути ​

ПараметрОписание
modelID записи

Тело запроса ​

ПолеТипОбязательноОписание
min_pricenumberНетМин. цена продажи в валюте цены; null — вернуть к проценту
json
{
    "min_price": 3000
}
bash
curl -X PATCH "https://api.wasyt.uz/company/product/price/1/min-price" \
  -H "Accept: application/json" \
  -H "Accept-Language: ru" \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -d '{"min_price":3000}'

Ответ · 200 ​

Поля ответа
ПолеТипОписание
idintegerID
updater_idintegerОбновитель
company_idintegerКомпания
product_idintegerПродукт
source_typestringИсточник
source_idintegerИсточник
priceintegerЦена
currencystringВалюта
min_priceinteger
min_price_percentnull
created_atstringСоздано
updated_atstringОбновлено
effective_min_priceinteger
price_uzsinteger
effective_min_price_uzsinteger
price_usdnumber
effective_min_price_usdinteger
price_eurnumber
effective_min_price_eurinteger
price_rubnumber
effective_min_price_rubinteger
json
{
    "id": 1,
    "updater_id": 2,
    "company_id": 1,
    "product_id": 1,
    "source_type": "purchase",
    "source_id": 1,
    "price": 1100,
    "currency": "uzs",
    "min_price": 3000,
    "min_price_percent": null,
    "created_at": "2026-09-30 12:47:59",
    "updated_at": "2026-09-30 12:52:24",
    "effective_min_price": 3000,
    "price_uzs": 1100,
    "effective_min_price_uzs": 3000,
    "price_usd": 1.1,
    "effective_min_price_usd": 3,
    "price_eur": 1.1,
    "effective_min_price_eur": 3,
    "price_rub": 1.1,
    "effective_min_price_rub": 3
}

Список цен ​

GET/company/product/price

Цены продажи товаров текущей компании с товаром и его категорией. Фильтры: product_id, currency, product.name, product.barcode, product.category_id (включая подкатегории); сортировка по id и price.

Заголовки ​

ЗаголовокЗначениеОписание
AuthorizationBearer {token}Токен из POST /common/auth/login
Acceptapplication/jsonОтвет в JSON
Accept-LanguageruЯзык сообщений и названий: ru, uz, oz

Параметры запроса ​

ПараметрОписание
filter[id]ID — точное значение
filter[updater_id]Обновитель — точное значение
filter[company_id]Компания — точное значение
filter[product_id]Продукт — точное значение
filter[currency]Валюта — точное значение
filter[created_at]Создано — период: [0] — с, [1] — по (Y-m-d)
filter[product.category_id]Категория — точное значение (с учётом вложенных)
filter[product.name]Название — поиск по части строки
filter[product.barcode]Штрих-код — точное значение
sort[]Сортировка, - — по убыванию: id, -id, price, -price
with[]Подгрузить связи: updater.profile, company, product, product.category, product.category.ancestors
pageНомер страницы, с 1
page-sizeЗаписей на странице, не больше 20
http
GET /company/product/price?sort[0]=id&sort[1]=-id&sort[2]=price&sort[3]=-price

Ответ · 200 ​

Постраничный ответ: записи в data[], пагинация в links и meta.

Поля ответа
ПолеТипОписание
dataobject[]Данные
data[].idintegerID
data[].updater_idintegerОбновитель
data[].company_idintegerКомпания
data[].product_idintegerПродукт
data[].source_typestringИсточник
data[].source_idintegerИсточник
data[].priceintegerЦена
data[].currencystringВалюта
data[].min_pricenull
data[].min_price_percentnull
data[].created_atstringСоздано
data[].updated_atstringОбновлено
data[].effective_min_priceinteger
data[].price_uzsinteger
data[].effective_min_price_uzsinteger
data[].price_usdnumber
data[].effective_min_price_usdinteger
data[].price_eurnumber
data[].effective_min_price_eurinteger
data[].price_rubnumber
data[].effective_min_price_rubinteger
json
{
    "data": [
        {
            "id": 1,
            "updater_id": 2,
            "company_id": 1,
            "product_id": 1,
            "source_type": "purchase",
            "source_id": 1,
            "price": 1100,
            "currency": "uzs",
            "min_price": null,
            "min_price_percent": null,
            "created_at": "2026-09-30 12:47:59",
            "updated_at": "2026-09-30 12:47:59",
            "effective_min_price": 0,
            "price_uzs": 1100,
            "effective_min_price_uzs": 0,
            "price_usd": 1.1,
            "effective_min_price_usd": 0,
            "price_eur": 1.1,
            "effective_min_price_eur": 0,
            "price_rub": 1.1,
            "effective_min_price_rub": 0
        },
        {
            "id": 2,
            "updater_id": 2,
            "company_id": 1,
            "product_id": 2,
            "source_type": "purchase",
            "source_id": 1,
            "price": 2400,
            "currency": "usd",
            "min_price": null,
            "min_price_percent": null,
            "created_at": "2026-09-30 12:47:59",
            "updated_at": "2026-09-30 12:47:59",
            "effective_min_price": 0,
            "price_uzs": 2400000,
            "effective_min_price_uzs": 0,
            "price_usd": 2400,
            "effective_min_price_usd": 0,
            "price_eur": 2400,
            "effective_min_price_eur": 0,
            "price_rub": 2400,
            "effective_min_price_rub": 0
        }
    ],
    "links": {
        "first": "https://api.wasyt.uz/company/product/price?page=1",
        "last": "https://api.wasyt.uz/company/product/price?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "links": [],
        "path": "https://api.wasyt.uz/company/product/price",
        "per_page": 20,
        "to": 2,
        "total": 2
    }
}

Просмотр цены ​

GET/company/product/price/{model}

Возвращает цену продажи товара текущей компании по ID.

Заголовки ​

ЗаголовокЗначениеОписание
AuthorizationBearer {token}Токен из POST /common/auth/login
Acceptapplication/jsonОтвет в JSON
Accept-LanguageruЯзык сообщений и названий: ru, uz, oz

Параметры пути ​

ПараметрОписание
modelID записи

Ответ · 200 ​

Поля ответа
ПолеТипОписание
idintegerID
updater_idintegerОбновитель
company_idintegerКомпания
product_idintegerПродукт
source_typestringИсточник
source_idintegerИсточник
priceintegerЦена
currencystringВалюта
min_pricenull
min_price_percentnull
created_atstringСоздано
updated_atstringОбновлено
effective_min_priceinteger
price_uzsinteger
effective_min_price_uzsinteger
price_usdnumber
effective_min_price_usdinteger
price_eurnumber
effective_min_price_eurinteger
price_rubnumber
effective_min_price_rubinteger
json
{
    "id": 1,
    "updater_id": 2,
    "company_id": 1,
    "product_id": 1,
    "source_type": "purchase",
    "source_id": 1,
    "price": 1100,
    "currency": "uzs",
    "min_price": null,
    "min_price_percent": null,
    "created_at": "2026-09-30 12:47:59",
    "updated_at": "2026-09-30 12:47:59",
    "effective_min_price": 0,
    "price_uzs": 1100,
    "effective_min_price_uzs": 0,
    "price_usd": 1.1,
    "effective_min_price_usd": 0,
    "price_eur": 1.1,
    "effective_min_price_eur": 0,
    "price_rub": 1.1,
    "effective_min_price_rub": 0
}