Unit names

Units of measure - Each, M, Pound - used on items, invoice lines and order lines. This list is not company scoped. unitname has no company column, so every company on the install shares one set of units and a change here is visible to all of them immediately.

The object#

FieldTypeDescription
idread-onlyintegerNolaPro id. This is what item and line records store.
unitnamestring(50)The unit name as it appears on documents. Trimmed on input. Matching is case insensitive, so each and Each are the same unit.
cancelread-onlybooleanTrue once cancelled. Cancelled records stay referenced by history and keep their id.
externalidstring(100)Your own key for this unit. Unlike the unit itself this is per company, so each company can map its own code onto the same shared unit.
lastchangedateread-onlystringLast modification. Drives modifiedsince.

Endpoints#

GET/unitnames 200403

List units of measure.

Small and stable - most installs have fewer than fifty. This list is not company scoped. unitname has no company column, so every company on the install shares one set of units and a change here is visible to all of them immediately.

Requires scope items:read.

Parameters
NameInTypeNotes
unitnamequerystringPartial match, case insensitive.
cancelquerystringDefaults to false, which hides cancelled records. Pass true for only cancelled, or any for both.
externalidquerystringExact match on your own key. Scoped to your company.
modifiedsincequerystringRFC 3339 UTC timestamp. Returns only records changed since then, including cancelled ones - so cancel defaults to any rather than false when this is used. The response carries _meta.synced_through; store it and send it back next time.
includequerystringComma-separated extras to embed. Only custom_fields is available: the extra fields this install has defined on the record. Off by default, and an unrecognised value is refused rather than ignored. See Conventions.
When it fails
StatusCodeMeaning
403insufficient_scopeToken lacks unitnames:read.
curl \
  'https://acme.nolapro.com/!/api/v2/unitnames' \
  -H 'Authorization: Bearer $NP_TOKEN'
POST/unitnames 201400409403

Create a unit of measure.

If a cancelled unit already has this name it is reactivated rather than duplicated, and _meta.warnings says so. If an active one does, you get 409. Matching is case insensitive. This list is not company scoped. unitname has no company column, so every company on the install shares one set of units and a change here is visible to all of them immediately.

Requires scope items:write.

Parameters
NameInTypeNotes
Body
FieldTypeDescription
unitnamerequiredstring(50)Trimmed. Must not be empty.
externalidstringOptional. Your own key, scoped to your company.
When it fails
StatusCodeMeaning
400invalid_requestname was missing, empty, or whitespace only.
409duplicateAn active unit already has that name. The body names its id.
403insufficient_scopeToken lacks unitnames:write.
curl -X POST \
  'https://acme.nolapro.com/!/api/v2/unitnames' \
  -H 'Authorization: Bearer $NP_TOKEN'
Response 201
{
    "id": 1,
    "unitname": "Each",
    "cancel": false,
    "externalid": "EA",
    "lastchangedate": "2026-07-31T14:02:11Z"
}
GET/unitnames/{id} 200404

Retrieve one unit.

Requires scope items:read.

Parameters
NameInTypeNotes
idrequiredpathintegerThe unit id.
includequerystringComma-separated extras to embed. Only custom_fields is available: the extra fields this install has defined on the record. Off by default, and an unrecognised value is refused rather than ignored. See Conventions.
When it fails
StatusCodeMeaning
404not_foundNo unit with that id.
curl \
  'https://acme.nolapro.com/!/api/v2/unitnames/104' \
  -H 'Authorization: Bearer $NP_TOKEN'
Response 200
{
    "id": 1,
    "unitname": "Each",
    "cancel": false,
    "externalid": "EA",
    "lastchangedate": "2026-07-31T14:02:11Z"
}
PATCH/unitnames/{id} 200400404409

Rename a unit.

The only writable field is name. This renames the unit for every company on the install, including on documents already issued, so _meta.warnings always carries shared_across_companies. Send If-Match if anything else might be editing it.

Requires scope items:write.

Parameters
NameInTypeNotes
idrequiredpathintegerThe unit id.
Body
FieldTypeDescription
unitnamestring(50)
externalidstring
When it fails
StatusCodeMeaning
400invalid_requestname was empty or too long.
404not_foundNo unit with that id.
409duplicateAnother active unit already has that name.
curl -X PATCH \
  'https://acme.nolapro.com/!/api/v2/unitnames/104' \
  -H 'Authorization: Bearer $NP_TOKEN'
Response 200
{
    "id": 1,
    "unitname": "Each",
    "cancel": false,
    "externalid": "EA",
    "lastchangedate": "2026-07-31T14:02:11Z"
}
DELETE/unitnames/{id} 200403404

Cancel a unit.

Sets the cancel flag. Nothing is removed, and documents that already reference this unit keep doing so - _meta.warnings reports how many. Needs unitnames:cancel, which unitnames:write does not imply. Cancelling an already cancelled unit succeeds. This list is not company scoped. unitname has no company column, so every company on the install shares one set of units and a change here is visible to all of them immediately.

Requires scope items:cancel.

Parameters
NameInTypeNotes
idrequiredpathintegerThe unit id.
When it fails
StatusCodeMeaning
403insufficient_scopeToken has unitnames:write but not unitnames:cancel.
404not_foundNo unit with that id.
curl -X DELETE \
  'https://acme.nolapro.com/!/api/v2/unitnames/104' \
  -H 'Authorization: Bearer $NP_TOKEN'
Response 200
{
    "id": 1,
    "unitname": "Each",
    "cancel": false,
    "externalid": "EA",
    "lastchangedate": "2026-07-31T14:02:11Z"
}
POST/unitnames/batch 207400

Create many units in one request.

Always answers 207, with one entry per item in the order sent. See Conventions.

Requires scope items:write.

Parameters
NameInTypeNotes
Body array
FieldTypeDescription
unitnamerequiredstring(50)
When it fails
StatusCodeMeaning
400invalid_requestThe envelope was wrong - not an array, or over the size cap.
curl -X POST \
  'https://acme.nolapro.com/!/api/v2/unitnames/batch' \
  -H 'Authorization: Bearer $NP_TOKEN'