Unit of Measurement
Standardized unit of measurement codes following international standards (such as UN/ECE Recommendation 20) for consistent measurement handling and validation.
The ref_uom Object
Unit of measurement collection provides standardized unit codes and classifications for proper measurement handling, validation, and conversion throughout the system.
| Field Name | Type | Description |
|---|---|---|
code | string | Primary key. Unit of measurement code following international standards (e.g., "ACR", "BLL", "4H"). |
user_created | object | User who created the unit of measurement record. Read-only. Links to directus_users. |
date_created | datetime | Timestamp in ISO 8601 when the unit of measurement record was created. Read-only. |
user_updated | object | User who last updated the unit of measurement record. Read-only. Links to directus_users. |
date_updated | datetime | Timestamp in ISO 8601 when the unit of measurement record was last updated. Read-only. |
description | string | Human-readable description of the unit of measurement. |
classification | string | Classification category of the unit (e.g., "length", "area", "volume", "density"). |
status | string | Record status. Default: "published". Values: "draft", "published". |
List Units of Measurement
List existing units of measurement.
- REST
- GraphQL
GET /items/ref_uom
query {
ref_uom {
code
description
classification
status
date_created
date_updated
}
}
Query Parameters
Supports all global query parameters.
Returns
An array of up to limit unit of measurement objects. If no items are available, data will be an empty array.
Retrieve a Unit of Measurement
Retrieve a specific unit of measurement by code.
- REST
- GraphQL
GET /items/ref_uom/:code
query {
ref_uom_by_id(id: "uom_code") {
code
description
classification
status
user_created {
id
first_name
last_name
}
date_created
user_updated {
id
first_name
last_name
}
date_updated
}
}
Returns
Returns a unit of measurement object if a valid code was provided.
Create a Unit of Measurement
Create a new unit of measurement.
- REST
- GraphQL
POST /items/ref_uom
{
"code": "CX",
"description": "Custom unit",
"classification": "custom",
"status": "draft"
}
mutation {
create_ref_uom_item(data: {
code: "CX"
description: "Custom unit"
classification: "custom"
status: "draft"
}) {
code
description
classification
status
}
}
Query Parameters
Supports all global query parameters.
Request Body
A partial unit of measurement object.
Returns
Returns the unit of measurement object for the created unit of measurement.
Update a Unit of Measurement
Update an existing unit of measurement.
- REST
- GraphQL
PATCH /items/ref_uom/:code
{
"description": "Updated unit description",
"status": "published"
}
mutation {
update_ref_uom_item(id: "uom_code", data: {
description: "Updated unit description"
status: "published"
}) {
code
description
status
}
}
Query Parameters
Supports all global query parameters.
Request Body
A partial unit of measurement object.
Returns
Returns the unit of measurement object for the updated unit of measurement.
Delete a Unit of Measurement
Delete an existing unit of measurement.
- REST
- GraphQL
DELETE /items/ref_uom/:code
mutation {
delete_ref_uom_item(id: "uom_code") {
code
}
}
Returns
Empty body.
Sample Data
| Code | Description | Classification | Status |
|---|---|---|---|
| 23 | grams per cubic centimeter | density | published |
| 4H | micrometre | length, breadth, height, thickness, radius, radius of curvature, cartesian coordinates, diameter, length of path, distance | published |
| ACR | acre | area | published |
| BLD | dry barrel (US) | volume | published |
| BLL | barrel (US) | volume | published |