getUOMsByCategory
Requires an authenticated session.
List the active units in one category, for unit pickers. Send productId to list the units available for that product.
Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.
Example:
- GraphQL
- cURL
query GetUOMsByCategory($category: UOMCategory!) {
getUOMsByCategory(category: $category) {
id
code
colorCode
name
pluralName
createdAt
conversionFrom {
id
createdAt
conversionFactor
deletedAt
deletedBy
enteredBy
}
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "query GetUOMsByCategory($category: UOMCategory!) {\n getUOMsByCategory(category: $category) {\n id\n code\n colorCode\n name\n pluralName\n createdAt\n conversionFrom {\n id\n createdAt\n conversionFactor\n deletedAt\n deletedBy\n enteredBy\n }\n }\n}",
"variables": {
"category": "AREA"
}
}
EOF
Variables:
{
"category": "AREA"
}
Response:
{
"data": {
"getUOMsByCategory": [
{
"id": "id",
"code": "string",
"colorCode": "string",
"name": "string",
"pluralName": "string",
"createdAt": "2025-01-15T00:00:00Z",
"conversionFrom": [
{
"id": "id",
"createdAt": "2025-01-15T00:00:00Z",
"conversionFactor": 0,
"deletedAt": "2025-01-15T00:00:00Z",
"deletedBy": "string",
"enteredBy": "string"
}
]
}
]
}
}
getUOMsByCategory(
category: UOMCategory!
productId: String
): [UnitOfMeasure!]!
Arguments
getUOMsByCategory.category ● UOMCategory! non-null enum
The unit category.
getUOMsByCategory.productId ● String scalar
The ID of a product to list the available units for.
Type
UnitOfMeasure object
A unit of measure in the organization's catalog, with its category, decimal rules and display settings.