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 | "2021-03-24 17:26:46.983Z" |
Enums​
Multiplier​
| Value | Description |
|---|---|
| E | Each |
| C | Cent |
| M | Million |
REST Endpoints​
GET /units-of-measure/:idOrCode​
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 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​
| 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 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.
| 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 Request​
POST https://api.kojo.tech/units-of-measure
{
code: 'oz',
multiplier: 'M'
}
Example Response​
{
"code": "oz",
"description": "ounce",
"id": "ckmnpybisiy5x08abky4g2d1f",
"multiplier": "M"
}