getProductUOMs
Requires an authenticated session.
List the units (packs) set up on a product, optionally for one variant. Packs on a deactivated unit are left out unless includeInactive is true.
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 GetProductUOMs($productId: String!) {
getProductUOMs(productId: $productId) {
id
createdAt
barcode
conversionFactor
deletedAt
deletedBy
uom {
id
code
colorCode
name
pluralName
createdAt
}
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "query GetProductUOMs($productId: String!) {\n getProductUOMs(productId: $productId) {\n id\n createdAt\n barcode\n conversionFactor\n deletedAt\n deletedBy\n uom {\n id\n code\n colorCode\n name\n pluralName\n createdAt\n }\n }\n}",
"variables": {
"productId": "string"
}
}
EOF
Variables:
{
"productId": "string"
}
Response:
{
"data": {
"getProductUOMs": [
{
"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"
}
}
]
}
}
getProductUOMs(
includeInactive: Boolean
productId: String!
variantId: String
): [ProductUOM!]!
Arguments
getProductUOMs.includeInactive ● Boolean scalar
Set to true to include packs on deactivated units. Defaults to false.
getProductUOMs.productId ● String! non-null scalar
The ID of the product.
getProductUOMs.variantId ● String scalar
Limit the list to this variant's units: the product-wide ones plus the variant's own. Omit to list every row, as editor views do.
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.