iotoms Docs

Add a unit of measure to an item

POST
/api/v1/catalog/items/{itemId}/uoms

Adds a conversion unit to an item, for example a case of 12. factorToBase must be greater than zero, and each unit can be added to an item only once.

How to use it

  1. Set the item's base unit first with Set an item's base unit of measure, and pick the unit to add from List units of measure.
  2. Send uomId and factorToBase (how many base units it holds, above zero), plus any default flags.
  3. A default flag you set is removed from the item's other units. Adding the same unit twice is rejected.

Authorization

BearerAuth
headerAuthorizationBearer <JWT>

Path Parameters

itemId*string

Item code, from List items.

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
uomId*string

Unit to add, from List units of measure. Each unit can be added to an item only once.

Formatuuid
factorToBase*number

How many base units one of this unit equals, e.g. 12 for a case of 12. Must be greater than zero.

isPurchaseDefault*boolean

Whether this is the item's default unit on purchase orders. Only one unit per item holds it; setting it clears it from the others.

isSellDefault*boolean

Whether this is the item's default selling unit. Only one unit per item holds it; setting it clears it from the others.

isReceiveDefault*boolean

Whether this is the item's default unit when receiving goods. Only one unit per item holds it; setting it clears it from the others.

isCountDefault*boolean

Whether this is the item's default unit for stock counts. Only one unit per item holds it; setting it clears it from the others.

nominalWeight?|

Optional. Catch-weight items: expected weight of one pack in base units, used for planning and variance only.

tareWeight?|

Optional. Empty-packaging weight netted out of gross scale readings at goods receipt.

Response Body

OK

*/*
  1. response
status*string

Outcome of the call: SUCCESS when it worked, ERROR when it failed.

message*string

Short human-readable message describing the outcome, for example "Vendor created". Do not parse it.

data?

The item's unit of measure as stored after the change.

Example Request
curl -X POST 'https://beta.iotoms.com/api/v1/catalog/items/string/uoms' \  -H 'X-TenantID: your-tenant-code' \  -H 'Content-Type: application/json' \  -d '{  "uomId": "4df47f00-a69d-4ff2-b50d-4a7649a4b70c",  "factorToBase": 0,  "isPurchaseDefault": true,  "isSellDefault": true,  "isReceiveDefault": true,  "isCountDefault": true}'
Example Response
{  "status": "string",  "message": "string",  "data": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "uomId": "4df47f00-a69d-4ff2-b50d-4a7649a4b70c",    "code": "string",    "name": "string",    "category": "COUNT",    "decimalPrecision": 0,    "factorToBase": 0,    "isBase": true,    "isPurchaseDefault": true,    "isReceiveDefault": true,    "isCountDefault": true,    "nominalWeight": 0,    "tareWeight": 0,    "isSellDefault": true  }}