Bonus tariflari
Mijozlar bonus dasturi darajalari (10 tagacha): keshbek foizi, bonus bilan to‘lashning maksimal ulushi va darajaga kirish uchun minimal xaridlar summasi.
| Metod | Manzil | Vazifasi |
|---|---|---|
| GET | /company/bonus/tariff | Bonus tariflari ro‘yxati |
| PUT | /company/bonus/tariff | Bonus tariflarini saqlash |
Bonus tariflari ro‘yxati
/company/bonus/tariffFoydalanuvchi kompaniyasining barcha tariflari tartib bo‘yicha (sort_index, kirish summasi o‘sishi bo‘yicha), har biridagi mijozlar soni (clients_count) va oxirgi o‘zgartirgan xodim bilan. Sahifalashsiz.
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 |
Javob · 200
Javob maydonlari
| Maydon | Turi | Tavsif |
|---|---|---|
[].id | integer | ID |
[].updater_id | integer | Yangilovchi |
[].company_id | integer | Kompaniya |
[].name | string | Nomlanish |
[].cashback_percent | integer | Cashback (foizlarda) |
[].max_percent_for_sale | integer | Buyurtmani to‘lash uchun maksimal cashback (foizlarda) |
[].min_entry | integer | Minimal chegara |
[].comment | string | Izoh |
[].color | null | Rang |
[].sort_index | integer | |
[].updated_at | string | Yangilangan |
[].clients_count | integer | |
[].updater | object | |
[].updater.id | integer | ID |
[].updater.type | string | Turi |
[].updater.role_id | integer | Roli |
[].updater.company_id | integer | Kompaniya |
[].updater.partner_id | null | Hamkor |
[].updater.username | string | Login |
[].updater.pinfl | null | PINFL |
[].updater.phone | string | Telefon |
[].updater.sipuni_sip_number | string | Sipuni (SIP-raqam) |
[].updater.is_confirmed | boolean | |
[].updater.are_all_companies_available | boolean | |
[].updater.last_login_at | null | |
[].updater.created_at | string | Yaratilgan |
[].updater.updated_at | string | Yangilangan |
[].updater.is_deleted | boolean | |
[].updater.profile | object | |
[].updater.profile.first_name | null | Ism |
[].updater.profile.last_name | null | Familiya |
[].updater.profile.position | null | Lavozim |
[].updater.profile.birth_date | null | Tug'ilgan kuni |
[].updater.profile.gender | null | Jinsi |
[].updater.profile.full_name | string | FISH |
[
{
"id": 1,
"updater_id": 2,
"company_id": 1,
"name": "Tariff 1",
"cashback_percent": 10,
"max_percent_for_sale": 30,
"min_entry": 1000,
"comment": "Comment 1",
"color": null,
"sort_index": 0,
"updated_at": "2026-09-30 12:16:43",
"clients_count": 1,
"updater": {
"id": 2,
"type": "director",
"role_id": 2,
"company_id": 1,
"partner_id": null,
"username": "director_1@local.host",
"pinfl": null,
"phone": "998020000001",
"sipuni_sip_number": "210",
"is_confirmed": true,
"are_all_companies_available": false,
"last_login_at": null,
"created_at": "2026-09-30 12:16:43",
"updated_at": "2026-09-30 12:16:43",
"is_deleted": false,
"profile": {
"first_name": null,
"last_name": null,
"position": null,
"birth_date": null,
"gender": null,
"full_name": " "
}
}
},
{
"id": 2,
"updater_id": 2,
"company_id": 1,
"name": "Tariff 2",
"cashback_percent": 20,
"max_percent_for_sale": 50,
"min_entry": 2000,
"comment": "Comment 2",
"color": null,
"sort_index": 1,
"updated_at": "2026-09-30 12:16:43",
"clients_count": 0,
"updater": {
"id": 2,
"type": "director",
"role_id": 2,
"company_id": 1,
"partner_id": null,
"username": "director_1@local.host",
"pinfl": null,
"phone": "998020000001",
"sipuni_sip_number": "210",
"is_confirmed": true,
"are_all_companies_available": false,
"last_login_at": null,
"created_at": "2026-09-30 12:16:43",
"updated_at": "2026-09-30 12:16:43",
"is_deleted": false,
"profile": {
"first_name": null,
"last_name": null,
"position": null,
"birth_date": null,
"gender": null,
"full_name": " "
}
}
}
]Bonus tariflarini saqlash
/company/bonus/tariffKompaniyaning barcha tariflarini yuborilgan records bilan almashtiradi (10 tagacha; nomlar va min_entry takrorlanmaydi): yozuvlar min_entry bo‘yicha saralanadi, ortiqcha eski tariflar o‘chiriladi. Saqlangandan so‘ng kompaniyaning barcha mijozlari xaridlar summasiga ko‘ra tariflarga qayta taqsimlanadi. Bo‘sh records barcha tariflarni o‘chiradi.
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 |
So‘rov tanasi
| Maydon | Turi | Majburiy | Tavsif |
|---|---|---|---|
records | object[] | Yo‘q | Kamida 0 ta element. Maks. 10 ta element |
records[].name | string | Ha | Nomlanish. Takrorlanmasin. Maks. 255 belgi |
records[].cashback_percent | integer | Ha | Cashback (foizlarda). Kamida 0. 100 dan oshmasin |
records[].max_percent_for_sale | integer | Ha | Buyurtmani to‘lash uchun maksimal cashback (foizlarda). Kamida 0. 100 dan oshmasin |
records[].min_entry | number | Ha | Minimal chegara. Verguldan keyin 2 tagacha raqam. Kamida 0.01. 999999999999.99 dan oshmasin. Takrorlanmasin |
records[].comment | string | Yo‘q | Izoh. Maks. 1000 belgi |
records[].color | string | Yo‘q | Tarif rangi #RRGGBB formatida. Shablon /^#[0-9A-Fa-f]{6}$/ |
{
"records": [
{
"name": "Tariff 1",
"cashback_percent": 10,
"max_percent_for_sale": 10,
"min_entry": 100,
"comment": "Comment 1",
"color": "#22C55E"
},
{
"name": "Tariff 2",
"cashback_percent": 20,
"max_percent_for_sale": 20,
"min_entry": 200,
"comment": "Comment 2",
"color": null
},
{
"name": "Tariff 3",
"cashback_percent": 30,
"max_percent_for_sale": 30,
"min_entry": 300,
"comment": "Comment 3",
"color": null
}
]
}curl -X PUT "https://api.wasyt.uz/company/bonus/tariff" \
-H "Accept: application/json" \
-H "Accept-Language: ru" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{"records":[{"name":"Tariff 1","cashback_percent":10,"max_percent_for_sale":10,"min_entry":100,"comment":"Comment 1","color":"#22C55E"},{"name":"Tariff 2","cashback_percent":20,"max_percent_for_sale":20,"min_entry":200,"comment":"Comment 2","color":null},{"name":"Tariff 3","cashback_percent":30,"max_percent_for_sale":30,"min_entry":300,"comment":"Comment 3","color":null}]}'Javob · 200
Javob maydonlari
| Maydon | Turi | Tavsif |
|---|---|---|
message | string | Xabar |
{
"message": "Success"
}
