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"2021-03-24 17:26:46.983Z"

Enums​

Multiplier​

ValueDescription
EEach
CCent
MMillion

REST Endpoints​

GET /units-of-measure/:idOrCode​

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 Request​

GET https://api.kojo.tech/units-of-measure/oz

Example Response​

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

GET /units-of-measure​

Read all Units of Measure, with pagination.

Parameters​

Accepts all standard pagination parameters.

Default orderBy field: code

Additional allowed orderBy fields: createdAt, description, id, updatedAt.

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

Response​

A list of Units of Measure objects.

Example Request​

GET https://api.kojo.tech/units-of-measure

Example Response​

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

POST /units-of-measure​

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 Request​

POST https://api.kojo.tech/units-of-measure
{
"code": "oz",
"description": "ounce",
"multiplier": "E"
}

Example Response​

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

PATCH /units-of-measure/:idOrCode​

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 Request​

POST https://api.kojo.tech/units-of-measure
{
code: 'oz',
multiplier: 'M'
}

Example Response​

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