Units of measure
INFO
Каждый ответ приходит в общем конверте — code, message, messages, status_code, time — а полезная нагрузка лежит в data. Таблицы ниже описывают содержимое data.
POST /units-of-measure/create
This method allows adding units-of-measure into the account.
Тело запроса
| Поле | Тип | Обязательно | Описание |
|---|---|---|---|
name | string | Да | |
short_name | string | Нет | |
code | string | Нет | |
status | string | Нет | Допустимые значения: active, inactive. По умолчанию: "active" |
decimal_count | integer | Да | По умолчанию: 0 |
type | string | Да | Допустимые значения: inventory, service |
{
"name": "string",
"short_name": "string",
"code": "string",
"status": "active",
"decimal_count": 0,
"type": "inventory"
}Ответ
| Поле | Тип | Описание |
|---|---|---|
_id | string | |
name | string | |
code | string | |
short_name | string | |
status | string | Допустимые значения: active, inactive |
system_code | string | |
decimal_count | integer | По умолчанию: 0 |
type | string | Допустимые значения: inventory, service |
is_default | boolean | |
created_at | string (date-time) | |
updated_at | string (date-time) |
{
"code": 0,
"message": "Success",
"status_code": 200,
"data": {
"_id": "string",
"name": "string",
"code": "string",
"short_name": "string",
"status": "active",
"system_code": "string",
"decimal_count": 0,
"type": "inventory",
"is_default": false,
"created_at": "2025-05-01T12:00:00Z",
"updated_at": "2025-05-01T12:00:00Z"
},
"time": "2025-05-01T12:00:00Z"
}PUT /units-of-measure/update
This method allows updating units-of-measure in the account.
Тело запроса
| Поле | Тип | Обязательно | Описание |
|---|---|---|---|
_id | string | Да | |
name | string | Да | |
short_name | string | Нет | |
code | string | Нет | |
status | string | Нет | Допустимые значения: active, inactive. По умолчанию: "active" |
decimal_count | integer | Да | По умолчанию: 0 |
type | string | Нет | Допустимые значения: inventory, service |
{
"_id": "67b486d242ed76693cd2cc59",
"name": "string",
"short_name": "string",
"code": "string",
"status": "active",
"decimal_count": 0,
"type": "inventory"
}Ответ
Структура ответа совпадает с POST /units-of-measure/create.
DELETE /units-of-measure/delete/{id}
Delete a units-of-measure
Параметры пути
| Параметр | Тип | Обязательно | Описание |
|---|---|---|---|
id | string | Да |
Тело запроса
Тело запроса не требуется.
Ответ
{
"code": 0,
"message": "Success",
"status_code": 200,
"data": "ok",
"time": "2025-05-01T12:00:00Z"
}GET /units-of-measure/get-all
Get all units-of-measures
Параметры запроса
| Параметр | Тип | Обязательно | Описание |
|---|---|---|---|
search | string | Нет | Search units-of-measure |
type | string | Нет | Допустимые значения: inventory, service |
status | string | Нет | Допустимые значения: active, inactive |
Тело запроса
Тело запроса не требуется.
Ответ
{
"code": 0,
"message": "Success",
"status_code": 200,
"data": [
{
"_id": "string",
"name": "string",
"code": "string",
"short_name": "string",
"status": "active",
"system_code": "string",
"decimal_count": 0,
"type": "inventory",
"is_default": false,
"created_at": "2025-05-01T12:00:00Z",
"updated_at": "2025-05-01T12:00:00Z"
}
],
"time": "2025-05-01T12:00:00Z"
}GET /units-of-measure/get-by-id/{id}
Get units-of-measure using its _id
Параметры пути
| Параметр | Тип | Обязательно | Описание |
|---|---|---|---|
id | string | Да |
Тело запроса
Тело запроса не требуется.
Ответ
Структура ответа совпадает с POST /units-of-measure/create.
GET /units-of-measure/get-deleted
Get deleted units-of-measure ids
Параметры запроса
| Параметр | Тип | Обязательно | Описание |
|---|---|---|---|
deleted_at | string | Да |
Тело запроса
Тело запроса не требуется.
Ответ
{
"code": 0,
"message": "Success",
"status_code": 200,
"data": [
"string"
],
"time": "2025-05-01T12:00:00Z"
}POST /units-of-measure/get-paging
Get units-of-measure by paging
Тело запроса
| Поле | Тип | Обязательно | Описание |
|---|---|---|---|
page | number | Да | По умолчанию: 1 |
limit | number | Да | По умолчанию: 20 |
search | string | Нет | |
type | string | Нет | Допустимые значения: inventory, service |
status | string | Нет | Допустимые значения: active, inactive |
{
"page": 1,
"limit": 20,
"search": "string",
"type": "inventory",
"status": "active"
}Ответ
data.total — общее количество записей, data.data[] — записи текущей страницы. Таблица ниже описывает одну запись.
| Поле | Тип | Описание |
|---|---|---|
name | string | |
code | string | |
short_name | string | |
status | string | Допустимые значения: active, inactive |
system_code | string | |
decimal_count | integer | По умолчанию: 0 |
type | string | Допустимые значения: inventory, service |
updated_by_user | object | |
updated_by_user._id | string | |
updated_by_user.full_name | string | |
created_by_user | object | |
created_by_user._id | string | |
created_by_user.full_name | string | |
created_at | string (date-time) | |
updated_at | string (date-time) | |
is_default | boolean |
{
"code": 0,
"message": "Success",
"status_code": 200,
"data": {
"total": 0,
"data": [
{
"name": "string",
"code": "string",
"short_name": "string",
"status": "active",
"system_code": "string",
"decimal_count": 0,
"type": "inventory",
"updated_by_user": {
"_id": "string",
"full_name": "string"
},
"created_by_user": {
"_id": "string",
"full_name": "string"
},
"created_at": "2025-05-01T12:00:00Z",
"updated_at": "2025-05-01T12:00:00Z",
"is_default": false
}
]
},
"time": "2025-05-01T12:00:00Z"
}Эта страница сгенерирована из спецификации OpenAPI.