Skip to main content

createUOMConversion

Requires permission products:product:update.

Define how one unit converts to another. Both units must exist and be in the same category, and no conversion may already exist between them in either direction. The reverse conversion is created automatically. Needs the products update 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 CreateUOMConversion($data: CreateUOMConversionInput!) {
createUOMConversion(data: $data) {
id
createdAt
conversionFactor
deletedAt
deletedBy
enteredBy
fromUOM {
id
code
colorCode
name
pluralName
createdAt
}
}
}

Variables:

{
"data": {
"conversionFactor": 0,
"fromUOMId": "string",
"toUOMId": "string"
}
}

Response:

{
"data": {
"createUOMConversion": {
"id": "id",
"createdAt": "2025-01-15T00:00:00Z",
"conversionFactor": 0,
"deletedAt": "2025-01-15T00:00:00Z",
"deletedBy": "string",
"enteredBy": "string",
"fromUOM": {
"id": "id",
"code": "string",
"colorCode": "string",
"name": "string",
"pluralName": "string",
"createdAt": "2025-01-15T00:00:00Z"
}
}
}
}
createUOMConversion(
data: CreateUOMConversionInput!
): UOMConversion!

Arguments​

createUOMConversion.data ● CreateUOMConversionInput! non-null input​

The conversion to create.

Type​

UOMConversion object​

A conversion between two units of the same category. Creating one also creates the reverse conversion.