AlmondTill/G3N API

On this page

createCount

mutation · in the family Inventory operations

What it does

Create a new stock count — checking real shelves against the books at your organization.

CREATE a Count: the SELECTOR + countType + recountOf BIRTH-FIXED; the LF scoped + ACTIVE (STRICT birth); selector members scoped to that LF STATUS-FREE (counting an inactive zone/bin is legitimate — heal); recountOf must resolve to a POSTED count at the SAME LF; the org attribution derives from the live spine and stamps IMMUTABLE. Lines land at START.

Who may call it

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

Arguments

NameTypeRequiredNotes
inputCreateCountInput CreateCountInput!yesNo 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 ExampleCreateCount($input: CreateCountInput!) {
  createCount(input: $input) {
    id
    sysId
    type
    caption
    status
    parentId
    rootId
    createdAt
    updatedAt
    revisionNum
    revision
    organizationId
    countType
    recountOfCountId
  }
}

Variables:

{
  "input": {
    "caption": "Blue jeans",
    "logicalFacilityId": "01900000-0000-7000-8000-8026f71c0000",
    "countType": "physical"
  }
}

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

Example response

{
  "data": {
    "createCount": {
      "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