AlmondTill/G3N API

stockCard

query · in the family Reading your records

What it does

One item’s full stock story at a location — every movement, in order.

The Stock Card: one InventoryItem's posted movement entries, newest-first + bounded (limit defaults 50, clamps 1..200; before = an exclusive upper entry-id bound — v7 ids are time-ordered, the older-page cursor). Voided entries excluded.

Before you call

A bearer session from an API key (see Authentication and key hygiene) or a signed-in user.

Capability area: Reading your records — Looking up and listing the records of your organization.

Roles that may call it:

What happens

Reads only — the audit view of how the on-hand got here.

Arguments

NameTypeRequiredNotes
inventoryItemIdID ID!yes
limitIntnoHow many records to answer at most; a page may hold fewer.
beforeIDno

Returns

InventoryEntry [InventoryEntry!]! — ONE posted Stock-Card movement fact: the magnitude rides quantity (positive), the direction rides fromBucket/toBucket (the classic in/out card form; a bucket balance = sum of to minus sum of from).

Example request

graphql
query ExampleStockCard($inventoryItemId: ID!, $limit: Int) {
  stockCard(inventoryItemId: $inventoryItemId, limit: $limit) {
    id
    type
    caption
    status
    parentId
    rootId
    movement
    quantity
    fromBucket
    toBucket
    reason
    refs
    overcommitted
    fromBinId
    toBinId
    lotCode
    createdAt
    updatedAt
    revision
    revisionNum
  }
}

Variables:

json
{
  "inventoryItemId": "01900000-0000-7000-8000-ab0d13b80000",
  "limit": 1
}

Example response

json
{
  "data": {
    "stockCard": [
      {
        "id": "01900000-0000-7000-8000-37386ae00000",
        "type": "<type>",
        "caption": "Blue jeans",
        "status": "<status>",
        "parentId": "01900000-0000-7000-8000-eacdfcfd0000",
        "rootId": "01900000-0000-7000-8000-a1295a650000",
        "movement": "receive",
        "quantity": "2",
        "fromBucket": "on_hand",
        "toBucket": "on_hand",
        "reason": "Correcting a miscount.",
        "refs": [
          "<refs>"
        ],
        "overcommitted": true,
        "fromBinId": "01900000-0000-7000-8000-0bff2d0e0000",
        "toBinId": "01900000-0000-7000-8000-cb66393d0000",
        "lotCode": "BJ-001",
        "createdAt": "2027-01-31T00:00:00.000Z",
        "updatedAt": "2027-01-31T00:00:00.000Z",
        "revision": "01900000-0000-7000-8000-53c6eea90000",
        "revisionNum": 1
      }
    ]
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": null,
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}

Errors this call can answer

Used in