iotoms Docs

Create a unit of measure

POST
/api/v1/catalog/uom

Creates a unit of measure with a unique code, a name, a category (count, weight, volume or length) and the number of decimal places allowed.

How to use it

  1. Choose a short code not already used (check List units of measure); it is stored in upper case.
  2. Send code, name, category (COUNT, WEIGHT, VOLUME or LENGTH) and decimalPrecision.
  3. Use the returned id when giving items, bills of materials or requests for quote a unit.

Authorization

BearerAuth
headerAuthorizationBearer <JWT>

Header Parameters

X-TenantID*string

Your merchant's tenant code — the value typed in the Domain field on the iotoms login screen. See Concepts.

Request Body

application/json
  1. body
code*string

Short unique code for the unit (e.g. KG). Trimmed and stored in upper case; a code that already exists is rejected.

name*string

Display name, e.g. Kilogram.

category*string

What the unit measures: COUNT, WEIGHT, VOLUME or LENGTH.

Value in"COUNT""WEIGHT""VOLUME""LENGTH"
decimalPrecision*integer

Number of decimal places allowed for quantities in this unit (0 or more). Defaults to 0.

Formatint32
status*string

Initial status: ACTIVE, INACTIVE, ARCHIVED or DELETED. Defaults to ACTIVE.

Value in"ACTIVE""INACTIVE""ARCHIVED""DELETED"

Response Body

OK

*/*
  1. response
status*string

Outcome of the call: SUCCESS when the request worked, ERROR when it did not.

message*string

Short human-readable message describing the result, for logs or display; do not parse it.

data?

The unit of measure as it is now stored.

Example Request
curl -X POST 'https://beta.iotoms.com/api/v1/catalog/uom' \  -H 'X-TenantID: your-tenant-code' \  -H 'Content-Type: application/json' \  -d '{  "code": "string",  "name": "string",  "category": "COUNT",  "decimalPrecision": 0,  "status": "ACTIVE"}'
Example Response
{  "status": "string",  "message": "string",  "data": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "code": "string",    "name": "string",    "category": "COUNT",    "decimalPrecision": 0,    "status": "ACTIVE",    "inUse": true  }}