Skip to main content

createUOM

Requires permission products:product:create.

Create a unit of measure. The code must be unique in the organization, ignoring case. A COUNT unit must have 0 decimal places and cannot allow fractions. Marking the unit as base clears the base flag from the category's current base unit. Needs the products create permission.

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:

mutation CreateUOM($data: CreateUOMInput!) {
createUOM(data: $data) {
id
code
colorCode
name
pluralName
createdAt
conversionFrom {
id
createdAt
conversionFactor
deletedAt
deletedBy
enteredBy
}
}
}

Variables:

{
"data": {
"allowFractional": true,
"category": "AREA",
"code": "string",
"decimalPlaces": 0,
"displayOrder": 0,
"isBase": true,
"name": "string",
"symbol": "string"
}
}

Response:

{
"data": {
"createUOM": {
"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"
}
]
}
}
}
createUOM(
data: CreateUOMInput!
): UnitOfMeasure!

Arguments​

createUOM.data ● CreateUOMInput! non-null input​

The unit to create.

Type​

UnitOfMeasure object​

A unit of measure in the organization's catalog, with its category, decimal rules and display settings.