The units products and operations are counted in, yours plus the shared reference set.
idintegercodestringShort code, unique within an account.
is_globalbooleanTrue for a shared unit, false for one your account created.
namestringnullableread_onlybooleanA NutraSoft-supplied unit your account may use but not change.
weight_in_gramsnumbernullableGrams per one of this unit; 0 or null for a unit that is not a weight.
/units-of-measurecatalog:readYour units plus the shared ones, marked is_global. Units with read_only true cannot be changed or deleted.
searchstringnullableFree-text match on name or code.
sortstringnullableComma-separated field:direction pairs, e.g. id:desc. Sortable: code, id, name. id is always added last, so paging is stable.
limitintegerRows to return. Maximum 200.
offsetintegerRows to skip. Maximum 10000: to read further, narrow the filters or page with updated_since.
data, with pagination.curl "https://public-api.nutrasoft.ca/v1/units-of-measure?limit=50" \
-H "Authorization: Bearer $NUTRASOFT_API_KEY"{
"data": [
{
"id": 123,
"code": "SAMPLE-01",
"is_global": false,
"name": "Sample name",
"read_only": false,
"weight_in_grams": 12.5
}
],
"pagination": {
"limit": 50,
"offset": 0,
"total": 1,
"has_more": false
},
"order": "id:asc"
}/units-of-measure/{uom_id}catalog:readuom_idintegerrequiredThe unit's id.
data.curl "https://public-api.nutrasoft.ca/v1/units-of-measure/123" \
-H "Authorization: Bearer $NUTRASOFT_API_KEY"{
"data": {
"id": 123,
"code": "SAMPLE-01",
"is_global": false,
"name": "Sample name",
"read_only": false,
"weight_in_grams": 12.5
}
}/units-of-measurecatalog:writeThe code must not already be used by one of your units or a shared one; a duplicate is a 409.
codestringrequiredShort code, unique among your units and the shared ones.
namestringrequiredweight_in_gramsnumberrequiredGrams per one of this unit. Send 0 for a unit that is not a weight.
data.curl -X POST "https://public-api.nutrasoft.ca/v1/units-of-measure" \
-H "Authorization: Bearer $NUTRASOFT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"code": "SAMPLE-01",
"name": "Sample name",
"weight_in_grams": 12.5
}'{
"data": {
"id": 123,
"code": "SAMPLE-01",
"is_global": false,
"name": "Sample name",
"read_only": false,
"weight_in_grams": 12.5
}
}/units-of-measure/{uom_id}catalog:writeOmitted fields are left unchanged and the code cannot be changed. Shared and read_only units are read-only (403).
uom_idintegerrequiredThe unit's id.
namestringnullableweight_in_gramsnumbernullabledata.curl -X PATCH "https://public-api.nutrasoft.ca/v1/units-of-measure/123" \
-H "Authorization: Bearer $NUTRASOFT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Sample name"
}'{
"data": {
"id": 123,
"code": "SAMPLE-01",
"is_global": false,
"name": "Sample name",
"read_only": false,
"weight_in_grams": 12.5
}
}/units-of-measure/{uom_id}catalog:writeRefused with 409 while a product, lot or document uses the unit. Shared and read_only units are read-only (403).
uom_idintegerrequiredThe unit's id.
data.curl -X DELETE "https://public-api.nutrasoft.ca/v1/units-of-measure/123" \
-H "Authorization: Bearer $NUTRASOFT_API_KEY"{
"data": {
"id": 123,
"code": "SAMPLE-01",
"is_global": false,
"name": "Sample name",
"read_only": false,
"weight_in_grams": 12.5
}
}