Stock counts

Physical and cycle count batches, and the lines being counted.

The object#

FieldTypeDescription
idintegerNolaPro id.
typestringCycle counts a subset regularly; physical counts everything. Labels are Invcountbatch_model::$types; stored as an int and never exposed as one. One of cycle, physical.
inventorylocationidintegerThe location being counted.
invadjustmenttypeidintegerThe adjustment type variance posts through. It carries the GL account, so it decides where a discrepancy lands.
genuseridintegerWho the count is assigned to.
assigneddatestringWhen it was assigned.
acceptedbooleanThe counter accepted the assignment.
accepteddatestringWhen they accepted.
completebooleanCounting is finished; variance has not necessarily been posted.
completedatestringWhen counting finished.
postedbooleanVariance has been posted, turning differences into stock adjustments.
posteddatestringWhen it was posted.
noglpostbooleanPost the stock movement without a GL entry.
cancelbooleanCancelled counts stay readable.
entrydatestringWhen the batch was created.
lastchangedatestringLast modification. Drives modifiedsince.

Endpoints#

GET/inventorycounts 200

Stock count batches.

Physical and cycle count batches - how stock stays honest. A batch is opened against a location, assigned to someone, counted line by line, and then POSTED, which turns each variance into a stock adjustment through the batch's adjustment type. The read endpoints here expose the batch and its lines; posting is not yet available through the API. countset on a line is the field to watch: it separates a counted zero from a line nobody has looked at, and a count of 0 means nothing without it.

Requires scope items:read.

Parameters
NameInTypeNotes
typequerystringRestrict to one type: cycle or physical.
inventorylocationidquerystringRestrict to one stocking location.
genuseridquerystringRestrict to the user the batch is assigned to.
postedquerystringWhether the batch has been posted to stock. true or false.
completequerystringWhether counting has finished. A complete batch is not necessarily posted.
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.
curl \
  'https://acme.nolapro.com/!/api/v2/inventorycounts' \
  -H 'Authorization: Bearer $NP_TOKEN'
GET/inventorycounts/{id} 200404

One count batch.

The batch header. Its lines are at /inventorycounts/{id}/lines.

Requires scope items:read.

Parameters
NameInTypeNotes
idrequiredpathinteger
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 such record in this company.
curl \
  'https://acme.nolapro.com/!/api/v2/inventorycounts/104' \
  -H 'Authorization: Bearer $NP_TOKEN'
Response 200
{
    "type": "cycle",
    "inventorylocationid": 2,
    "invadjustmenttypeid": 0,
    "genuserid": 0
}
GET/inventorycounts/{id}/lines 200422

What is being counted, and what was found.

One line per item in the batch. count is what was found and countset says whether anyone has looked yet - a zero count and an uncounted line are different facts and the API keeps them apart.

Requires scope items:read.

Parameters
NameInTypeNotes
idrequiredpathintegerThe batch id.
When it fails
StatusCodeMeaning
422unknown_valueNo such record in this company.
curl \
  'https://acme.nolapro.com/!/api/v2/inventorycounts/104/lines' \
  -H 'Authorization: Bearer $NP_TOKEN'