Correct stock on hand, with a reason
Write stock on or off outside buying and selling — corrections, damage, shrink — with a reason code, move stock between buckets without changing the total, and read the full movement story of an item.
Warehouse · a play in 3 steps.
The steps
- Write stock on or off with a reason code — a signed movement, recorded forever. — adjustStock
- Move stock between buckets — sellable to damaged — without changing the total. — reclassStock
- Read the item’s full stock story at the location — every movement, in order. — stockCard
The calls
Every operation this use case runs, in the order it first appears, with the request and the response its reference page shows.
adjustStock
adjustStock — mutation · Write stock on or off outside of buying and selling — corrections, damage, shrink — with a reason code.
Example request
mutation ExampleAdjustStock($input: AdjustStockInput!) {
adjustStock(input: $input) {
inventoryItem {
id
sysId
type
caption
status
parentId
rootId
createdAt
updatedAt
revisionNum
revision
logicalFacilityId
styleType
controlClass
onHandQty
reservedQty
inTransitQty
damagedQty
heldQty
onOrderQty
availableQty
}
}
}
Variables:
{
"input": {
"inventoryItemId": "01900000-0000-7000-8000-9307d9650000",
"quantity": "2",
"bucket": "on_hand",
"reason": "Correcting a miscount."
}
}
Send it with the envelope naming the version: "extensions": {"at": {"version": {"name":"genesis","number":0}}}.
Example response
{
"data": {
"adjustStock": {
"inventoryItem": {
"id": "01900000-0000-7000-8000-37386ae00000",
"sysId": "IV-EXMP-0000-000F",
"type": "InventoryItem",
"caption": "Blue jeans",
"status": "active",
"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",
"logicalFacilityId": "01900000-0000-7000-8000-8026f71c0000",
"styleType": "<style type>",
"controlClass": "<control class>",
"onHandQty": "<on hand qty>",
"reservedQty": "<reserved qty>",
"inTransitQty": "<in transit qty>",
"damagedQty": "<damaged qty>",
"heldQty": "<held qty>",
"onOrderQty": "<on order qty>",
"availableQty": "<available qty>"
}
}
},
"extensions": {
"at": {
"callId": "01EXAMPLE-CALL-ID",
"version": {
"requested": {
"name": "genesis",
"number": 0
},
"serviced": {
"name": "genesis",
"number": 0
}
}
}
}
}
reclassStock
reclassStock — mutation · Move stock between buckets (for example sellable to damaged) without changing the total.
Example request
mutation ExampleReclassStock($input: ReclassStockInput!) {
reclassStock(input: $input) {
inventoryItem {
id
sysId
type
caption
status
parentId
rootId
createdAt
updatedAt
revisionNum
revision
logicalFacilityId
styleType
controlClass
onHandQty
reservedQty
inTransitQty
damagedQty
heldQty
onOrderQty
availableQty
}
}
}
Variables:
{
"input": {
"inventoryItemId": "01900000-0000-7000-8000-9307d9650000",
"quantity": "2",
"fromBucket": "on_hand",
"toBucket": "on_hand",
"heldReason": "<held reason>"
}
}
Send it with the envelope naming the version: "extensions": {"at": {"version": {"name":"genesis","number":0}}}.
Example response
{
"data": {
"reclassStock": {
"inventoryItem": {
"id": "01900000-0000-7000-8000-37386ae00000",
"sysId": "IV-EXMP-0000-000F",
"type": "InventoryItem",
"caption": "Blue jeans",
"status": "active",
"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",
"logicalFacilityId": "01900000-0000-7000-8000-8026f71c0000",
"styleType": "<style type>",
"controlClass": "<control class>",
"onHandQty": "<on hand qty>",
"reservedQty": "<reserved qty>",
"inTransitQty": "<in transit qty>",
"damagedQty": "<damaged qty>",
"heldQty": "<held qty>",
"onOrderQty": "<on order qty>",
"availableQty": "<available qty>"
}
}
},
"extensions": {
"at": {
"callId": "01EXAMPLE-CALL-ID",
"version": {
"requested": {
"name": "genesis",
"number": 0
},
"serviced": {
"name": "genesis",
"number": 0
}
}
}
}
}
stockCard
stockCard — query · One item’s full stock story at a location — every movement, in order.
Example request
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:
{
"inventoryItemId": "01900000-0000-7000-8000-9307d9650000",
"limit": 1
}
Example response
{
"data": {
"stockCard": [
{
"id": "01900000-0000-7000-8000-37386ae00000",
"type": "<type>",
"caption": "Blue jeans",
"status": "<status>",
"parentId": "01900000-0000-7000-8000-065235280000",
"rootId": "01900000-0000-7000-8000-a093dd800000",
"movement": "receive",
"quantity": "2",
"fromBucket": "on_hand",
"toBucket": "on_hand",
"reason": "Correcting a miscount.",
"refs": [
"<refs>"
],
"overcommitted": true,
"fromBinId": "01900000-0000-7000-8000-f29255530000",
"toBinId": "01900000-0000-7000-8000-c548ffc80000",
"lotCode": "BJ-001",
"createdAt": "2027-01-31T00:00:00.000Z",
"updatedAt": "2027-01-31T00:00:00.000Z",
"revision": "01900000-0000-7000-8000-b7960e180000",
"revisionNum": 1
}
]
},
"extensions": {
"at": {
"callId": "01EXAMPLE-CALL-ID",
"version": {
"requested": null,
"serviced": {
"name": "genesis",
"number": 0
}
}
}
}
}