Aksiyalar
Do‘konning chegirma aksiyalari (AR-404), ularni kassa o‘zi qo‘llaydi: tovarlarga, chekka yoki faqat promokod bo‘yicha. O‘nta tur (type), tur shartlari — conditions da. Holat (status) saqlanmaydi, sanalar va «To‘xtatish» bo‘yicha hisoblanadi: active, scheduled, inactive (tugagan), stopped. Chekka bir nechta aksiya to‘g‘ri kelsa, xaridor uchun eng foydalisi qo‘llanadi; faqat bir-birini istisno qilmagan (excluded_ids) is_combinable aksiyalar qo‘shiladi.
| Metod | Manzil | Vazifasi |
|---|---|---|
| GET | /company/bonus/promotion/product-ids | Boshqa aksiyalar tovarlari |
| GET | /company/bonus/promotion/product-card/{product} | Tovar kartasi |
| GET | /company/bonus/promotion/code/template | Promokodlar shabloni |
| POST | /company/bonus/promotion/code/import | Promokodlar faylini o‘qish |
| POST | /company/bonus/promotion/code/export | Promokodlarni eksport qilish |
| GET | /company/bonus/promotion/promo-list | Promokodli aksiyalar |
| POST | /company/bonus/promotion/check-code | Promokodni tekshirish |
| POST | /company/bonus/promotion/calculate | Savatga aksiya chegirmalari |
| PATCH | /company/bonus/promotion/{model}/stop | Aksiyani to‘xtatish |
| PATCH | /company/bonus/promotion/{model}/resume | Aksiyani davom ettirish |
| GET | /company/bonus/promotion | Aksiyalar ro‘yxati |
| GET | /company/bonus/promotion/{model} | Aksiya |
| POST | /company/bonus/promotion | Aksiya yaratish |
| PUT | /company/bonus/promotion/{model} | Aksiyani tahrirlash |
| DELETE | /company/bonus/promotion/{model} | Aksiyani o‘chirish |
Boshqa aksiyalar tovarlari
Boshqa ishlayotgan yoki rejalashtirilgan aksiyalarda tanlangan tovarlar ID lari — «Boshqa aksiyalarda ishtirok etadi» tabi. except_id — tahrirlanayotgan aksiya.
/company/bonus/promotion/product-idsSarlavhalar (headers)
| Sarlavha | Qiymat | Tavsif |
|---|---|---|
Authorization | Bearer {token} | POST /common/auth/login dan olingan token |
Accept | application/json | Javob JSON da |
Accept-Language | ru | Xabarlar va nomlar tili: ru, uz, oz |
So‘rov parametrlari
| Parametr | Tavsif |
|---|---|
except_id |
GET /company/bonus/promotion/product-ids?except_id=24Javob · 200
Javob maydonlari
| Maydon | Turi | Tavsif |
|---|---|---|
data | array | Ma'lumotlar |
{
"data": [
2
]
}Tovar kartasi
«Tovarlarni tanlash» qadamidagi tovar kartasi uchun: filiallar bo‘yicha narxlar (kirim narxi, ustama, sotuv, ulgurji), tovar bilan amaldagi aksiyalar va yetkazib beruvchilar. Kirim narxi va ustama xarid narxini ko‘rish huquqi bo‘lmagan rollarda yashiriladi.
/company/bonus/promotion/product-card/{product}Sarlavhalar (headers)
| Sarlavha | Qiymat | Tavsif |
|---|---|---|
Authorization | Bearer {token} | POST /common/auth/login dan olingan token |
Accept | application/json | Javob JSON da |
Accept-Language | ru | Xabarlar va nomlar tili: ru, uz, oz |
Yo‘l parametrlari
| Parametr | Tavsif |
|---|---|
product | Product |
Javob · 200
Javob maydonlari
| Maydon | Turi | Tavsif |
|---|---|---|
prices | object[] | Narxlar |
prices[].company_id | integer | Kompaniya |
prices[].company_name | string | Kompaniya |
prices[].purchase_price | integer | Sotib olish narxi |
prices[].markup | integer | |
prices[].price | integer | Narxi |
prices[].wholesale_price | null | Ulgurji narx |
prices[].currency | string | Valyuta |
promotions | object[] | |
promotions[].id | integer | ID |
promotions[].name | string | Nomlanish |
promotions[].type | string | Turi |
promotions[].status | string | Status |
promotions[].branch_ids | array | Filiallar |
suppliers | array | |
stocks | object[] | |
stocks[].company_id | integer | Kompaniya |
stocks[].company_name | string | Kompaniya |
stocks[].quantity | integer | Miqdori |
stocks[].inactive_quantity | integer | |
stocks[].stocks | object[] | |
stocks[].stocks[].stock_id | integer | Ombor |
stocks[].stocks[].name | string | Nomlanish |
stocks[].stocks[].is_available | boolean | Faol |
stocks[].stocks[].quantity | integer | Miqdori |
stock_products | object[] | |
stock_products[].id | integer | ID |
stock_products[].stock_id | integer | Ombor |
stock_products[].company_id | integer | Kompaniya |
{
"prices": [
{
"company_id": 1,
"company_name": "Company 1",
"purchase_price": 1000,
"markup": 10,
"price": 1100,
"wholesale_price": null,
"currency": "uzs"
},
{
"company_id": 2,
"company_name": "Company 1-1",
"purchase_price": null,
"markup": null,
"price": null,
"wholesale_price": null,
"currency": null
}
],
"promotions": [
{
"id": 27,
"name": "Карандаши",
"type": "percent",
"status": "active",
"branch_ids": []
}
],
"suppliers": [
"Supplier 1"
],
"stocks": [
{
"company_id": 1,
"company_name": "Company 1",
"quantity": 1,
"inactive_quantity": 0,
"stocks": [
{
"stock_id": 1,
"name": "Stock 1",
"is_available": true,
"quantity": 1
}
]
}
],
"stock_products": [
{
"id": 1,
"stock_id": 1,
"company_id": 1
}
]
}Promokodlar shabloni
«Promokod», «Umumiy foydalanish limiti», «Mijoz uchun limit» ustunlari va izoh qatori bilan Excel, foydalanuvchi tilida.
/company/bonus/promotion/code/templateSarlavhalar (headers)
| Sarlavha | Qiymat | Tavsif |
|---|---|---|
Authorization | Bearer {token} | POST /common/auth/login dan olingan token |
Accept | application/json | Javob JSON da |
Accept-Language | ru | Xabarlar va nomlar tili: ru, uz, oz |
Javob · 200
Javob — fayl yoki matn, JSON emas.
Promokodlar faylini o‘qish
Shablon bo‘yicha XLSX, XLS yoki CSV ni o‘qiydi va kodlarni qaytaradi (katta harflar bilan, takrorsiz); fayl saqlanmaydi.
/company/bonus/promotion/code/importSarlavhalar (headers)
| Sarlavha | Qiymat | Tavsif |
|---|---|---|
Authorization | Bearer {token} | POST /common/auth/login dan olingan token |
Accept | application/json | Javob JSON da |
Accept-Language | ru | Xabarlar va nomlar tili: ru, uz, oz |
So‘rov tanasi
| Maydon | Turi | Majburiy | Tavsif |
|---|---|---|---|
file | file | Ha | Fayl. Formatlar: xlsx, xls, csv, txt. Maks. 5120 KB |
{}curl -X POST "https://api.wasyt.uz/company/bonus/promotion/code/import" \
-H "Accept: application/json" \
-H "Accept-Language: ru" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '[]'Javob · 200
Javob maydonlari
| Maydon | Turi | Tavsif |
|---|---|---|
data | object[] | Ma'lumotlar |
data[].code | string | Kod |
data[].total_limit | integer | Umumiy foydalanish limiti |
data[].client_limit | null | Mijoz uchun limit |
count | integer | Soni |
{
"data": [
{
"code": "SALE1",
"total_limit": 5,
"client_limit": null
},
{
"code": "SALE2",
"total_limit": null,
"client_limit": null
}
],
"count": 2
}Promokodlarni eksport qilish
Yuborilgan kodlar ro‘yxati bilan Excel.
/company/bonus/promotion/code/exportSarlavhalar (headers)
| Sarlavha | Qiymat | Tavsif |
|---|---|---|
Authorization | Bearer {token} | POST /common/auth/login dan olingan token |
Accept | application/json | Javob JSON da |
Accept-Language | ru | Xabarlar va nomlar tili: ru, uz, oz |
So‘rov tanasi
| Maydon | Turi | Majburiy | Tavsif |
|---|---|---|---|
codes | object[] | Ha | Promokodlar. Maks. 10000 ta element |
codes[].code | string | Ha | Kod. Maks. 20 belgi |
codes[].total_limit | integer | Yo‘q | Umumiy foydalanish limiti. Kamida 1 |
codes[].client_limit | integer | Yo‘q | Mijoz uchun limit. Kamida 1 |
{
"codes": [
{
"code": "SALE1",
"total_limit": 10
}
]
}curl -X POST "https://api.wasyt.uz/company/bonus/promotion/code/export" \
-H "Accept: application/json" \
-H "Accept-Language: ru" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{"codes":[{"code":"SALE1","total_limit":10}]}'Javob · 200
Javob — fayl yoki matn, JSON emas.
Promokodli aksiyalar
Filialda ishlayotgan promokodli aksiyalar — kassaning «Kodni kiriting» paneli uchun ro‘yxat.
/company/bonus/promotion/promo-listSarlavhalar (headers)
| Sarlavha | Qiymat | Tavsif |
|---|---|---|
Authorization | Bearer {token} | POST /common/auth/login dan olingan token |
Accept | application/json | Javob JSON da |
Accept-Language | ru | Xabarlar va nomlar tili: ru, uz, oz |
So‘rov parametrlari
| Maydon | Turi | Majburiy | Tavsif |
|---|---|---|---|
company_id | integer | Ha | Kompaniya. Mumkin qiymatlar: 2, 1 |
Javob · 200
Javob maydonlari
| Maydon | Turi | Tavsif |
|---|---|---|
data | object[] | Ma'lumotlar |
data[].id | integer | ID |
data[].name | string | Nomlanish |
data[].type | string | Turi |
data[].codes_count | integer | |
data[].ends_at | string | Tugashi |
{
"data": [
{
"id": 51,
"name": "ТЕСТ",
"type": "coupon_percent",
"codes_count": 2,
"ends_at": "2026-11-27 16:46:26"
}
]
}Promokodni tekshirish
Kod filialda ishlayotgan aksiyaning promokodi yoki fayl kodi bo‘lsa qabul qilinadi. Foydalanish limiti bor kod uchun client_id kerak; limit tugagan bo‘lsa — 422.
/company/bonus/promotion/check-codeSarlavhalar (headers)
| Sarlavha | Qiymat | Tavsif |
|---|---|---|
Authorization | Bearer {token} | POST /common/auth/login dan olingan token |
Accept | application/json | Javob JSON da |
Accept-Language | ru | Xabarlar va nomlar tili: ru, uz, oz |
So‘rov tanasi
| Maydon | Turi | Majburiy | Tavsif |
|---|---|---|---|
company_id | integer | Ha | Kompaniya. Mumkin qiymatlar: 2, 1 |
code | string | Ha | Kod. Maks. 40 belgi |
client_id | integer | Yo‘q | Mijoz. Foydalanuvchiga ochiq mavjud yozuv ID si |
{
"company_id": 1,
"code": " blog1 "
}curl -X POST "https://api.wasyt.uz/company/bonus/promotion/check-code" \
-H "Accept: application/json" \
-H "Accept-Language: ru" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{"company_id":1,"code":" blog1 "}'Javob · 200
Javob maydonlari
| Maydon | Turi | Tavsif |
|---|---|---|
id | integer | ID |
name | string | Nomlanish |
type | string | Turi |
code | string | Kod |
{
"id": 48,
"name": "Блогеры",
"type": "coupon_percent",
"code": "BLOG1"
}Savatga aksiya chegirmalari
Filialda ishlayotgan aksiyalar savatdan nimani olib tashlaydi: lines — qator kaliti (key) bo‘yicha birlik chegirmasi, promotions — summasi bilan qo‘llangan aksiyalar, total. Noto‘g‘ri promokod qo‘llanmaydi va errors.promo_code da qaytadi. Sotuv xuddi shuni qayta hisoblaydi: qator chegirmasidagi aksiyalar ulushi chegirma huquqini talab qilmaydi va xodim limiti hamda minimal narx bilan cheklanmaydi.
/company/bonus/promotion/calculateSarlavhalar (headers)
| Sarlavha | Qiymat | Tavsif |
|---|---|---|
Authorization | Bearer {token} | POST /common/auth/login dan olingan token |
Accept | application/json | Javob JSON da |
Accept-Language | ru | Xabarlar va nomlar tili: ru, uz, oz |
So‘rov tanasi
| Maydon | Turi | Majburiy | Tavsif |
|---|---|---|---|
company_id | integer | Ha | Kompaniya. Mumkin qiymatlar: 2, 1 |
currency | string | Yo‘q | Valyuta. Maks. 3 belgi |
is_wholesale | boolean | Yo‘q | |
promo_code | string | Yo‘q | Promokod. Maks. 40 belgi |
client_id | integer | Yo‘q | Mijoz |
products | object[] | Yo‘q | Mahsulotlar. Maks. 100 ta element |
products[].key | string | Yo‘q | Voqea. Maks. 64 belgi |
products[].product_id | integer | Ha | Tovar |
products[].quantity | number | Ha | Miqdori. Verguldan keyin 8 tagacha raqam. Kamida 0.00000001 |
products[].price | number | Ha | Narxi. Verguldan keyin 2 tagacha raqam. Kamida 0. 999999999999.99 dan oshmasin |
{
"company_id": 1,
"currency": "uzs",
"products": [
{
"key": "a1",
"product_id": 1,
"quantity": 2,
"price": 1100
},
{
"key": "a2",
"product_id": 2,
"quantity": 1,
"price": 5000
}
]
}curl -X POST "https://api.wasyt.uz/company/bonus/promotion/calculate" \
-H "Accept: application/json" \
-H "Accept-Language: ru" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{"company_id":1,"currency":"uzs","products":[{"key":"a1","product_id":1,"quantity":2,"price":1100},{"key":"a2","product_id":2,"quantity":1,"price":5000}]}'Javob · 200
Javob maydonlari
| Maydon | Turi | Tavsif |
|---|---|---|
lines | object | |
lines.a1 | integer | |
lines.a2 | integer | |
promotions | object[] | |
promotions[].id | integer | ID |
promotions[].name | string | Nomlanish |
promotions[].type | string | Turi |
promotions[].amount | integer | Summa |
total | integer | Jami yozuvlar |
promotion_id | null | |
promo_code | null | Promokod |
errors | array | Maydonlar bo‘yicha validatsiya xatolari |
{
"lines": {
"a1": 110,
"a2": 0
},
"promotions": [
{
"id": 28,
"name": "−10%",
"type": "percent",
"amount": 220
}
],
"total": 220,
"promotion_id": null,
"promo_code": null,
"errors": []
}Aksiyani to‘xtatish
To‘xtatilgan aksiya kassada qo‘llanmaydi.
/company/bonus/promotion/{model}/stopFormadan (
multipart/form-data)PATCHmetodiPOST+?_method=PATCHparametri bilan yuboriladi.
Sarlavhalar (headers)
| Sarlavha | Qiymat | Tavsif |
|---|---|---|
Authorization | Bearer {token} | POST /common/auth/login dan olingan token |
Accept | application/json | Javob JSON da |
Accept-Language | ru | Xabarlar va nomlar tili: ru, uz, oz |
Yo‘l parametrlari
| Parametr | Tavsif |
|---|---|
model | Yozuv ID si |
Javob · 200
Javob maydonlari
| Maydon | Turi | Tavsif |
|---|---|---|
id | integer | ID |
creator_id | integer | Yaratuvchi |
updater_id | integer | Yangilovchi |
company_id | integer | Kompaniya |
type | string | Turi |
name | string | Nomlanish |
description | null | Tavsif |
branch_ids | array | Filiallar |
conditions | object | Aksiya shartlari |
conditions.percent | integer | Foiz |
price_scope | string | Chegirmani qo‘llash |
starts_at | null | Boshlanishi |
ends_at | null | Tugashi |
is_promo_code | boolean | Promokod bo‘yicha ishlaydi |
promo_code | null | Promokod |
is_all_products | boolean | Barcha tovarlarga qo‘llash |
is_combinable | boolean | Boshqa aksiyalar bilan birga ishlaydi |
excluded_ids | array | Qo‘shilmaydigan aksiyalar |
is_stopped | boolean | |
products_count | integer | |
codes_count | integer | |
created_at | string | Yaratilgan |
updated_at | string | Yangilangan |
status | string | Status |
{
"id": 22,
"creator_id": 2,
"updater_id": 2,
"company_id": 1,
"type": "percent",
"name": "Акция",
"description": null,
"branch_ids": [],
"conditions": {
"percent": 10
},
"price_scope": "both",
"starts_at": null,
"ends_at": null,
"is_promo_code": false,
"promo_code": null,
"is_all_products": false,
"is_combinable": false,
"excluded_ids": [],
"is_stopped": true,
"products_count": 1,
"codes_count": 0,
"created_at": "2026-11-25 16:46:24",
"updated_at": "2026-11-25 16:46:24",
"status": "stopped"
}Aksiyani davom ettirish
Aksiyaga sanalari bo‘yicha holatini qaytaradi: faol, rejalashtirilgan yoki tugagan.
/company/bonus/promotion/{model}/resumeFormadan (
multipart/form-data)PATCHmetodiPOST+?_method=PATCHparametri bilan yuboriladi.
Sarlavhalar (headers)
| Sarlavha | Qiymat | Tavsif |
|---|---|---|
Authorization | Bearer {token} | POST /common/auth/login dan olingan token |
Accept | application/json | Javob JSON da |
Accept-Language | ru | Xabarlar va nomlar tili: ru, uz, oz |
Yo‘l parametrlari
| Parametr | Tavsif |
|---|---|
model | Yozuv ID si |
Javob · 200
Javob maydonlari
| Maydon | Turi | Tavsif |
|---|---|---|
id | integer | ID |
creator_id | integer | Yaratuvchi |
updater_id | integer | Yangilovchi |
company_id | integer | Kompaniya |
type | string | Turi |
name | string | Nomlanish |
description | null | Tavsif |
branch_ids | array | Filiallar |
conditions | object | Aksiya shartlari |
conditions.percent | integer | Foiz |
price_scope | string | Chegirmani qo‘llash |
starts_at | string | Boshlanishi |
ends_at | null | Tugashi |
is_promo_code | boolean | Promokod bo‘yicha ishlaydi |
promo_code | null | Promokod |
is_all_products | boolean | Barcha tovarlarga qo‘llash |
is_combinable | boolean | Boshqa aksiyalar bilan birga ishlaydi |
excluded_ids | array | Qo‘shilmaydigan aksiyalar |
is_stopped | boolean | |
products_count | integer | |
codes_count | integer | |
created_at | string | Yaratilgan |
updated_at | string | Yangilangan |
status | string | Status |
{
"id": 23,
"creator_id": 2,
"updater_id": 2,
"company_id": 1,
"type": "percent",
"name": "Акция",
"description": null,
"branch_ids": [],
"conditions": {
"percent": 10
},
"price_scope": "both",
"starts_at": "2026-11-26 16:46:24",
"ends_at": null,
"is_promo_code": false,
"promo_code": null,
"is_all_products": false,
"is_combinable": false,
"excluded_ids": [],
"is_stopped": false,
"products_count": 1,
"codes_count": 0,
"created_at": "2026-11-25 16:46:24",
"updated_at": "2026-11-25 16:46:24",
"status": "scheduled"
}Aksiyalar ro‘yxati
Mavjud kompaniyalar aksiyalarining sahifalangan ro‘yxati. filter[status] — tab (active, inactive — to‘xtatilgan va tugaganlar, scheduled), filter[search] — ID, filial, nom yoki promokod, filter[branch_id], filter[type], filter[starts_from] / filter[ends_to] — sanalar, filter[product_id] — tovar aksiyalari. counts — boshqa filtrlar bilan har bir tabdagi aksiyalar soni.
/company/bonus/promotionSarlavhalar (headers)
| Sarlavha | Qiymat | Tavsif |
|---|---|---|
Authorization | Bearer {token} | POST /common/auth/login dan olingan token |
Accept | application/json | Javob JSON da |
Accept-Language | ru | Xabarlar va nomlar tili: ru, uz, oz |
So‘rov parametrlari
| Parametr | Tavsif |
|---|---|
filter[id] | ID — aniq qiymat |
filter[type] | Turi — aniq qiymat |
filter[is_promo_code] | Promokod bo‘yicha ishlaydi — aniq qiymat |
sort[] | Saralash, - — kamayish bo‘yicha: id, -id, name, -name, starts_at, -starts_at, ends_at, -ends_at |
with[] | Bog‘liq ma’lumotlarni qo‘shish: creator.profile, company, products.product.price, products.product.category, products.product.unit, gift_products.product.price, gift_products.product.category, gift_products.product.unit, codes |
page | Sahifa raqami, 1 dan |
page-size | Sahifadagi yozuvlar soni, ko‘pi bilan 20 |
GET /company/bonus/promotion?filter[status]=inactiveJavob · 200
Sahifalangan javob: yozuvlar data[] ichida, sahifalash links va meta da.
Javob maydonlari
| Maydon | Turi | Tavsif |
|---|---|---|
data | object[] | Ma'lumotlar |
data[].id | integer | ID |
data[].creator_id | integer | Yaratuvchi |
data[].updater_id | integer | Yangilovchi |
data[].company_id | integer | Kompaniya |
data[].type | string | Turi |
data[].name | string | Nomlanish |
data[].description | null | Tavsif |
data[].branch_ids | array | Filiallar |
data[].conditions | object | Aksiya shartlari |
data[].conditions.percent | integer | Foiz |
data[].price_scope | string | Chegirmani qo‘llash |
data[].starts_at | null | Boshlanishi |
data[].ends_at | string | Tugashi |
data[].is_promo_code | boolean | Promokod bo‘yicha ishlaydi |
data[].promo_code | null | Promokod |
data[].is_all_products | boolean | Barcha tovarlarga qo‘llash |
data[].is_combinable | boolean | Boshqa aksiyalar bilan birga ishlaydi |
data[].excluded_ids | array | Qo‘shilmaydigan aksiyalar |
data[].is_stopped | boolean | |
data[].products_count | integer | |
data[].codes_count | integer | |
data[].created_at | string | Yaratilgan |
data[].updated_at | string | Yangilangan |
data[].first_code | null | |
data[].status | string | Status |
{
"data": [
{
"id": 14,
"creator_id": 2,
"updater_id": 2,
"company_id": 1,
"type": "percent",
"name": "Прошла",
"description": null,
"branch_ids": [],
"conditions": {
"percent": 10
},
"price_scope": "both",
"starts_at": null,
"ends_at": "2026-11-24 16:46:24",
"is_promo_code": false,
"promo_code": null,
"is_all_products": false,
"is_combinable": false,
"excluded_ids": [],
"is_stopped": false,
"products_count": 1,
"codes_count": 0,
"created_at": "2026-11-25 16:46:24",
"updated_at": "2026-11-25 16:46:24",
"first_code": null,
"status": "inactive"
},
{
"id": 13,
"creator_id": 2,
"updater_id": 2,
"company_id": 1,
"type": "percent",
"name": "Стоп",
"description": null,
"branch_ids": [],
"conditions": {
"percent": 10
},
"price_scope": "both",
"starts_at": null,
"ends_at": null,
"is_promo_code": false,
"promo_code": null,
"is_all_products": false,
"is_combinable": false,
"excluded_ids": [],
"is_stopped": true,
"products_count": 1,
"codes_count": 0,
"created_at": "2026-11-25 16:46:24",
"updated_at": "2026-11-25 16:46:24",
"first_code": null,
"status": "stopped"
}
],
"links": {
"first": "https://api.wasyt.uz/company/bonus/promotion?page=1",
"last": "https://api.wasyt.uz/company/bonus/promotion?page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"links": [],
"path": "https://api.wasyt.uz/company/bonus/promotion",
"per_page": 20,
"to": 2,
"total": 2
},
"counts": {
"all": 4,
"active": 1,
"inactive": 2,
"scheduled": 1
}
}Aksiya
ID bo‘yicha bitta aksiya; tovarlar — with[]=products.product.price, chegirmali tovarlar — with[]=gift_products.product.price, fayl kodlari — with[]=codes.
/company/bonus/promotion/{model}Sarlavhalar (headers)
| Sarlavha | Qiymat | Tavsif |
|---|---|---|
Authorization | Bearer {token} | POST /common/auth/login dan olingan token |
Accept | application/json | Javob JSON da |
Accept-Language | ru | Xabarlar va nomlar tili: ru, uz, oz |
Yo‘l parametrlari
| Parametr | Tavsif |
|---|---|
model | Yozuv ID si |
So‘rov parametrlari
| Parametr | Tavsif |
|---|---|
with[] | Bog‘liq ma’lumotlarni qo‘shish |
GET /company/bonus/promotion/9?with[0]=products.product.price&with[1]=gift_products.product.price&with[2]=codesJavob · 200
Javob maydonlari
| Maydon | Turi | Tavsif |
|---|---|---|
id | integer | ID |
creator_id | integer | Yaratuvchi |
updater_id | integer | Yangilovchi |
company_id | integer | Kompaniya |
type | string | Turi |
name | string | Nomlanish |
description | null | Tavsif |
branch_ids | array | Filiallar |
conditions | object | Aksiya shartlari |
conditions.percent | integer | Foiz |
price_scope | string | Chegirmani qo‘llash |
starts_at | null | Boshlanishi |
ends_at | null | Tugashi |
is_promo_code | boolean | Promokod bo‘yicha ishlaydi |
promo_code | null | Promokod |
is_all_products | boolean | Barcha tovarlarga qo‘llash |
is_combinable | boolean | Boshqa aksiyalar bilan birga ishlaydi |
excluded_ids | array | Qo‘shilmaydigan aksiyalar |
is_stopped | boolean | |
products_count | integer | |
codes_count | integer | |
created_at | string | Yaratilgan |
updated_at | string | Yangilangan |
first_code | null | |
products | object[] | Mahsulotlar |
products[].id | integer | ID |
products[].company_id | integer | Kompaniya |
products[].promotion_id | integer | |
products[].product_id | integer | Mahsulot |
products[].is_gift | boolean | |
products[].price | null | Narxi |
products[].created_at | string | Yaratilgan |
products[].updated_at | string | Yangilangan |
products[].product | object | |
products[].product.id | integer | ID |
products[].product.parent_id | null | Ota-ona |
products[].product.creator_id | integer | Yaratuvchi |
products[].product.company_id | integer | Kompaniya |
products[].product.category_id | integer | Kategoriya |
products[].product.brand_id | integer | Brend |
products[].product.unit_id | integer | O'lchov birligi |
products[].product.name | string | Nomlanish |
products[].product.full_text | string | To'liq matn |
products[].product.plu | string | Artikul (PLU) |
products[].product.custom_id | null | Mahsulot ID |
products[].product.description | string | Tavsif |
products[].product.is_free_price | boolean | Erkin narxda sotish |
products[].product.is_favorite | boolean | Sevimli |
products[].product.has_variants | boolean | Modifikatsiyali mahsulot |
products[].product.is_imei | boolean | IMEI bo'yicha hisob |
products[].product.variant_attributes | array | Xususiyatlar |
products[].product.variant_values | array | Variant qiymatlari |
products[].product.min_quantity | null | Minimal qoldiq |
products[].product.barcode | string | Shtrix kod |
products[].product.additional_barcodes | array | Qo‘shimcha shtrix kod |
products[].product.industrial_barcode | null | Sanoat shtrix kodi |
products[].product.additional_industrial_barcodes | array | |
products[].product.images_list | array | Tasvirlar |
products[].product.images_list_thumbs | object[] | |
products[].product.images_list_thumbs[].widen_100 | object | |
products[].product.images_list_thumbs[].widen_100.raw | string | |
products[].product.images_list_thumbs[].widen_100.webp | string | |
products[].product.images_list_thumbs[].widen_500 | object | |
products[].product.images_list_thumbs[].widen_500.raw | string | |
products[].product.images_list_thumbs[].widen_500.webp | string | |
products[].product.images_list_thumbs[].original | object | |
products[].product.images_list_thumbs[].original.raw | string | |
products[].product.images_list_thumbs[].original.webp | string | |
products[].product.created_at | string | Yaratilgan |
products[].product.updated_at | string | Yangilangan |
products[].product.is_deleted | boolean | O‘chirilgan |
products[].product.price | object | Narxi |
products[].product.price.id | integer | ID |
products[].product.price.updater_id | integer | Yangilovchi |
products[].product.price.company_id | integer | Kompaniya |
products[].product.price.product_id | integer | Mahsulot |
products[].product.price.source_type | string | Manba |
products[].product.price.source_id | integer | Manba |
products[].product.price.price | integer | Narxi |
products[].product.price.currency | string | Valyuta |
products[].product.price.min_price | null | |
products[].product.price.min_price_percent | null | |
products[].product.price.wholesale_price | null | Ulgurji narx |
products[].product.price.created_at | string | Yaratilgan |
products[].product.price.updated_at | string | Yangilangan |
products[].product.price.effective_min_price | integer | |
products[].product.price.price_uzs | integer | |
products[].product.price.effective_min_price_uzs | integer | |
products[].product.price.wholesale_price_uzs | null | |
products[].product.price.price_usd | number | |
products[].product.price.effective_min_price_usd | integer | |
products[].product.price.wholesale_price_usd | null | |
products[].product.price.price_eur | number | |
products[].product.price.effective_min_price_eur | integer | |
products[].product.price.wholesale_price_eur | null | |
products[].product.price.price_rub | number | |
products[].product.price.effective_min_price_rub | integer | |
products[].product.price.wholesale_price_rub | null | |
gift_products | object[] | Chegirmali tovarlar |
gift_products[].id | integer | ID |
gift_products[].company_id | integer | Kompaniya |
gift_products[].promotion_id | integer | |
gift_products[].product_id | integer | Mahsulot |
gift_products[].is_gift | boolean | |
gift_products[].price | null | Narxi |
gift_products[].created_at | string | Yaratilgan |
gift_products[].updated_at | string | Yangilangan |
gift_products[].product | object | |
gift_products[].product.id | integer | ID |
gift_products[].product.parent_id | integer | Ota-ona |
gift_products[].product.creator_id | integer | Yaratuvchi |
gift_products[].product.company_id | integer | Kompaniya |
gift_products[].product.category_id | integer | Kategoriya |
gift_products[].product.brand_id | integer | Brend |
gift_products[].product.unit_id | integer | O'lchov birligi |
gift_products[].product.name | string | Nomlanish |
gift_products[].product.full_text | string | To'liq matn |
gift_products[].product.plu | string | Artikul (PLU) |
gift_products[].product.custom_id | null | Mahsulot ID |
gift_products[].product.description | string | Tavsif |
{
"id": 9,
"creator_id": 2,
"updater_id": 2,
"company_id": 1,
"type": "percent",
"name": "Акция",
"description": null,
"branch_ids": [],
"conditions": {
"percent": 10
},
"price_scope": "both",
"starts_at": null,
"ends_at": null,
"is_promo_code": false,
"promo_code": null,
"is_all_products": false,
"is_combinable": false,
"excluded_ids": [],
"is_stopped": false,
"products_count": 1,
"codes_count": 0,
"created_at": "2026-11-25 16:46:24",
"updated_at": "2026-11-25 16:46:24",
"first_code": null,
"products": [
{
"id": 10,
"company_id": 1,
"promotion_id": 9,
"product_id": 1,
"is_gift": false,
"price": null,
"created_at": "2026-11-25 16:46:24",
"updated_at": "2026-11-25 16:46:24",
"product": {
"id": 1,
"parent_id": null,
"creator_id": 1,
"company_id": 1,
"category_id": 4,
"brand_id": 1,
"unit_id": 1,
"name": "Product 1",
"full_text": "Product 1",
"plu": "0001",
"custom_id": null,
"description": "Description 1",
"is_free_price": false,
"is_favorite": false,
"has_variants": false,
"is_imei": false,
"variant_attributes": [],
"variant_values": [],
"min_quantity": null,
"barcode": "0000000000001",
"additional_barcodes": [],
"industrial_barcode": null,
"additional_industrial_barcodes": [],
"images_list": [
"https://api-minio.icangroup.uz/wasyt/test_data/images/1.png",
"https://api-minio.icangroup.uz/wasyt/test_data/images/2.png"
],
"images_list_thumbs": [
{
"widen_100": {
"raw": "https://api-minio.icangroup.uz/wasyt/test_data/images/1.png",
"webp": "https://api-minio.icangroup.uz/wasyt/test_data/images/1.png"
},
"widen_500": {
"raw": "https://api-minio.icangroup.uz/wasyt/test_data/images/1.png",
"webp": "https://api-minio.icangroup.uz/wasyt/test_data/images/1.png"
},
"original": {
"raw": "https://api-minio.icangroup.uz/wasyt/test_data/images/1.png",
"webp": "https://api-minio.icangroup.uz/wasyt/test_data/images/1.png"
}
},
{
"widen_100": {
"raw": "https://api-minio.icangroup.uz/wasyt/test_data/images/2.png",
"webp": "https://api-minio.icangroup.uz/wasyt/test_data/images/2.png"
},
"widen_500": {
"raw": "https://api-minio.icangroup.uz/wasyt/test_data/images/2.png",
"webp": "https://api-minio.icangroup.uz/wasyt/test_data/images/2.png"
},
"original": {
"raw": "https://api-minio.icangroup.uz/wasyt/test_data/images/2.png",
"webp": "https://api-minio.icangroup.uz/wasyt/test_data/images/2.png"
}
}
],
"created_at": "2026-11-25 16:42:00",
"updated_at": "2026-11-25 16:46:24",
"is_deleted": false,
"price": {
"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,
"wholesale_price": null,
"created_at": "2026-11-25 16:42:00",
"updated_at": "2026-11-25 16:42:00",
"effective_min_price": 0,
"price_uzs": 1100,
"effective_min_price_uzs": 0,
"wholesale_price_uzs": null,
"price_usd": 1.1,
"effective_min_price_usd": 0,
"wholesale_price_usd": null,
"price_eur": 1.1,
"effective_min_price_eur": 0,
"wholesale_price_eur": null,
"price_rub": 1.1,
"effective_min_price_rub": 0,
"wholesale_price_rub": null
}
}
}
],
"gift_products": [
{
"id": 11,
"company_id": 1,
"promotion_id": 9,
"product_id": 2,
"is_gift": true,
"price": null,
"created_at": "2026-11-25 16:46:24",
"updated_at": "2026-11-25 16:46:24",
"product": {
"id": 2,
"parent_id": 1,
"creator_id": 1,
"company_id": 1,
"category_id": 4,
"brand_id": 1,
"unit_id": 1,
"name": "Product 1-1",
"full_text": "Product 1-1 full text",
"plu": "0011",
"custom_id": null,
"description": "Description 1-1",
"is_free_price": false,
"is_favorite": false,
"has_variants": false,
"is_imei": false,
"variant_attributes": [],
"variant_values": [],
"min_quantity": null,
"barcode": "0000000000011",
"additional_barcodes": [],
"industrial_barcode": null,
"additional_industrial_barcodes": [],
"images_list": [
"https://api-minio.icangroup.uz/wasyt/test_data/images/1.png",
"https://api-minio.icangroup.uz/wasyt/test_data/images/2.png"
],
"images_list_thumbs": [
{
"widen_100": {
"raw": "https://api-minio.icangroup.uz/wasyt/test_data/images/1.png",
"webp": "https://api-minio.icangroup.uz/wasyt/test_data/images/1.png"
},
"widen_500": {
"raw": "https://api-minio.icangroup.uz/wasyt/test_data/images/1.png",
"webp": "https://api-minio.icangroup.uz/wasyt/test_data/images/1.png"
},
"original": {
"raw": "https://api-minio.icangroup.uz/wasyt/test_data/images/1.png",
"webp": "https://api-minio.icangroup.uz/wasyt/test_data/images/1.png"
}
},
{
"widen_100": {
"raw": "https://api-minio.icangroup.uz/wasyt/test_data/images/2.png",
"webp": "https://api-minio.icangroup.uz/wasyt/test_data/images/2.png"
},
"widen_500": {
"raw": "https://api-minio.icangroup.uz/wasyt/test_data/images/2.png",
"webp": "https://api-minio.icangroup.uz/wasyt/test_data/images/2.png"
},
"original": {
"raw": "https://api-minio.icangroup.uz/wasyt/test_data/images/2.png",
"webp": "https://api-minio.icangroup.uz/wasyt/test_data/images/2.png"
}
}
],
"created_at": "2026-11-25 16:42:00",
"updated_at": "2026-11-25 16:46:24",
"is_deleted": false,
"price": {
"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,
"wholesale_price": null,
"created_at": "2026-11-25 16:42:00",
"updated_at": "2026-11-25 16:42:00",
"effective_min_price": 0,
"price_uzs": 2400000,
"effective_min_price_uzs": 0,
"wholesale_price_uzs": null,
"price_usd": 2400,
"effective_min_price_usd": 0,
"wholesale_price_usd": null,
"price_eur": 2400,
"effective_min_price_eur": 0,
"wholesale_price_eur": null,
"price_rub": 2400,
"effective_min_price_rub": 0,
"wholesale_price_rub": null
}
}
}
],
"codes": [],
"status": "active"
}Aksiya yaratish
Master barcha qadamlari bilan aksiya yaratadi. Bo‘sh branch_ids — barcha filiallar. starts_at/ends_at siz — cheklovsiz. Kupon turlari (coupon_*) har doim promokod bilan ishlaydi: promo_code yoki codes ro‘yxati kerak. is_all_products bo‘lmasa, kamida bitta tovar kerak; conditions.price_mode = different da har bir tovarning o‘z price i bor. Karusel va summa bo‘yicha chek chegirmasida o‘zaro istisnolar yo‘q, miqdor va chek turlarida — price_scope yo‘q.
/company/bonus/promotionSarlavhalar (headers)
| Sarlavha | Qiymat | Tavsif |
|---|---|---|
Authorization | Bearer {token} | POST /common/auth/login dan olingan token |
Accept | application/json | Javob JSON da |
Accept-Language | ru | Xabarlar va nomlar tili: ru, uz, oz |
So‘rov tanasi
| Maydon | Turi | Majburiy | Tavsif |
|---|---|---|---|
type | string | Ha | Turi. Mumkin qiymatlar: percent, fixed_price, buy_get, carousel, quantity_percent, check_sum, check_quantity, coupon_percent, coupon_fixed_price, coupon_buy_get |
name | string | Ha | Nomlanish. Maks. 80 belgi |
description | string | Yo‘q | Tavsif. Maks. 300 belgi |
branch_ids | array | Yo‘q | Filiallar. Maks. 100 ta element. Foydalanuvchiga ochiq mavjud yozuv ID si |
branch_ids[] | integer | Yo‘q | Filiallar. Takrorlanmasin |
price_scope | string | Yo‘q | Chegirmani qo‘llash. Mumkin qiymatlar: retail, wholesale, both |
starts_at | string (date) | Yo‘q | Boshlanishi |
ends_at | string (date) | Yo‘q | Tugashi. Kamida starts_at |
is_promo_code | boolean | Yo‘q | Promokod bo‘yicha ishlaydi |
promo_code | string | Yo‘q | Promokod. Maks. 20 belgi. Shablon /^[A-Z0-9_\-]{1,20}$/ |
codes | object[] | Yo‘q | Promokodlar. Maks. 10000 ta element |
codes[].code | string | Ha | Kod. Maks. 20 belgi. Shablon /^[A-Z0-9_\-]{1,20}$/. Takrorlanmasin |
codes[].total_limit | integer | Yo‘q | Umumiy foydalanish limiti. Kamida 1. 100000000 dan oshmasin |
codes[].client_limit | integer | Yo‘q | Mijoz uchun limit. Kamida 1. 100000000 dan oshmasin |
is_all_products | boolean | Yo‘q | Barcha tovarlarga qo‘llash |
products | object[] | Yo‘q | Mahsulotlar. Maks. 5000 ta element |
products[].product_id | integer | Ha | Tovar. Takrorlanmasin |
products[].price | number | Yo‘q | Narxi. Verguldan keyin 2 tagacha raqam. Kamida 0.01. 999999999999.99 dan oshmasin |
gift_products | object[] | Yo‘q | Chegirmali tovarlar. Maks. 5000 ta element |
gift_products[].product_id | integer | Ha | Mahsulot. Takrorlanmasin |
is_combinable | boolean | Yo‘q | Boshqa aksiyalar bilan birga ishlaydi |
excluded_ids | array | Yo‘q | Qo‘shilmaydigan aksiyalar. Maks. 1000 ta element |
excluded_ids[] | integer | Yo‘q | Qo‘shilmaydigan aksiyalar |
conditions | array | Yo‘q | Aksiya shartlari |
conditions.percent | number | Ha | Foiz. Verguldan keyin 2 tagacha raqam. 0 dan katta. 100 dan oshmasin |
conditions.price_mode | string | Yo‘q | Aksiya narxi. Mumkin qiymatlar: single, different |
conditions.price | number | Yo‘q | Narxi. Verguldan keyin 2 tagacha raqam. Kamida 0.01. 999999999999.99 dan oshmasin |
conditions.buy_quantity | integer | Yo‘q | Xarid uchun miqdor. Kamida 1. 1000 dan oshmasin |
conditions.get_quantity | integer | Yo‘q | Chegirmadagi miqdor. Kamida 1. 1000 dan oshmasin |
conditions.min_quantity | number | Yo‘q | Minimal qoldiq. Verguldan keyin 4 tagacha raqam. 0 dan katta. 1000000 dan oshmasin |
conditions.levels | object[] | Yo‘q | Darajalar. Kamida 1 ta element. Maks. 10 ta element |
conditions.levels[].position | integer | Yo‘q | Lavozim. Kamida 1. 1000 dan oshmasin |
conditions.levels[].percent | number | Yo‘q | Foiz. Verguldan keyin 2 tagacha raqam. 0 dan katta. 100 dan oshmasin |
conditions.levels[].amount | number | Yo‘q | Summa. Verguldan keyin 2 tagacha raqam. Kamida 0.01. 999999999999.99 dan oshmasin |
conditions.levels[].discount | number | Yo‘q | Chegirma. Verguldan keyin 2 tagacha raqam. Kamida 0.01. 999999999999.99 dan oshmasin |
conditions.levels[].discount_type | string | Yo‘q | Chegirma turi. Mumkin qiymatlar: percent, amount |
{
"type": "percent",
"name": "Осенняя распродажа",
"description": "Скидка на карандаши",
"branch_ids": "{{empty_array}}",
"price_scope": "both",
"starts_at": "2026-11-25 00:00:00",
"ends_at": "2026-11-28 18:00:00",
"conditions": {
"percent": 10
},
"products": [
{
"product_id": 1
}
]
}curl -X POST "https://api.wasyt.uz/company/bonus/promotion" \
-H "Accept: application/json" \
-H "Accept-Language: ru" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{"type":"percent","name":"Осенняя распродажа","description":"Скидка на карандаши","branch_ids":"{{empty_array}}","price_scope":"both","starts_at":"2026-11-25 00:00:00","ends_at":"2026-11-28 18:00:00","conditions":{"percent":10},"products":[{"product_id":1}]}'Javob · 200
Javob maydonlari
| Maydon | Turi | Tavsif |
|---|---|---|
type | string | Turi |
name | string | Nomlanish |
description | string | Tavsif |
starts_at | string | Boshlanishi |
ends_at | string | Tugashi |
branch_ids | array | Filiallar |
conditions | object | Aksiya shartlari |
conditions.percent | integer | Foiz |
price_scope | string | Chegirmani qo‘llash |
is_promo_code | boolean | Promokod bo‘yicha ishlaydi |
promo_code | null | Promokod |
is_all_products | boolean | Barcha tovarlarga qo‘llash |
is_combinable | boolean | Boshqa aksiyalar bilan birga ishlaydi |
excluded_ids | array | Qo‘shilmaydigan aksiyalar |
updated_at | string | Yangilangan |
created_at | string | Yaratilgan |
updater_id | integer | Yangilovchi |
creator_id | integer | Yaratuvchi |
company_id | integer | Kompaniya |
id | integer | ID |
products_count | integer | |
codes_count | integer | |
status | string | Status |
{
"type": "percent",
"name": "Осенняя распродажа",
"description": "Скидка на карандаши",
"starts_at": "2026-11-25 00:00:00",
"ends_at": "2026-11-28 18:00:00",
"branch_ids": [],
"conditions": {
"percent": 10
},
"price_scope": "both",
"is_promo_code": false,
"promo_code": null,
"is_all_products": false,
"is_combinable": false,
"excluded_ids": [],
"updated_at": "2026-11-25 16:46:22",
"created_at": "2026-11-25 16:46:22",
"updater_id": 2,
"creator_id": 2,
"company_id": 1,
"id": 1,
"products_count": 1,
"codes_count": 0,
"status": "active"
}Aksiyani tahrirlash
Aksiyani yangilaydi va uning tovarlari hamda kodlarini yuborilganlari bilan to‘liq almashtiradi.
/company/bonus/promotion/{model}Formadan (
multipart/form-data)PUTmetodiPOST+?_method=PUTparametri bilan yuboriladi.
Sarlavhalar (headers)
| Sarlavha | Qiymat | Tavsif |
|---|---|---|
Authorization | Bearer {token} | POST /common/auth/login dan olingan token |
Accept | application/json | Javob JSON da |
Accept-Language | ru | Xabarlar va nomlar tili: ru, uz, oz |
Yo‘l parametrlari
| Parametr | Tavsif |
|---|---|
model | Yozuv ID si |
So‘rov tanasi
| Maydon | Turi | Majburiy | Tavsif |
|---|---|---|---|
type | string | Ha | Turi. Mumkin qiymatlar: percent, fixed_price, buy_get, carousel, quantity_percent, check_sum, check_quantity, coupon_percent, coupon_fixed_price, coupon_buy_get |
name | string | Ha | Nomlanish. Maks. 80 belgi |
description | string | Yo‘q | Tavsif. Maks. 300 belgi |
branch_ids | array | Yo‘q | Filiallar. Maks. 100 ta element. Foydalanuvchiga ochiq mavjud yozuv ID si |
branch_ids[] | integer | Yo‘q | Filiallar. Takrorlanmasin |
price_scope | string | Yo‘q | Chegirmani qo‘llash. Mumkin qiymatlar: retail, wholesale, both |
starts_at | string (date) | Yo‘q | Boshlanishi |
ends_at | string (date) | Yo‘q | Tugashi. Kamida starts_at |
is_promo_code | boolean | Yo‘q | Promokod bo‘yicha ishlaydi |
promo_code | string | Yo‘q | Promokod. Maks. 20 belgi. Shablon /^[A-Z0-9_\-]{1,20}$/ |
codes | object[] | Yo‘q | Promokodlar. Maks. 10000 ta element |
codes[].code | string | Ha | Kod. Maks. 20 belgi. Shablon /^[A-Z0-9_\-]{1,20}$/. Takrorlanmasin |
codes[].total_limit | integer | Yo‘q | Umumiy foydalanish limiti. Kamida 1. 100000000 dan oshmasin |
codes[].client_limit | integer | Yo‘q | Mijoz uchun limit. Kamida 1. 100000000 dan oshmasin |
is_all_products | boolean | Yo‘q | Barcha tovarlarga qo‘llash |
products | object[] | Yo‘q | Mahsulotlar. Maks. 5000 ta element |
products[].product_id | integer | Ha | Tovar. Takrorlanmasin |
products[].price | number | Yo‘q | Narxi. Verguldan keyin 2 tagacha raqam. Kamida 0.01. 999999999999.99 dan oshmasin |
gift_products | object[] | Yo‘q | Chegirmali tovarlar. Maks. 5000 ta element |
gift_products[].product_id | integer | Ha | Mahsulot. Takrorlanmasin |
is_combinable | boolean | Yo‘q | Boshqa aksiyalar bilan birga ishlaydi |
excluded_ids | array | Yo‘q | Qo‘shilmaydigan aksiyalar. Maks. 1000 ta element |
excluded_ids[] | integer | Yo‘q | Qo‘shilmaydigan aksiyalar |
conditions | array | Yo‘q | Aksiya shartlari |
conditions.percent | number | Ha | Foiz. Verguldan keyin 2 tagacha raqam. 0 dan katta. 100 dan oshmasin |
conditions.price_mode | string | Yo‘q | Aksiya narxi. Mumkin qiymatlar: single, different |
conditions.price | number | Yo‘q | Narxi. Verguldan keyin 2 tagacha raqam. Kamida 0.01. 999999999999.99 dan oshmasin |
conditions.buy_quantity | integer | Yo‘q | Xarid uchun miqdor. Kamida 1. 1000 dan oshmasin |
conditions.get_quantity | integer | Yo‘q | Chegirmadagi miqdor. Kamida 1. 1000 dan oshmasin |
conditions.min_quantity | number | Yo‘q | Minimal qoldiq. Verguldan keyin 4 tagacha raqam. 0 dan katta. 1000000 dan oshmasin |
conditions.levels | object[] | Yo‘q | Darajalar. Kamida 1 ta element. Maks. 10 ta element |
conditions.levels[].position | integer | Yo‘q | Lavozim. Kamida 1. 1000 dan oshmasin |
conditions.levels[].percent | number | Yo‘q | Foiz. Verguldan keyin 2 tagacha raqam. 0 dan katta. 100 dan oshmasin |
conditions.levels[].amount | number | Yo‘q | Summa. Verguldan keyin 2 tagacha raqam. Kamida 0.01. 999999999999.99 dan oshmasin |
conditions.levels[].discount | number | Yo‘q | Chegirma. Verguldan keyin 2 tagacha raqam. Kamida 0.01. 999999999999.99 dan oshmasin |
conditions.levels[].discount_type | string | Yo‘q | Chegirma turi. Mumkin qiymatlar: percent, amount |
{
"type": "percent",
"name": "Новое имя",
"description": "Скидка на карандаши",
"branch_ids": "{{empty_array}}",
"price_scope": "both",
"starts_at": "2026-11-25 00:00:00",
"ends_at": "2026-11-28 18:00:00",
"conditions": {
"percent": 10
},
"products": [
{
"product_id": 2
}
]
}curl -X PUT "https://api.wasyt.uz/company/bonus/promotion/8" \
-H "Accept: application/json" \
-H "Accept-Language: ru" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{"type":"percent","name":"Новое имя","description":"Скидка на карандаши","branch_ids":"{{empty_array}}","price_scope":"both","starts_at":"2026-11-25 00:00:00","ends_at":"2026-11-28 18:00:00","conditions":{"percent":10},"products":[{"product_id":2}]}'Javob · 200
Javob maydonlari
| Maydon | Turi | Tavsif |
|---|---|---|
id | integer | ID |
creator_id | integer | Yaratuvchi |
updater_id | integer | Yangilovchi |
company_id | integer | Kompaniya |
type | string | Turi |
name | string | Nomlanish |
description | string | Tavsif |
branch_ids | array | Filiallar |
conditions | object | Aksiya shartlari |
conditions.percent | integer | Foiz |
price_scope | string | Chegirmani qo‘llash |
starts_at | string | Boshlanishi |
ends_at | string | Tugashi |
is_promo_code | boolean | Promokod bo‘yicha ishlaydi |
promo_code | null | Promokod |
is_all_products | boolean | Barcha tovarlarga qo‘llash |
is_combinable | boolean | Boshqa aksiyalar bilan birga ishlaydi |
excluded_ids | array | Qo‘shilmaydigan aksiyalar |
is_stopped | boolean | |
products_count | integer | |
codes_count | integer | |
created_at | string | Yaratilgan |
updated_at | string | Yangilangan |
status | string | Status |
{
"id": 8,
"creator_id": 2,
"updater_id": 2,
"company_id": 1,
"type": "percent",
"name": "Новое имя",
"description": "Скидка на карандаши",
"branch_ids": [],
"conditions": {
"percent": 10
},
"price_scope": "both",
"starts_at": "2026-11-25 00:00:00",
"ends_at": "2026-11-28 18:00:00",
"is_promo_code": false,
"promo_code": null,
"is_all_products": false,
"is_combinable": false,
"excluded_ids": [],
"is_stopped": false,
"products_count": 1,
"codes_count": 0,
"created_at": "2026-11-25 16:46:23",
"updated_at": "2026-11-25 16:46:24",
"status": "active"
}Aksiyani o‘chirish
To‘xtatilgan yoki tugagan aksiyani tovarlari va kodlari bilan o‘chiradi; ishlayotgan yoki rejalashtirilganida — 400.
/company/bonus/promotion/{model}Formadan (
multipart/form-data)DELETEmetodiPOST+?_method=DELETEparametri bilan yuboriladi.
Sarlavhalar (headers)
| Sarlavha | Qiymat | Tavsif |
|---|---|---|
Authorization | Bearer {token} | POST /common/auth/login dan olingan token |
Accept | application/json | Javob JSON da |
Accept-Language | ru | Xabarlar va nomlar tili: ru, uz, oz |
Yo‘l parametrlari
| Parametr | Tavsif |
|---|---|
model | Yozuv ID si |
Javob · 200
Javob maydonlari
| Maydon | Turi | Tavsif |
|---|---|---|
message | string | Xabar |
{
"message": "Success"
}
