Customer category
INFO
Каждый ответ приходит в общем конверте — code, message, messages, status_code, time — а полезная нагрузка лежит в data. Таблицы ниже описывают содержимое data.
POST /customer-category/create
This method allows adding customer-category into the account.
Тело запроса
| Поле | Тип | Обязательно | Описание |
|---|---|---|---|
name | string | Да | |
parent_id | string | Нет | |
organization_ids | string[] | Нет | |
image | string | Нет |
{
"name": "string",
"parent_id": "string",
"organization_ids": [
"string"
],
"image": "string"
}Ответ
| Поле | Тип | Описание |
|---|---|---|
_id | string | id of customer-category |
name | string | |
child_count | number | |
item_count | number | |
image | string | |
organization_ids | string[] | |
parent | object | |
parent._id | string | |
parent.name | string |
{
"code": 0,
"message": "Success",
"status_code": 200,
"data": {
"_id": "string",
"name": "string",
"child_count": 0,
"item_count": 0,
"image": "string",
"organization_ids": [
"string"
],
"parent": {
"_id": "string",
"name": "string"
}
},
"time": "2025-05-01T12:00:00Z"
}PUT /customer-category/update
This method allows updating customer-category in the account.
Тело запроса
| Поле | Тип | Обязательно | Описание |
|---|---|---|---|
name | string | Да | |
parent_id | string | Нет | |
organization_ids | string[] | Нет | |
image | string | Нет | |
_id | string | Да | id of customer-category |
{
"name": "string",
"parent_id": "string",
"organization_ids": [
"string"
],
"image": "string",
"_id": "string"
}Ответ
Структура ответа совпадает с POST /customer-category/create.
DELETE /customer-category/delete/{id}
Delete a customer-category
Параметры пути
| Параметр | Тип | Обязательно | Описание |
|---|---|---|---|
id | string | Да |
Тело запроса
Тело запроса не требуется.
Ответ
{
"code": 0,
"message": "Success",
"status_code": 200,
"data": "ok",
"time": "2025-05-01T12:00:00Z"
}GET /customer-category/get-by-id/{id}
Get customer-category using its _id
Параметры пути
| Параметр | Тип | Обязательно | Описание |
|---|---|---|---|
id | string | Да |
Тело запроса
Тело запроса не требуется.
Ответ
Структура ответа совпадает с POST /customer-category/create.
POST /customer-category/get-paging
Get customer-categories by paging
Тело запроса
| Поле | Тип | Обязательно | Описание |
|---|---|---|---|
page | number | Да | По умолчанию: 1 |
limit | number | Да | По умолчанию: 20 |
updated_at | string | Нет | |
organization_id | string | Нет | |
organization_ids | string[] | Нет |
{
"page": 1,
"limit": 20,
"updated_at": "string",
"organization_id": "string",
"organization_ids": [
"string"
]
}Ответ
data.total — общее количество записей, data.data[] — записи текущей страницы. Таблица ниже описывает одну запись.
| Поле | Тип | Описание |
|---|---|---|
_id | string | id of customer-category |
name | string | |
child_count | number | |
item_count | number | |
image | string | |
organization_ids | string[] | |
parent | object | |
parent._id | string | |
parent.name | string |
{
"code": 0,
"message": "Success",
"status_code": 200,
"data": {
"total": 0,
"data": [
{
"_id": "string",
"name": "string",
"child_count": 0,
"item_count": 0,
"image": "string",
"organization_ids": [
"string"
],
"parent": {
"_id": "string",
"name": "string"
}
}
]
},
"time": "2025-05-01T12:00:00Z"
}GET /customer-category/get-deleted
Get deleted customer-category ids
Параметры запроса
| Параметр | Тип | Обязательно | Описание |
|---|---|---|---|
deleted_at | string | Да |
Тело запроса
Тело запроса не требуется.
Ответ
{
"code": 0,
"message": "Success",
"status_code": 200,
"data": [
"string"
],
"time": "2025-05-01T12:00:00Z"
}Эта страница сгенерирована из спецификации OpenAPI.