Skip to main content

addProductUOM

Requires permission products:product:update.

Add a unit (pack) to a product or to one of its variants. The same unit cannot be added twice to the same product or variant. Only the product's own base unit can be marked base, and a variant can have at most 3 sellable units. 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 AddProductUOM($data: CreateProductUOMInput!) {
addProductUOM(data: $data) {
id
createdAt
barcode
conversionFactor
deletedAt
deletedBy
uom {
id
code
colorCode
name
pluralName
createdAt
}
}
}

Variables:

{
"data": {
"conversionFactor": 0,
"isBase": true,
"isInventory": true,
"isPurchase": true,
"isSales": true,
"minOrderQty": 0,
"orderMultiple": 0,
"productId": "string",
"uomId": "string"
}
}

Response:

{
"data": {
"addProductUOM": {
"id": "id",
"createdAt": "2025-01-15T00:00:00Z",
"barcode": "string",
"conversionFactor": 0,
"deletedAt": "2025-01-15T00:00:00Z",
"deletedBy": "string",
"uom": {
"id": "id",
"code": "string",
"colorCode": "string",
"name": "string",
"pluralName": "string",
"createdAt": "2025-01-15T00:00:00Z"
}
}
}
}
addProductUOM(
data: CreateProductUOMInput!
): ProductUOM!

Arguments​

addProductUOM.data ● CreateProductUOMInput! non-null input​

The product unit (pack) to add.

Type​

ProductUOM object​

A unit (pack) set up on a product or variant: its conversion factor to the base unit, the documents it can be used on, and its ordering and pricing rules.