Units of measure
INFO
Every response arrives in the shared envelope — code, message, messages, status_code, time — with the payload in data. The tables below describe what is inside data.
POST /units-of-measure/create
This method allows adding units-of-measure into the account.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | |
short_name | string | No | |
code | string | No | |
status | string | No | One of: active, inactive. Default: "active" |
decimal_count | integer | Yes | Default: 0 |
type | string | Yes | One of: inventory, service |
{
"name": "string",
"short_name": "string",
"code": "string",
"status": "active",
"decimal_count": 0,
"type": "inventory"
}Response
| Field | Type | Description |
|---|---|---|
_id | string | |
name | string | |
code | string | |
short_name | string | |
status | string | One of: active, inactive |
system_code | string | |
decimal_count | integer | Default: 0 |
type | string | One of: 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.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
_id | string | Yes | |
name | string | Yes | |
short_name | string | No | |
code | string | No | |
status | string | No | One of: active, inactive. Default: "active" |
decimal_count | integer | Yes | Default: 0 |
type | string | No | One of: inventory, service |
{
"_id": "67b486d242ed76693cd2cc59",
"name": "string",
"short_name": "string",
"code": "string",
"status": "active",
"decimal_count": 0,
"type": "inventory"
}Response
Same response shape as POST /units-of-measure/create.
DELETE /units-of-measure/delete/{id}
Delete a units-of-measure
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes |
Request body
No request body.
Response
{
"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
Query parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
search | string | No | Search units-of-measure |
type | string | No | One of: inventory, service |
status | string | No | One of: active, inactive |
Request body
No request body.
Response
{
"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
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes |
Request body
No request body.
Response
Same response shape as POST /units-of-measure/create.
GET /units-of-measure/get-deleted
Get deleted units-of-measure ids
Query parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
deleted_at | string | Yes |
Request body
No request body.
Response
{
"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
Request body
| Field | Type | Required | Description |
|---|---|---|---|
page | number | Yes | Default: 1 |
limit | number | Yes | Default: 20 |
search | string | No | |
type | string | No | One of: inventory, service |
status | string | No | One of: active, inactive |
{
"page": 1,
"limit": 20,
"search": "string",
"type": "inventory",
"status": "active"
}Response
data.total is the total number of records and data.data[] holds the current page. The table below describes one record.
| Field | Type | Description |
|---|---|---|
name | string | |
code | string | |
short_name | string | |
status | string | One of: active, inactive |
system_code | string | |
decimal_count | integer | Default: 0 |
type | string | One of: 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"
}This page is generated from the OpenAPI spec.