Skip to main content

Units Of Measure

Units of Measure to be used for Items.

Schema​

UnitOfMeasure​

Fields​

NameTypeDescriptionExample
idIDThe unique unit of measure ID"ckmnpybisiy5x08abky4g2d1f"
codestringThe unique human-readable code to represent this unit of measre. It's the value to be inserted at the Items"oz"
descriptionstringDescription of the unit of measure"ounce"
multiplierMultiplierThe multiplier used to calculate the item's extended price. Default: E.E
createdAtDateTimeWhen this object was created"2021-03-24 17:26:46.983Z"
updatedAtDateTimeWhen this object was last updated

Enums​

Multiplier​

ValueDescription
EEach
CCent
MMillion

Queries​

unitOfMeasure​

Read a single Unit of Measure. You must specify either the ID or the code.

Parameters​

NameDescriptionExample
idThe ID of the UOM to fetch"ckmnpybisiy5x08abky4g2d1f"
codeThe code of the UOM to fetch"oz"

Response​

A single Unit Of Measure object.

Example Query​

query {
unitOfMeasure(code: "oz") {
code
description
id
multiplier
}
}

Example Response​

{
"code": "oz",
"description": "ounce",
"id": "ckmnpybisiy5x08abky4g2d1f",
"multiplier": "E"
}

unitsOfMeasure​

Read all Units of Measure, with pagination.

Parameters​

Accepts all standard pagination parameters.

Allowed orderBy fields: code (default), createdAt, description, id, updatedAt.

Allowed filter fields: code, createdAt, description, id, updatedAt.

Response​

A list of Units of Measure objects.

Example Query​

query {
unitsOfMeasure(limit: 10, orderBy: code) {
code
description
id
multiplier
}
}

Example Response​

[
{
"code": "oz",
"description": "ounce",
"id": "ckmnpybisiy5x08abky4g2d1f",
"multiplier": "E"
},
{
"code": "m",
"description": "meter",
"id": "ckmnpybisiy5x08abky4g2d2k",
"multiplier": "C"
}
]

Mutations​

createUnitOfMeasure​

Creates a new Unit of Measure.

Parameters​

NameTypeDescriptionExample
codestringThe unique human-readable code to represent this UOM"oz"
descriptionstringDescription of the UOM"ounce"
multiplierMultiplierThe multiplier of the UOM. This will affect how the extended price shall be calculated. Default: E.E

Response​

The created Unit Of Measure.

Example Mutation​

mutation {
createUnitOfMeasure(
code: "24"
description: "Los Angeles"
) {
code
description
id
multiplier
}
}

Example Response​

  {
"code": "oz",
"description": "ounce",
"id": "ckmnpybisiy5x08abky4g2d1f",
"multiplier": "E"
}

updateUnitOfMeasure​

Updates a unit of measure.

Parameters​

You must specify either the ID or the code.

NameTypeDescriptionExample
idIDThe ID of the UOM to update."ckmnpybisiy5x08abky4g2d1f"
codestringThe unique human-readable code to represent this UOM"oz"
descriptionstringDescription of the UOM"ounce"
multiplierMultiplierThe multiplier of the UOM. This will affect how the extended price shall be calculated. Default: E.E

Response​

The updated Unit of Measure.

Example Mutation​

mutation {
updateUnitOfMeasure(
id: "ckmnpybisiy5x08abky4g2d1f"
multiplier: 'M'
) {
code
id
description
multiplier
}
}

Example Response​

  {
"code": "oz",
"description": "ounce",
"id": "ckmnpybisiy5x08abky4g2d1f",
"multiplier": "M"
}