On this page
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 engine 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. Requires authentication.
What happens
Reads only — nothing is ordered until you create the purchase orders.
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:replenishmentSuggestions
Arguments
| Name | Type | Required | Notes |
|---|---|---|---|
logicalFacilityId | ID | no | No further notes. |
organizationId | ID | no | No further notes. |
orgVendorId | ID | no | No further notes. |
categoryId | ID | no | No further notes. |
styleId | ID | no | No further notes. |
variantIds | ID [ID!] | no | No further notes. |
Returns
ReplenishmentSuggestionsResult ReplenishmentSuggestionsResult! — The replenishmentSuggestions result.
Example request
query ExampleReplenishmentSuggestions($logicalFacilityId: ID) {
replenishmentSuggestions(logicalFacilityId: $logicalFacilityId) {
purchaseOrders {
orgVendorId
organizationId
currency
estimatedTotal
orderMinimum
orderMinimumShortfall
annotations
}
}
}
Variables:
{
"logicalFacilityId": "01900000-0000-7000-8000-8026f71c0000"
}
Example response
{
"data": {
"replenishmentSuggestions": {
"purchaseOrders": [
{
"orgVendorId": "01900000-0000-7000-8000-f885fa720000",
"organizationId": "01900000-0000-7000-8000-44b781470000",
"currency": "USD",
"estimatedTotal": "10.00",
"orderMinimum": "<order minimum>",
"orderMinimumShortfall": "<order minimum shortfall>",
"annotations": [
"<annotations>"
]
}
]
}
},
"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)NOT_FOUND/*— That record could not be found. (NOT_FOUND)