Ценники
Шаблоны ценников компании («Печатные формы»): размер и набор элементов макета. Системный ценник (is_default) создаётся автоматически и не удаляется.
| Метод | Адрес | Назначение |
|---|---|---|
| GET | /company/product/price-tag | Список ценников |
| GET | /company/product/price-tag/{model} | Просмотр ценника |
| POST | /company/product/price-tag | Создать ценник |
| PUT | /company/product/price-tag/{model} | Изменить ценник |
| DELETE | /company/product/price-tag/{model} | Удалить ценник |
| DELETE | /company/product/price-tag/{value}/restore | Восстановить ценник |
Список ценников
/company/product/price-tagШаблоны ценников компании. С query-параметром purchase_product_id системные элементы заполняются реальными данными товара из этой строки прихода. Системный ценник первым: sort[]=-is_default&sort[]=-id.
Заголовки
| Заголовок | Значение | Описание |
|---|---|---|
Authorization | Bearer {token} | Токен из POST /common/auth/login |
Accept | application/json | Ответ в JSON |
Accept-Language | ru | Язык сообщений и названий: ru, uz, oz |
Параметры запроса
| Параметр | Описание |
|---|---|
filter[id] | ID — точное значение |
filter[creator_id] | Создатель — точное значение |
filter[company_id] | Компания — точное значение |
filter[name] | Название — поиск по части строки |
filter[is_default] | точное значение |
filter[created_at] | Создано — период: [0] — с, [1] — по (Y-m-d) |
sort[] | Сортировка, - — по убыванию: id, -id, is_default, -is_default |
with[] | Подгрузить связи: creator.profile, company |
page | Номер страницы, с 1 |
page-size | Записей на странице, не больше 20 |
GET /company/product/price-tag?filter[is_default]=1Ответ · 200
Постраничный ответ: записи в data[], пагинация в links и meta.
Поля ответа
| Поле | Тип | Описание |
|---|---|---|
data | object[] | Данные |
data[].id | integer | ID |
data[].creator_id | null | Создатель |
data[].company_id | integer | Компания |
data[].name | string | Название |
data[].width | integer | Ширина |
data[].height | integer | Высота |
data[].elements | object[] | Элементы |
data[].elements[].x | integer | |
data[].elements[].y | integer | |
data[].elements[].z | integer | |
data[].elements[].bold | boolean | |
data[].elements[].type | string | Тип |
data[].elements[].color | string | Цвет |
data[].elements[].fontSize | integer | |
data[].elements[].example_text | string | |
data[].elements[].value | null | Значение |
data[].is_default | boolean | |
data[].created_at | string | Создано |
data[].updated_at | string | Обновлено |
data[].is_deleted | boolean |
{
"data": [
{
"id": 16,
"creator_id": null,
"company_id": 1,
"name": "Стандартный ценник 58×40",
"width": 58,
"height": 40,
"elements": [
{
"x": 5,
"y": 3,
"z": 5001,
"bold": true,
"type": "#product_name",
"color": "#334155",
"fontSize": 17,
"example_text": "Название товара",
"value": null
},
{
"x": 6,
"y": 6,
"z": 5002,
"bold": true,
"type": "#sale_price",
"color": "#0f172a",
"fontSize": 25,
"value": null
}
],
"is_default": true,
"created_at": "2026-09-30 12:52:28",
"updated_at": "2026-09-30 12:52:28",
"is_deleted": false
}
],
"links": {
"first": "https://api.wasyt.uz/company/product/price-tag?page=1",
"last": "https://api.wasyt.uz/company/product/price-tag?page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"links": [],
"path": "https://api.wasyt.uz/company/product/price-tag",
"per_page": 20,
"to": 1,
"total": 1
}
}Просмотр ценника
/company/product/price-tag/{model}Без purchase_product_id возвращает один шаблон. С одним или несколькими purchase_product_id[] возвращает массив ценников — по одному на строку прихода, с данными товара и текущей ценой продажи на складе (всегда в UZS).
Заголовки
| Заголовок | Значение | Описание |
|---|---|---|
Authorization | Bearer {token} | Токен из POST /common/auth/login |
Accept | application/json | Ответ в JSON |
Accept-Language | ru | Язык сообщений и названий: ru, uz, oz |
Параметры пути
| Параметр | Описание |
|---|---|
model | ID записи |
Ответ · 200
Поля ответа
| Поле | Тип | Описание |
|---|---|---|
id | integer | ID |
creator_id | integer | Создатель |
company_id | integer | Компания |
name | string | Название |
width | integer | Ширина |
height | integer | Высота |
elements | object[] | Элементы |
elements[].x | integer | |
elements[].y | integer | |
elements[].text | string | Текст |
elements[].type | string | Тип |
elements[].color | string | Цвет |
elements[].fontSize | integer | |
is_default | boolean | |
created_at | string | Создано |
updated_at | string | Обновлено |
is_deleted | boolean |
{
"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
}Создать ценник
/company/product/price-tagСоздаёт шаблон ценника: название (уникальное в компании), width/height и массив elements. Сохраняются только перечисленные свойства элементов; системный тип элемента (с системным префиксом) должен существовать.
Заголовки
| Заголовок | Значение | Описание |
|---|---|---|
Authorization | Bearer {token} | Токен из POST /common/auth/login |
Accept | application/json | Ответ в JSON |
Accept-Language | ru | Язык сообщений и названий: ru, uz, oz |
Тело запроса
| Поле | Тип | Обязательно | Описание |
|---|---|---|---|
name | string | Да | Название. Макс. 255 символов. Уникальное значение в компании |
width | integer | Да | Ширина. Не меньше 1 |
height | integer | Да | Высота. Не меньше 1 |
elements | object[] | Да | Элементы |
elements[] | array | Да | Элементы |
elements[].type | string | Да | Тип. Макс. 255 символов |
elements[].text | string | Нет | Текст. Макс. 1000 символов |
elements[].example_text | string | Нет | Макс. 1000 символов |
elements[].data | string | Нет | Данные. Макс. 2048 символов |
elements[].src | string | Нет | Макс. 2048 символов. Шаблон /^[^"'<>\s]*$/ |
elements[].color | string | Нет | Цвет. Макс. 32 символов. Шаблон /^[#0-9a-zA-Z(),.%\s]+$/ |
elements[].align | string | Нет | Допустимые значения: start, center, end |
elements[].x | number | Нет | |
elements[].y | number | Нет | |
elements[].z | number | Нет | |
elements[].width | number | Нет | Ширина. Не меньше 0 |
elements[].height | number | Нет | Высота. Не меньше 0 |
elements[].fontSize | number | Нет | Не меньше 0 |
elements[].bold | boolean | Нет | |
elements[].italic | boolean | Нет | |
elements[].underline | boolean | Нет | |
elements[].strikethrough | boolean | Нет |
{
"name": "Promo label 512x512",
"width": 512,
"height": 512,
"elements": [
{
"type": "text",
"text": "АКЦИЯ",
"x": 20,
"y": 20,
"fontSize": 28,
"color": "#e11d48"
},
{
"type": "image",
"src": "/uploads/logo.png",
"x": 380,
"y": 20,
"width": 110,
"height": 60
},
{
"type": "#product_name",
"x": 20,
"y": 90,
"fontSize": 36,
"color": "#111827"
},
{
"type": "#brand",
"x": 20,
"y": 140,
"fontSize": 20,
"color": "#6b7280"
},
{
"type": "#category",
"x": 20,
"y": 168,
"fontSize": 16,
"color": "#9ca3af"
},
{
"type": "#sale_price",
"x": 20,
"y": 220,
"fontSize": 64,
"color": "#111827"
},
{
"type": "#currency",
"x": 240,
"y": 240,
"fontSize": 28,
"color": "#111827"
},
{
"type": "#sale_price_uzs",
"x": 20,
"y": 296,
"fontSize": 18,
"color": "#6b7280"
},
{
"type": "#sale_price_usd",
"x": 20,
"y": 320,
"fontSize": 18,
"color": "#6b7280"
},
{
"type": "#units_of_measurement",
"x": 320,
"y": 270,
"fontSize": 20,
"color": "#111827"
},
{
"type": "#barcode",
"x": 20,
"y": 360,
"width": 300,
"height": 100
},
{
"type": "#plu",
"x": 20,
"y": 470,
"fontSize": 18,
"color": "#111827"
},
{
"type": "#product_id",
"x": 420,
"y": 486,
"fontSize": 12,
"color": "#9ca3af"
},
{
"type": "#print_date",
"x": 360,
"y": 470,
"fontSize": 14,
"color": "#9ca3af"
},
{
"type": "qr",
"data": "https://example.uz/p/1",
"x": 380,
"y": 360,
"width": 110,
"height": 110
}
]
}curl -X POST "https://api.wasyt.uz/company/product/price-tag" \
-H "Accept: application/json" \
-H "Accept-Language: ru" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{"name":"Promo label 512x512","width":512,"height":512,"elements":[{"type":"text","text":"АКЦИЯ","x":20,"y":20,"fontSize":28,"color":"#e11d48"},{"type":"image","src":"/uploads/logo.png","x":380,"y":20,"width":110,"height":60},{"type":"#product_name","x":20,"y":90,"fontSize":36,"color":"#111827"},{"type":"#brand","x":20,"y":140,"fontSize":20,"color":"#6b7280"},{"type":"#category","x":20,"y":168,"fontSize":16,"color":"#9ca3af"},{"type":"#sale_price","x":20,"y":220,"fontSize":64,"color":"#111827"},{"type":"#currency","x":240,"y":240,"fontSize":28,"color":"#111827"},{"type":"#sale_price_uzs","x":20,"y":296,"fontSize":18,"color":"#6b7280"},{"type":"#sale_price_usd","x":20,"y":320,"fontSize":18,"color":"#6b7280"},{"type":"#units_of_measurement","x":320,"y":270,"fontSize":20,"color":"#111827"},{"type":"#barcode","x":20,"y":360,"width":300,"height":100},{"type":"#plu","x":20,"y":470,"fontSize":18,"color":"#111827"},{"type":"#product_id","x":420,"y":486,"fontSize":12,"color":"#9ca3af"},{"type":"#print_date","x":360,"y":470,"fontSize":14,"color":"#9ca3af"},{"type":"qr","data":"https://example.uz/p/1","x":380,"y":360,"width":110,"height":110}]}'Ответ · 200
Поля ответа
| Поле | Тип | Описание |
|---|---|---|
is_default | boolean | |
name | string | Название |
width | integer | Ширина |
height | integer | Высота |
elements | object[] | Элементы |
elements[].type | string | Тип |
elements[].text | string | Текст |
elements[].color | string | Цвет |
elements[].x | integer | |
elements[].y | integer | |
elements[].fontSize | integer | |
updated_at | string | Обновлено |
created_at | string | Создано |
creator_id | integer | Создатель |
company_id | integer | Компания |
id | integer | ID |
is_deleted | boolean |
{
"is_default": false,
"name": "Promo label 512x512",
"width": 512,
"height": 512,
"elements": [
{
"type": "text",
"text": "АКЦИЯ",
"color": "#e11d48",
"x": 20,
"y": 20,
"fontSize": 28
},
{
"type": "image",
"src": "https://api-minio.icangroup.uz/wasyt/uploads/logo.png",
"x": 380,
"y": 20,
"width": 110,
"height": 60
}
],
"updated_at": "2026-09-30 12:52:26",
"created_at": "2026-09-30 12:52:26",
"creator_id": 2,
"company_id": 1,
"id": 10,
"is_deleted": false
}Изменить ценник
/company/product/price-tag/{model}Полностью перезаписывает название, размеры и элементы шаблона ценника; системный ценник тоже можно редактировать.
Из формы (
multipart/form-data) методPUTотправляется какPOSTс параметром?_method=PUT.
Заголовки
| Заголовок | Значение | Описание |
|---|---|---|
Authorization | Bearer {token} | Токен из POST /common/auth/login |
Accept | application/json | Ответ в JSON |
Accept-Language | ru | Язык сообщений и названий: ru, uz, oz |
Параметры пути
| Параметр | Описание |
|---|---|
model | ID записи |
Тело запроса
| Поле | Тип | Обязательно | Описание |
|---|---|---|---|
name | string | Да | Название. Макс. 255 символов. Уникальное значение в компании |
width | integer | Да | Ширина. Не меньше 1 |
height | integer | Да | Высота. Не меньше 1 |
elements | object[] | Да | Элементы |
elements[] | array | Да | Элементы |
elements[].type | string | Да | Тип. Макс. 255 символов |
elements[].text | string | Нет | Текст. Макс. 1000 символов |
elements[].example_text | string | Нет | Макс. 1000 символов |
elements[].data | string | Нет | Данные. Макс. 2048 символов |
elements[].src | string | Нет | Макс. 2048 символов. Шаблон /^[^"'<>\s]*$/ |
elements[].color | string | Нет | Цвет. Макс. 32 символов. Шаблон /^[#0-9a-zA-Z(),.%\s]+$/ |
elements[].align | string | Нет | Допустимые значения: start, center, end |
elements[].x | number | Нет | |
elements[].y | number | Нет | |
elements[].z | number | Нет | |
elements[].width | number | Нет | Ширина. Не меньше 0 |
elements[].height | number | Нет | Высота. Не меньше 0 |
elements[].fontSize | number | Нет | Не меньше 0 |
elements[].bold | boolean | Нет | |
elements[].italic | boolean | Нет | |
elements[].underline | boolean | Нет | |
elements[].strikethrough | boolean | Нет |
{
"name": "Price tag 1",
"width": 1024,
"height": 768,
"elements": [
{
"type": "#barcode",
"x": 10,
"y": 10,
"width": 200,
"height": 80
},
{
"type": "text",
"text": "Updated",
"x": 20,
"y": 120,
"fontSize": 24,
"color": "#111"
}
]
}curl -X PUT "https://api.wasyt.uz/company/product/price-tag/1" \
-H "Accept: application/json" \
-H "Accept-Language: ru" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{"name":"Price tag 1","width":1024,"height":768,"elements":[{"type":"#barcode","x":10,"y":10,"width":200,"height":80},{"type":"text","text":"Updated","x":20,"y":120,"fontSize":24,"color":"#111"}]}'Ответ · 200
Поля ответа
| Поле | Тип | Описание |
|---|---|---|
id | integer | ID |
creator_id | integer | Создатель |
company_id | integer | Компания |
name | string | Название |
width | integer | Ширина |
height | integer | Высота |
elements | object[] | Элементы |
elements[].type | string | Тип |
elements[].x | integer | |
elements[].y | integer | |
elements[].width | integer | Ширина |
elements[].height | integer | Высота |
elements[].value | null | Значение |
is_default | boolean | |
created_at | string | Создано |
updated_at | string | Обновлено |
is_deleted | boolean |
{
"id": 1,
"creator_id": 2,
"company_id": 1,
"name": "Price tag 1",
"width": 1024,
"height": 768,
"elements": [
{
"type": "#barcode",
"x": 10,
"y": 10,
"width": 200,
"height": 80,
"value": null
},
{
"type": "text",
"text": "Updated",
"color": "#111",
"x": 20,
"y": 120,
"fontSize": 24
}
],
"is_default": false,
"created_at": "2026-09-30 12:47:59",
"updated_at": "2026-09-30 12:52:32",
"is_deleted": false
}Удалить ценник
/company/product/price-tag/{model}Мягко удаляет шаблон ценника. Системный ценник (is_default = true) удалить нельзя — 400.
Из формы (
multipart/form-data) методDELETEотправляется какPOSTс параметром?_method=DELETE.
Заголовки
| Заголовок | Значение | Описание |
|---|---|---|
Authorization | Bearer {token} | Токен из POST /common/auth/login |
Accept | application/json | Ответ в JSON |
Accept-Language | ru | Язык сообщений и названий: ru, uz, oz |
Параметры пути
| Параметр | Описание |
|---|---|
model | ID записи |
Ответ · 200
Поля ответа
| Поле | Тип | Описание |
|---|---|---|
message | string | Сообщение |
{
"message": "Success"
}Восстановить ценник
/company/product/price-tag/{value}/restoreВосстанавливает ранее удалённый шаблон ценника по ID.
Из формы (
multipart/form-data) методDELETEотправляется какPOSTс параметром?_method=DELETE.
Заголовки
| Заголовок | Значение | Описание |
|---|---|---|
Authorization | Bearer {token} | Токен из POST /common/auth/login |
Accept | application/json | Ответ в JSON |
Accept-Language | ru | Язык сообщений и названий: ru, uz, oz |
Параметры пути
| Параметр | Описание |
|---|---|
value | ID записи (в том числе удалённой) |
Ответ · 200
Поля ответа
| Поле | Тип | Описание |
|---|---|---|
message | string | Сообщение |
{
"message": "Success"
}
