replenishmentSuggestions
query · in the family Reading your records
What it does
What to reorder — suggested purchase quantities from your sales pace and stock levels.
The buy suggester: scope required bounded (exactly one of logicalFacilityId ⊕ organizationId; optional orgVendorId/categoryId/styleId/variantIds narrows). Per active stocked junction in scope: position = available + in_transit + on-order (the expectedReceipts walk; held/damaged excluded) vs the resolved min/safety/days-of-supply levels; deficits round UP through the effective MOQ + reorder multiple (pack/forced — the machinery) and group by OrgVendor into draft-po-shaped payloads (realization-ready verbatim for createPurchaseOrder, which re-gates authoritatively — the platform never outruns the gates). orderMinimum shortfalls are annotated, never padded. Urgent deficits (velocity-dependent) couple into transfer-now + backfill-PO pairs. Books with no live OVI land in gaps as no-ovi. Derived at read, never stored. The continued walk: the desk walks the scope's facilities position by position under the time one request allows. A cut walk answers partial with a nextToken. A call that runs out of time before its first position refuses VALIDATION/INVALID naming the stage. The page budget: a page's findings stop at half the tool-result cap, so a page always fits an assistant whole. limit (1 to 500) caps a page's findings by count. Outside that range it refuses VALIDATION/INVALID naming the bound. Requires authentication.
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:
- Owner
- System Administrator
- Manager
- Associate Manager
- Warehouse Associate
- Sales Associate
- An API key whose scope allows
api:replenishmentSuggestions
What happens
Reads only — nothing is ordered until you create the purchase orders.
Arguments
| Name | Type | Required | Notes |
|---|---|---|---|
logicalFacilityId | ID | no | |
organizationId | ID | no | |
orgVendorId | ID | no | |
categoryId | ID | no | |
styleId | ID | no | |
variantIds | ID [ID!] | no | |
nextToken | String | no | The cursor from the previous page, passed back exactly as received. |
limit | Int | no | How many records to answer at most; a page may hold fewer. |
Returns
ReplenishmentSuggestionsResult ReplenishmentSuggestionsResult! — The replenishmentSuggestions result.: a walk cut by the time one request allows answers partial with a nextToken. The purchase orders and gaps cover the examined positions; pass the token back to continue.
Example request
query ExampleReplenishmentSuggestions($logicalFacilityId: ID) {
replenishmentSuggestions(logicalFacilityId: $logicalFacilityId) {
examined
inScope
partial
nextToken
}
}Variables:
{
"logicalFacilityId": "01900000-0000-7000-8000-10c08c590000"
}Example response
{
"data": {
"replenishmentSuggestions": {
"examined": 1,
"inScope": 1,
"partial": true,
"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. 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)