Kategoriyalar
Tovar kategoriyalari daraxti (nested set). Har bir kompaniya, jumladan filial ham, o‘z daraxtini yuritadi; o‘z daraxti bo‘lmagan eski filial bosh kompaniya daraxtini ko‘radi.
| Metod | Manzil | Vazifasi |
|---|---|---|
| GET | /company/product/category/tree | Kategoriyalar daraxti |
| PATCH | /company/product/category/move | Kategoriyani ko‘chirish |
| GET | /company/product/category | Kategoriyalar ro‘yxati |
| GET | /company/product/category/{model} | Kategoriyani ko‘rish |
| POST | /company/product/category | Kategoriya yaratish |
| PUT | /company/product/category/{model} | Kategoriyani tahrirlash |
| DELETE | /company/product/category/{model} | Kategoriyani o‘chirish |
| DELETE | /company/product/category/{value}/restore | Kategoriyani tiklash |
Kategoriyalar daraxti
/company/product/category/treeKompaniyaning kategoriyalar daraxtini (o‘chirilgan tugunlar bilan birga) ildiz tugunisiz qaytaradi. Kompaniyaning o‘z daraxti bo‘lmasa, eng yaqin bosh kompaniya daraxti olinadi; u ham bo‘lmasa — bo‘sh massiv.
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 |
[].company_id | integer | Kompaniya |
[].lft | integer | |
[].rgt | integer | |
[].parent_id | integer | Ota-ona |
[].name | object | Nomlanish |
[].name.oz | string | |
[].name.ru | string | |
[].name.uz | string | |
[].created_at | string | Yaratilgan |
[].updated_at | string | Yangilangan |
[].is_deleted | boolean | |
[].text | string | Matn |
[].state | object | |
[].state.disabled | boolean | |
[].state.hidden | boolean | |
[].state.opened | boolean | |
[].children | object[] | |
[].children[].id | integer | ID |
[].children[].company_id | integer | Kompaniya |
[].children[].lft | integer | |
[].children[].rgt | integer | |
[].children[].parent_id | integer | Ota-ona |
[].children[].name | object | Nomlanish |
[].children[].name.oz | string | |
[].children[].name.ru | string | |
[].children[].name.uz | string | |
[].children[].created_at | string | Yaratilgan |
[].children[].updated_at | string | Yangilangan |
[].children[].is_deleted | boolean | |
[].children[].text | string | Matn |
[].children[].state | object | |
[].children[].state.disabled | boolean | |
[].children[].state.hidden | boolean | |
[].children[].state.opened | boolean | |
[].children[].children | object[] | |
[].children[].children[].id | integer | ID |
[].children[].children[].company_id | integer | Kompaniya |
[].children[].children[].lft | integer | |
[].children[].children[].rgt | integer | |
[].children[].children[].parent_id | integer | Ota-ona |
[].children[].children[].name | object | Nomlanish |
[].children[].children[].name.oz | string | |
[].children[].children[].name.ru | string | |
[].children[].children[].name.uz | string | |
[].children[].children[].created_at | string | Yaratilgan |
[].children[].children[].updated_at | string | Yangilangan |
[].children[].children[].is_deleted | boolean | |
[].children[].children[].text | string | Matn |
[].children[].children[].state | object | |
[].children[].children[].state.disabled | boolean | |
[].children[].children[].state.hidden | boolean | |
[].children[].children[].state.opened | boolean | |
[].children[].children[].children | array |
[
{
"id": 2,
"company_id": 1,
"lft": 2,
"rgt": 13,
"parent_id": 1,
"name": {
"oz": "Category 1 oz",
"ru": "Category 1 ru",
"uz": "Category 1 uz"
},
"created_at": "2026-09-30 12:47:59",
"updated_at": "2026-09-30 12:47:59",
"is_deleted": false,
"text": "Category 1 ru",
"state": {
"disabled": false,
"hidden": false,
"opened": true
},
"children": [
{
"id": 3,
"company_id": 1,
"lft": 3,
"rgt": 8,
"parent_id": 2,
"name": {
"oz": "Category 1-1 oz",
"ru": "Category 1-1 ru",
"uz": "Category 1-1 uz"
},
"created_at": "2026-09-30 12:47:59",
"updated_at": "2026-09-30 12:47:59",
"is_deleted": false,
"text": "Category 1-1 ru",
"state": {
"disabled": false,
"hidden": false,
"opened": true
},
"children": [
{
"id": 4,
"company_id": 1,
"lft": 4,
"rgt": 5,
"parent_id": 3,
"name": {
"oz": "Category 1-1-1 oz",
"ru": "Category 1-1-1 ru",
"uz": "Category 1-1-1 uz"
},
"created_at": "2026-09-30 12:47:59",
"updated_at": "2026-09-30 12:47:59",
"is_deleted": false,
"text": "Category 1-1-1 ru",
"state": {
"disabled": false,
"hidden": false,
"opened": true
},
"children": []
},
{
"id": 5,
"company_id": 1,
"lft": 6,
"rgt": 7,
"parent_id": 3,
"name": {
"oz": "Category 1-1-2 oz",
"ru": "Category 1-1-2 ru",
"uz": "Category 1-1-2 uz"
},
"created_at": "2026-09-30 12:47:59",
"updated_at": "2026-09-30 12:47:59",
"is_deleted": false,
"text": "Category 1-1-2 ru",
"state": {
"disabled": false,
"hidden": false,
"opened": true
},
"children": []
}
]
},
{
"id": 6,
"company_id": 1,
"lft": 9,
"rgt": 12,
"parent_id": 2,
"name": {
"oz": "Category 1-2 oz",
"ru": "Category 1-2 ru",
"uz": "Category 1-2 uz"
},
"created_at": "2026-09-30 12:47:59",
"updated_at": "2026-09-30 12:47:59",
"is_deleted": false,
"text": "Category 1-2 ru",
"state": {
"disabled": false,
"hidden": false,
"opened": true
},
"children": [
{
"id": 7,
"company_id": 1,
"lft": 10,
"rgt": 11,
"parent_id": 6,
"name": {
"oz": "Category 1-2-1 oz",
"ru": "Category 1-2-1 ru",
"uz": "Category 1-2-1 uz"
},
"created_at": "2026-09-30 12:47:59",
"updated_at": "2026-09-30 12:47:59",
"is_deleted": false,
"text": "Category 1-2-1 ru",
"state": {
"disabled": false,
"hidden": false,
"opened": true
},
"children": []
}
]
}
]
},
{
"id": 8,
"company_id": 1,
"lft": 14,
"rgt": 15,
"parent_id": 1,
"name": {
"oz": "Category 2 oz",
"ru": "Category 2 ru",
"uz": "Category 2 uz"
},
"created_at": "2026-09-30 12:47:59",
"updated_at": "2026-09-30 12:47:59",
"is_deleted": false,
"text": "Category 2 ru",
"state": {
"disabled": false,
"hidden": false,
"opened": true
},
"children": []
}
]Kategoriyani ko‘chirish
/company/product/category/moveid kategoriyasini node_id kategoriyasiga nisbatan ko‘chiradi: type = before (oldiga), after (keyiniga) yoki into (ichiga, oxirgi ichki tugun sifatida). Ildiz tugunni ko‘chirib bo‘lmaydi.
Formadan (
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 |
So‘rov tanasi
| Maydon | Turi | Majburiy | Tavsif |
|---|---|---|---|
type | string | Ha | Turi. Mumkin qiymatlar: before, after, into |
id | string | Ha | ID. Foydalanuvchiga ochiq mavjud yozuv ID si |
node_id | integer | Ha | Foydalanuvchiga ochiq mavjud yozuv ID si |
{
"id": 2,
"node_id": 8,
"type": "before"
}curl -X PATCH "https://api.wasyt.uz/company/product/category/move" \
-H "Accept: application/json" \
-H "Accept-Language: ru" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{"id":2,"node_id":8,"type":"before"}'Javob · 200
Javob maydonlari
| Maydon | Turi | Tavsif |
|---|---|---|
message | string | Xabar |
{
"message": "Success"
}Kategoriyalar ro‘yxati
/company/product/categoryKompaniya kategoriyalarining daraxt tartibidagi tekis ro‘yxati (ildizsiz), har birida ajdodlar zanjiri ancestors. Filtrlar: name, parent_id, id.
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 parametrlari
| Parametr | Tavsif |
|---|---|
filter[id] | ID — aniq qiymat |
filter[parent_id] | Ota-ona — aniq qiymat |
filter[name] | Nomlanish — qator qismi bo‘yicha qidiruv |
sort[] | Saralash, - — kamayish bo‘yicha: lft, -lft |
page | Sahifa raqami, 1 dan |
page-size | Sahifadagi yozuvlar soni, ko‘pi bilan 20 |
show[] | Qo‘shimcha hisoblangan ma’lumotlar (metod tavsifiga qarang) |
GET /company/product/category?show[0]=with-deletedJavob · 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[].company_id | integer | Kompaniya |
data[].lft | integer | |
data[].rgt | integer | |
data[].parent_id | integer | Ota-ona |
data[].name | object | Nomlanish |
data[].name.oz | string | |
data[].name.ru | string | |
data[].name.uz | string | |
data[].created_at | string | Yaratilgan |
data[].updated_at | string | Yangilangan |
data[].is_deleted | boolean | |
data[].text | string | Matn |
data[].state | object | |
data[].state.disabled | boolean | |
data[].state.hidden | boolean | |
data[].state.opened | boolean | |
data[].ancestors | array | |
data[].full_text | string | To'liq matn |
{
"data": [
{
"id": 2,
"company_id": 1,
"lft": 2,
"rgt": 13,
"parent_id": 1,
"name": {
"oz": "Category 1 oz",
"ru": "Category 1 ru",
"uz": "Category 1 uz"
},
"created_at": "2026-09-30 12:47:59",
"updated_at": "2026-09-30 12:47:59",
"is_deleted": false,
"text": "Category 1 ru",
"state": {
"disabled": false,
"hidden": false,
"opened": true
},
"ancestors": [],
"full_text": "Category 1 ru"
},
{
"id": 3,
"company_id": 1,
"lft": 3,
"rgt": 8,
"parent_id": 2,
"name": {
"oz": "Category 1-1 oz",
"ru": "Category 1-1 ru",
"uz": "Category 1-1 uz"
},
"created_at": "2026-09-30 12:47:59",
"updated_at": "2026-09-30 12:47:59",
"is_deleted": false,
"text": "Category 1-1 ru",
"state": {
"disabled": false,
"hidden": false,
"opened": true
},
"ancestors": [
{
"id": 2,
"company_id": 1,
"lft": 2,
"rgt": 13,
"parent_id": 1,
"name": {
"oz": "Category 1 oz",
"ru": "Category 1 ru",
"uz": "Category 1 uz"
},
"created_at": "2026-09-30 12:47:59",
"updated_at": "2026-09-30 12:47:59",
"is_deleted": false,
"text": "Category 1 ru",
"state": {
"disabled": false,
"hidden": false,
"opened": true
}
}
],
"full_text": "Category 1 ru => Category 1-1 ru"
}
],
"links": {
"first": "https://api.wasyt.uz/company/product/category?page=1",
"last": "https://api.wasyt.uz/company/product/category?page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"links": [],
"path": "https://api.wasyt.uz/company/product/category",
"per_page": 20,
"to": 7,
"total": 7
}
}Kategoriyani ko‘rish
/company/product/category/{model}Kompaniya kategoriyasini ID bo‘yicha qaytaradi.
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 |
company_id | integer | Kompaniya |
lft | integer | |
rgt | integer | |
parent_id | integer | Ota-ona |
name | object | Nomlanish |
name.oz | string | |
name.ru | string | |
name.uz | string | |
created_at | string | Yaratilgan |
updated_at | string | Yangilangan |
is_deleted | boolean | |
text | string | Matn |
state | object | |
state.disabled | boolean | |
state.hidden | boolean | |
state.opened | boolean | |
ancestors | array | |
full_text | string | To'liq matn |
{
"id": 2,
"company_id": 1,
"lft": 2,
"rgt": 13,
"parent_id": 1,
"name": {
"oz": "Category 1 oz",
"ru": "Category 1 ru",
"uz": "Category 1 uz"
},
"created_at": "2026-09-30 12:47:59",
"updated_at": "2026-09-30 12:47:59",
"is_deleted": false,
"text": "Category 1 ru",
"state": {
"disabled": false,
"hidden": false,
"opened": true
},
"ancestors": [],
"full_text": "Category 1 ru"
}Kategoriya yaratish
/company/product/categoryUch tildagi (ru, uz, oz) kompaniyada noyob nomli kategoriya yaratadi. Kompaniyada hali daraxt bo‘lmasa, ildiz avtomatik yaratiladi.
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 |
|---|---|---|---|
name.{lang} | string | Ha | Nomlanish. Maks. 255 belgi. Kompaniyada takrorlanmas qiymat |
{
"name": {
"ru": "Branch Category 2 ru",
"uz": "Branch Category 2 uz",
"oz": "Branch Category 2 oz"
}
}curl -X POST "https://api.wasyt.uz/company/product/category" \
-H "Accept: application/json" \
-H "Accept-Language: ru" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{"name":{"ru":"Branch Category 2 ru","uz":"Branch Category 2 uz","oz":"Branch Category 2 oz"}}'Javob · 200
Javob maydonlari
| Maydon | Turi | Tavsif |
|---|---|---|
name | object | Nomlanish |
name.ru | string | |
name.uz | string | |
name.oz | string | |
updated_at | string | Yangilangan |
created_at | string | Yaratilgan |
company_id | integer | Kompaniya |
parent_id | integer | Ota-ona |
lft | integer | |
rgt | integer | |
id | integer | ID |
is_deleted | boolean |
{
"name": {
"ru": "Branch Category 2 ru",
"uz": "Branch Category 2 uz",
"oz": "Branch Category 2 oz"
},
"updated_at": "2026-09-30 12:52:17",
"created_at": "2026-09-30 12:52:17",
"company_id": 2,
"parent_id": 9,
"lft": 4,
"rgt": 5,
"id": 19,
"is_deleted": false
}Kategoriyani tahrirlash
/company/product/category/{model}Kategoriyaning lokallashtirilgan nomini o‘zgartiradi; daraxtdagi o‘rni kategoriyani ko‘chirish orqali o‘zgartiriladi.
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 |
|---|---|---|---|
name.{lang} | string | Ha | Nomlanish. Maks. 255 belgi. Kompaniyada takrorlanmas qiymat |
{
"name": {
"ru": "Category 1 ru",
"uz": "Category 1 uz",
"oz": "Category 1 oz"
}
}curl -X PUT "https://api.wasyt.uz/company/product/category/2" \
-H "Accept: application/json" \
-H "Accept-Language: ru" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{"name":{"ru":"Category 1 ru","uz":"Category 1 uz","oz":"Category 1 oz"}}'Javob · 200
Javob maydonlari
| Maydon | Turi | Tavsif |
|---|---|---|
id | integer | ID |
company_id | integer | Kompaniya |
lft | integer | |
rgt | integer | |
parent_id | integer | Ota-ona |
name | object | Nomlanish |
name.ru | string | |
name.uz | string | |
name.oz | string | |
created_at | string | Yaratilgan |
updated_at | string | Yangilangan |
is_deleted | boolean | |
text | string | Matn |
state | object | |
state.disabled | boolean | |
state.hidden | boolean | |
state.opened | boolean |
{
"id": 2,
"company_id": 1,
"lft": 2,
"rgt": 13,
"parent_id": 1,
"name": {
"ru": "Category 1 ru",
"uz": "Category 1 uz",
"oz": "Category 1 oz"
},
"created_at": "2026-09-30 12:47:59",
"updated_at": "2026-09-30 12:52:21",
"is_deleted": false,
"text": "Category 1 ru",
"state": {
"disabled": false,
"hidden": false,
"opened": true
}
}Kategoriyani o‘chirish
/company/product/category/{model}Kategoriyani yumshoq o‘chiradi; uni tiklash mumkin.
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"
}Kategoriyani tiklash
/company/product/category/{value}/restoreKompaniyaning avval o‘chirilgan kategoriyasini ID bo‘yicha tiklaydi.
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 |
|---|---|
value | Yozuv ID si (o‘chirilgani ham) |
Javob · 200
Javob maydonlari
| Maydon | Turi | Tavsif |
|---|---|---|
message | string | Xabar |
{
"message": "Success"
}
