AlmondTill/G3N API

On this page

startCount

mutation · in the family Inventory operations

What it does

Start a stock count — the checklist of what to count is drawn up.

START a draft Count: resolves the selector ONCE to concrete lines (the scope's StockRecord shards [(II x bin x lot) — lot lines ride the records free] + whole-LF-only un-binned POOL lines), snapshots each line's on_hand, and FREEZES the line set. An EMPTY resolution refuses VALIDATION/EMPTY_SCOPE (the DECLARED start.empty_scope form — emits); an over-ceiling one refuses event-less NAMED {resolved, max: 32}. Re-gates the LF ACTIVE. Requires the doc CURRENT revision (OCC) + the unrestricted capability.

Who may call it

Capability area: Inventory operations — Receiving, counting, transferring and moving stock.

Arguments

NameTypeRequiredNotes
idID ID!yesThe id of the record.
revisionID ID!yesThe revision id you read on the record; the change is refused if an edit landed in the meantime.
reasonStringnoNo further notes.

Returns

Count Count! — A stock count: RECORDED stock vs PHYSICALLY-PRESENT stock at ONE LF, posting count_correct variance DELTAS (never absolute sets). Counts count ON_HAND presence only (condition rides reclass). posted is IMMUTABLE non-doomed history (recount = a NEW linked count); cancelled is the ONE doomed terminal (lists filter it). BLIND-BY-SHAPE while counting: line reads omit snapshot/expected/variance.

Example request

mutation ExampleStartCount($id: ID!, $revision: ID!, $reason: String) {
  startCount(id: $id, revision: $revision, reason: $reason) {
    id
    sysId
    type
    caption
    status
    parentId
    rootId
    createdAt
    updatedAt
    revisionNum
    revision
    organizationId
    countType
    recountOfCountId
  }
}

Variables:

{
  "id": "01900000-0000-7000-8000-37386ae00000",
  "revision": "01900000-0000-7000-8000-b7960e180000",
  "reason": "Correcting a miscount."
}

Send it with the envelope naming the version: "extensions": {"at": {"version": {"name":"genesis","number":0}}}.

Example response

{
  "data": {
    "startCount": {
      "id": "01900000-0000-7000-8000-37386ae00000",
      "sysId": "IC-EXMP-0000-000F",
      "type": "Count",
      "caption": "Blue jeans",
      "status": "draft",
      "parentId": "01900000-0000-7000-8000-065235280000",
      "rootId": "01900000-0000-7000-8000-a093dd800000",
      "createdAt": "2027-01-31T00:00:00.000Z",
      "updatedAt": "2027-01-31T00:00:00.000Z",
      "revisionNum": 1,
      "revision": "01900000-0000-7000-8000-b7960e180000",
      "organizationId": "01900000-0000-7000-8000-44b781470000",
      "countType": "physical",
      "recountOfCountId": "01900000-0000-7000-8000-200395ec0000"
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": {
          "name": "genesis",
          "number": 0
        },
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}

Errors this call can answer

Used in