Units Of Measure
Units of Measure to be used for Items.
Schema​
UnitOfMeasure​
Fields​
| Name | Type | Description | Example |
|---|---|---|---|
| id | ID | The unique unit of measure ID | "ckmnpybisiy5x08abky4g2d1f" |
| code | string | The unique human-readable code to represent this unit of measre. It's the value to be inserted at the Items | "oz" |
| description | string | Description of the unit of measure | "ounce" |
| multiplier | Multiplier | The multiplier used to calculate the item's extended price. Default: E. | E |
| createdAt | DateTime | When this object was created | "2021-03-24 17:26:46.983Z" |
| updatedAt | DateTime | When this object was last updated |
Enums​
Multiplier​
| Value | Description |
|---|---|
| E | Each |
| C | Cent |
| M | Million |
Queries​
unitOfMeasure​
Read a single Unit of Measure. You must specify either the ID or the code.
Parameters​
| Name | Description | Example |
|---|---|---|
| id | The ID of the UOM to fetch | "ckmnpybisiy5x08abky4g2d1f" |
| code | The 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​
| Name | Type | Description | Example |
|---|---|---|---|
| code | string | The unique human-readable code to represent this UOM | "oz" |
| description | string | Description of the UOM | "ounce" |
| multiplier | Multiplier | The 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.
| Name | Type | Description | Example |
|---|---|---|---|
| id | ID | The ID of the UOM to update. | "ckmnpybisiy5x08abky4g2d1f" |
| code | string | The unique human-readable code to represent this UOM | "oz" |
| description | string | Description of the UOM | "ounce" |
| multiplier | Multiplier | The 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"
}