Category
INFO
Har bir javob umumiy konvertda qaytadi — code, message, messages, status_code, time — foydali yuk esa data ichida. Quyidagi jadvallar faqat data ichini tavsiflaydi.
POST /category/create
This method allows adding category into the account.
So‘rov tanasi
| Maydon | Tur | Majburiy | Tavsif |
|---|---|---|---|
name | string | Ha | |
type | string | Yo‘q | type categories. Mumkin qiymatlar: product, material, semi_product |
parent_id | string | Yo‘q | id of parent category |
is_available_for_sale | boolean | Ha | is available for sale. Standart: true |
organization_ids | string[] | Ha | ids of organization |
image | string | Yo‘q | image path of category that uploaded to the server |
{
"name": "string",
"type": "product",
"parent_id": "string",
"is_available_for_sale": true,
"organization_ids": [
"string"
],
"image": "string"
}Javob
| Maydon | Tur | Tavsif |
|---|---|---|
_id | string | id of category |
name | string | |
is_main_material | boolean | |
is_available_for_sale | boolean | |
type | string | |
parent_id | string | id of parent category |
organization_ids | string[] | ids of organizations |
child_cound | number | |
item_count | number | count off all child |
count | number | |
image | string |
{
"code": 0,
"message": "Success",
"status_code": 200,
"data": {
"_id": "string",
"name": "string",
"is_main_material": false,
"is_available_for_sale": false,
"type": "string",
"parent_id": "string",
"organization_ids": [
"string"
],
"child_cound": 0,
"item_count": 0,
"count": 0,
"image": "string"
},
"time": "2025-05-01T12:00:00Z"
}PUT /category/update
This method allows updating category in the account.
So‘rov tanasi
| Maydon | Tur | Majburiy | Tavsif |
|---|---|---|---|
name | string | Ha | |
type | string | Yo‘q | type categories. Mumkin qiymatlar: product, material, semi_product |
parent_id | string | Yo‘q | id of parent category |
is_available_for_sale | boolean | Ha | is available for sale. Standart: true |
organization_ids | string[] | Ha | ids of organization |
image | string | Yo‘q | image path of category that uploaded to the server |
_id | string | Ha | id of category |
{
"name": "string",
"type": "product",
"parent_id": "string",
"is_available_for_sale": true,
"organization_ids": [
"string"
],
"image": "string",
"_id": "string"
}Javob
Javob tuzilishi quyidagi bilan bir xil: POST /category/create.
DELETE /category/delete/{id}
Delete a category
Yo‘l parametrlari
| Parametr | Tur | Majburiy | Tavsif |
|---|---|---|---|
id | string | Ha |
So‘rov tanasi
So‘rov tanasi talab qilinmaydi.
Javob
{
"code": 0,
"message": "Success",
"status_code": 200,
"data": "ok",
"time": "2025-05-01T12:00:00Z"
}GET /category/get-by-id/{id}
Get category using its _id
Yo‘l parametrlari
| Parametr | Tur | Majburiy | Tavsif |
|---|---|---|---|
id | string | Ha |
So‘rov tanasi
So‘rov tanasi talab qilinmaydi.
Javob
Javob tuzilishi quyidagi bilan bir xil: POST /category/create.
POST /category/get-paging
Get categories by paging
So‘rov tanasi
| Maydon | Tur | Majburiy | Tavsif |
|---|---|---|---|
page | number | Ha | Standart: 1 |
limit | number | Ha | Standart: 20 |
search | string | Yo‘q | |
top | boolean | Yo‘q | |
updated_at | string (date-time) | Yo‘q | |
organization_id | string | Yo‘q | |
parent_id | string | Yo‘q |
{
"page": 1,
"limit": 20,
"search": "string",
"top": false,
"updated_at": "2023-10-01T12:00:00Z",
"organization_id": "64b7f4d9e2b3b6a0b7c5d800",
"parent_id": "63f8b0c4e4b0d3a2f8e4b0c4"
}Javob
data.total — jami yozuvlar soni, data.data[] — joriy sahifadagi yozuvlar. Quyidagi jadval bitta yozuvni tavsiflaydi.
| Maydon | Tur | Tavsif |
|---|---|---|
_id | string | id of category |
name | string | |
is_main_material | boolean | |
is_available_for_sale | boolean | |
type | string | |
parent_id | string | id of parent category |
organization_ids | string[] | ids of organizations |
child_cound | number | |
item_count | number | count off all child |
count | number | |
image | string |
{
"code": 0,
"message": "Success",
"status_code": 200,
"data": {
"total": 0,
"data": [
{
"_id": "string",
"name": "string",
"is_main_material": false,
"is_available_for_sale": false,
"type": "string",
"parent_id": "string",
"organization_ids": [
"string"
],
"child_cound": 0,
"item_count": 0,
"count": 0,
"image": "string"
}
]
},
"time": "2025-05-01T12:00:00Z"
}GET /category/get-deleted
Get deleted category ids
So‘rov parametrlari
| Parametr | Tur | Majburiy | Tavsif |
|---|---|---|---|
deleted_at | string | Ha |
So‘rov tanasi
So‘rov tanasi talab qilinmaydi.
Javob
{
"code": 0,
"message": "Success",
"status_code": 200,
"data": [
"string"
],
"time": "2025-05-01T12:00:00Z"
}GET /category/get-by-name
Get a category by its exact name.
So‘rov parametrlari
| Parametr | Tur | Majburiy | Tavsif |
|---|---|---|---|
name | string | Ha |
So‘rov tanasi
So‘rov tanasi talab qilinmaydi.
Javob
Javob tuzilishi quyidagi bilan bir xil: POST /category/create.
Bu sahifa OpenAPI spetsifikatsiyasidan yaratilgan.