Stock an item at a location
Give a variant its stock identity at a location, book stock in against a purchase as it arrives, and check that the books add up.
Warehouse · a play in 3 steps.
The steps
- Create the item’s stock identity at the location. — createInventoryItem
- Book stock in against a purchase — the on-hand rises, the receipt records what arrived. — receiveStock
- Check the item’s ledger against its balances — do the books add up? — verifyInventoryItem
The calls
Every operation this use case runs, in the order it first appears, with the request and the response its reference page shows.
createInventoryItem
createInventoryItem — mutation · Create a new inventory item — one variant’s stock identity at your organization.
Example request
mutation ExampleCreateInventoryItem($input: NewInventoryItemInput!) {
createInventoryItem(input: $input) {
id
sysId
type
caption
status
parentId
rootId
createdAt
updatedAt
revisionNum
revision
logicalFacilityId
styleType
controlClass
onHandQty
reservedQty
inTransitQty
damagedQty
heldQty
onOrderQty
availableQty
}
}
Variables:
{
"input": {
"caption": "Blue jeans",
"variantId": "01900000-0000-7000-8000-8415e73b0000",
"logicalFacilityId": "01900000-0000-7000-8000-8026f71c0000"
}
}
Send it with the envelope naming the version: "extensions": {"at": {"version": {"name":"genesis","number":0}}}.
Example response
{
"data": {
"createInventoryItem": {
"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
}
}
}
}
}
receiveStock
receiveStock — mutation · Book stock in against a purchase — goods arriving at your door.
Example request
mutation ExampleReceiveStock($input: ReceiveStockInput!) {
receiveStock(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",
"unitCost": {
"currency": "USD",
"amount": "10.00"
},
"caption": "Blue jeans"
}
}
Send it with the envelope naming the version: "extensions": {"at": {"version": {"name":"genesis","number":0}}}.
Example response
{
"data": {
"receiveStock": {
"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
}
}
}
}
}
verifyInventoryItem
verifyInventoryItem — query · Reconcile one item’s ledger against its cached balances — “do the books add up?”.
Example request
query ExampleVerifyInventoryItem($inventoryItemId: ID!) {
verifyInventoryItem(inventoryItemId: $inventoryItemId) {
entryCount
consistent
recordCount
recordsConsistent
openTransferReservedQty
reservedConsistent
}
}
Variables:
{
"inventoryItemId": "01900000-0000-7000-8000-9307d9650000"
}
Example response
{
"data": {
"verifyInventoryItem": {
"entryCount": 1,
"consistent": true,
"recordCount": 1,
"recordsConsistent": true,
"openTransferReservedQty": "<open transfer reserved qty>",
"reservedConsistent": true
}
},
"extensions": {
"at": {
"callId": "01EXAMPLE-CALL-ID",
"version": {
"requested": null,
"serviced": {
"name": "genesis",
"number": 0
}
}
}
}
}