AlmondTill/G3N API

rebalanceSuggestions

query · in the family Reading your records

What it does

Stock-balancing suggestions between your locations — pull stock to where it sells.

The pull suggester: deficits at the destination filled from donors with genuine excess (available − the donor's OWN resolved target − reserveFloor > 0 — exactly at target+reserve is NOT excess; transferableExcess honored) in the lane order (never dropped · always first · ranked · geodistance defaults); tr-shaped payloads, one per donor (pull semantics — the TR doc IS the demand doc). Derived at read. The continued walk: the desk walks the destination's positions page by page under the time one request allows. A cut walk answers partial with a nextToken; pass it back with the same arguments to continue. 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 — acting on one creates real transfers.

Arguments

NameTypeRequiredNotes
destinationLogicalFacilityIdID ID!yes
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

RebalanceSuggestionsResult RebalanceSuggestionsResult! — The rebalanceSuggestions result — one TR-shaped payload per donor.

Example request

graphql
query ExampleRebalanceSuggestions($destinationLogicalFacilityId: ID!, $variantIds: [ID!]) {
  rebalanceSuggestions(destinationLogicalFacilityId: $destinationLogicalFacilityId, variantIds: $variantIds) {
    examined
    inScope
    partial
    nextToken
  }
}

Variables:

json
{
  "destinationLogicalFacilityId": "01900000-0000-7000-8000-c9ff9bd30000",
  "variantIds": [
    "01900000-0000-7000-8000-8433b0260000"
  ]
}

Example response

json
{
  "data": {
    "rebalanceSuggestions": {
      "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