AlmondTill/G3N API

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:

What happens

Reads only — nothing is ordered until you create the purchase orders.

Arguments

NameTypeRequiredNotes
logicalFacilityIdIDno
organizationIdIDno
orgVendorIdIDno
categoryIdIDno
styleIdIDno
variantIdsID [ID!]no
nextTokenStringnoThe cursor from the previous page, passed back exactly as received.
limitIntnoHow 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

graphql
query ExampleReplenishmentSuggestions($logicalFacilityId: ID) {
  replenishmentSuggestions(logicalFacilityId: $logicalFacilityId) {
    examined
    inScope
    partial
    nextToken
  }
}

Variables:

json
{
  "logicalFacilityId": "01900000-0000-7000-8000-10c08c590000"
}

Example response

json
{
  "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

Used in