On this page
inventoryOnOrderAudit
query · in the family Reading your records
What it does
Check the on-order figures — each stock item’s stored on order against what your open purchase orders actually add up to, one page of items at a time.
THE ON-ORDER AUDIT: ONE page of your tenant's stock junctions checked against the derived truth — for each InventoryItem the STORED onOrderQty (maintained by the purchase-order walks + the receipt post) beside the figure DERIVED from the receivable purchase orders' open lines (computed ONCE per call), answering ONLY the rows that differ, the page's driftCount, and the cursor for the next page. Doomed junctions are skipped. An order still walking (issuing / cancelling / closing) reads as drift until it lands. A READ — nothing written; repairInventoryOnOrder stamps one cell. 'limit' bounds the page; 'nextToken' = the prior page's cursor, verbatim (opaque). Requires authentication; scoped server-side to the principal's rootId.
What happens
Reads only — nothing changes. Only items whose figure disagrees are listed, with both numbers; a clean page lists none and answers a drift count of zero.
Careful
An order still walking shows as drift until it lands — audit after the walk has finished.
Who may call it
Capability area: Reading your records — Looking up and listing the records of your organization.
- Owner
- System Administrator
- Manager
- Associate Manager
- Warehouse Associate
- Sales Associate
- An API key whose scope allows
api:inventoryOnOrderAudit
Arguments
| Name | Type | Required | Notes |
|---|---|---|---|
limit | Int | no | How many records to answer at most; a page may hold fewer. |
nextToken | String | no | The cursor from the previous page, passed back exactly as received. |
Returns
InventoryOnOrderAuditPage InventoryOnOrderAuditPage! — ONE page of the on-order audit: the drifted rows of this page of the tenant's junctions, the page's drift count, and the junction cursor (null on the last page).
This is a page: items holds the records and nextToken the cursor for the next page — pass it back verbatim until it is null. See paging.
Example request
query ExampleInventoryOnOrderAudit($limit: Int) {
inventoryOnOrderAudit(limit: $limit) {
items {
inventoryItemId
variantId
logicalFacilityId
stored
derived
}
driftCount
nextToken
}
}
Variables:
{
"limit": 1
}
Example response
{
"data": {
"inventoryOnOrderAudit": {
"items": [
{
"inventoryItemId": "01900000-0000-7000-8000-9307d9650000",
"variantId": "01900000-0000-7000-8000-8415e73b0000",
"logicalFacilityId": "01900000-0000-7000-8000-8026f71c0000",
"stored": "<stored>",
"derived": "<derived>"
}
],
"driftCount": 1,
"nextToken": "<the cursor from the previous page>"
}
},
"extensions": {
"at": {
"callId": "01EXAMPLE-CALL-ID",
"version": {
"requested": null,
"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)