iotoms Docs

Set an item's base unit of measure

PUT
/api/v1/catalog/items/{itemId}/base-uom

Sets the unit the item is stocked in. Every other unit's conversion factor is expressed relative to this one. Safe to repeat. Returns the item's full unit list.

How to use it

  1. Pick the stocking unit from List units of measure.
  2. Send its uomId. If the item does not have that unit yet, it is added with factor 1 and marked as purchase and sell default (other units keep their own default flags); if it already has it, its factor is reset to 1.
  3. Other units' factors are read relative to this unit, so review them with List an item's units of measure.

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 make the item's base unit, from List units of measure. Its conversion factor becomes 1.

Formatuuid

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 full unit list (base unit plus every conversion unit) after the change.

Example Request
curl -X PUT 'https://beta.iotoms.com/api/v1/catalog/items/string/base-uom' \  -H 'X-TenantID: your-tenant-code' \  -H 'Content-Type: application/json' \  -d '{  "uomId": "4df47f00-a69d-4ff2-b50d-4a7649a4b70c"}'
Example Response
{  "status": "string",  "message": "string",  "data": {    "itemId": "string",    "catchWeight": true,    "baseUomId": "0c43b7c4-22c4-4b37-9c1a-485778bd5b04",    "units": [      {        "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      }    ],    "warnings": [      "string"    ]  }}