repairInventoryOnOrder
mutation · in the family Inventory operations
What it does
Correct one stock item’s on-order figure to what your open purchase orders add up to — with a reason.
No stock moves and no Stock-Card entry posts — on order is bookkeeping beside the five buckets, never a bucket. 'reason' is required and non-blank (blank/oversize refuse VALIDATION/INVALID naming the cure). Requires the unrestricted capability.
Before you call
A bearer session from an API key (see Authentication and key hygiene) or a signed-in user.
Capability area: Inventory operations — Receiving, counting, transferring and moving stock.
Roles that may call it:
- Owner
- Manager
- Associate Manager
- Warehouse Associate
- An API key whose scope allows
api:repairInventoryOnOrder
What happens
Rewrites that one figure and records the reason; nothing moves in stock and no ledger entry posts. An item that already agrees is left alone and says so.
Careful
Repairing while an order is still walking writes a figure the walk’s next chunk moves again — let the walk finish first.
Arguments
Returns
InventoryOnOrderRepair InventoryOnOrderRepair! — The answer of ONE on-order repair: the junction as it now stands, the figure it held before, the derived figure it was stamped to, and whether anything changed (a converged cell answers false — nothing written).
Example request
mutation ExampleRepairInventoryOnOrder($id: ID!, $reason: String!) {
repairInventoryOnOrder(id: $id, reason: $reason) {
previous
derived
changed
}
}Variables:
{
"id": "01900000-0000-7000-8000-37386ae00000",
"reason": "Correcting a miscount."
}Send it with the envelope naming the version: "extensions": {"at": {"version": {"name":"genesis","number":0}}}.
Example response
{
"data": {
"repairInventoryOnOrder": {
"previous": "<previous>",
"derived": "<derived>",
"changed": true
}
},
"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. Retry: no. (VALIDATION)AUTHN/REQUIRED— Sign in to do this. Retry: no. (AUTHN)AUTHZ/FORBIDDEN— Your role does not allow this action. Retry: no. (AUTHZ)RATE_LIMIT/THROTTLED— Too many requests in a short time. Retry: yes. (RATE_LIMIT)NOT_FOUND/*— That record could not be found. Retry: no. (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. Retry: no. (VALIDATION)