updateUOM
Requires permission products:product:update.
Change a unit of measure. Only the fields you send change, and the code and category cannot be changed. A COUNT unit keeps its whole-number rules. A unit that is the organization's default unit, or the base unit of a product, cannot be deactivated. 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:
- GraphQL
- cURL
mutation UpdateUOM($data: UpdateUOMInput!, $id: String!) {
updateUOM(data: $data, id: $id) {
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": "mutation UpdateUOM($data: UpdateUOMInput!, $id: String!) {\n updateUOM(data: $data, id: $id) {\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": {
"data": {},
"id": "string"
}
}
EOF
Variables:
{
"data": {},
"id": "string"
}
Response:
{
"data": {
"updateUOM": {
"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"
}
]
}
}
}
updateUOM(
data: UpdateUOMInput!
id: String!
): UnitOfMeasure!
Arguments
updateUOM.data ● UpdateUOMInput! non-null input
The unit changes.
updateUOM.id ● String! non-null scalar
The ID of the unit of measure.
Type
UnitOfMeasure object
A unit of measure in the organization's catalog, with its category, decimal rules and display settings.