On this page
captureCount
mutation · in the family Inventory operations
What it does
Enter counted quantities into an open stock count.
CAPTURE counted quantities onto a COUNTING Count: point-reads each captured line's live on_hand and stamps {countedQty, expectedAtCapture, capturedAt} together under the doc OCC — a rollup-only revision, NO FSM event (the receive-rollup precedent). Repeatable; a re-capture OVERWRITES the line's trio while counting (the fat-finger cure); an explicit ZERO is a legitimate capture; unknown lineNos refuse NAMED. The LF is never re-gated here (heal). Requires the doc CURRENT revision (OCC) + the unrestricted capability.
What happens
Captures what was physically counted; nothing posts to stock yet.
Who may call it
Capability area: Inventory operations — Receiving, counting, transferring and moving stock.
- Owner
- Manager
- Associate Manager
- Warehouse Associate
- An API key whose scope allows
api:captureCount
Arguments
| Name | Type | Required | Notes |
|---|---|---|---|
input | CaptureCountInput CaptureCountInput! | yes | No further notes. |
revision | ID ID! | yes | The revision id you read on the record; the change is refused if an edit landed in the meantime. |
reason | String | no | No 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 ExampleCaptureCount($input: CaptureCountInput!, $revision: ID!, $reason: String) {
captureCount(input: $input, revision: $revision, reason: $reason) {
id
sysId
type
caption
status
parentId
rootId
createdAt
updatedAt
revisionNum
revision
organizationId
countType
recountOfCountId
}
}
Variables:
{
"input": {
"countId": "01900000-0000-7000-8000-931a95590000",
"lines": [
{
"lineNo": 1,
"countedQty": "<counted qty>"
}
]
},
"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": {
"captureCount": {
"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
VALIDATION/INVALID— Something in the request is not valid. (VALIDATION)AUTHN/REQUIRED— Sign in to do this. (AUTHN)AUTHZ/FORBIDDEN— Your role does not allow this action. (AUTHZ)RATE_LIMIT/THROTTLED— Too many requests in a short time. (RATE_LIMIT)NOT_FOUND/*— That record could not be found. (NOT_FOUND)CONFLICT/*— The record’s state, or a change made in the meantime, does not allow this; the codes are on the CONFLICT page. (CONFLICT)VALIDATION/VERSION_REQUIRED— The request did not say which app version it came from. (VALIDATION)