AlmondTill/G3N API

On this page

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. Requires authentication.

What happens

Reads only — acting on one creates real transfers.

Who may call it

Capability area: Reading your records — Looking up and listing the records of your organization.

Arguments

NameTypeRequiredNotes
destinationLogicalFacilityIdID ID!yesNo further notes.
variantIdsID [ID!]noNo further notes.

Returns

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

Example request

query ExampleRebalanceSuggestions($destinationLogicalFacilityId: ID!, $variantIds: [ID!]) {
  rebalanceSuggestions(destinationLogicalFacilityId: $destinationLogicalFacilityId, variantIds: $variantIds) {
    transferRequests {
      requestingLogicalFacilityId
      targetLogicalFacilityId
      annotations
    }
  }
}

Variables:

{
  "destinationLogicalFacilityId": "01900000-0000-7000-8000-3885245e0000",
  "variantIds": [
    "01900000-0000-7000-8000-367b16580000"
  ]
}

Example response

{
  "data": {
    "rebalanceSuggestions": {
      "transferRequests": [
        {
          "requestingLogicalFacilityId": "01900000-0000-7000-8000-9b4a35b10000",
          "targetLogicalFacilityId": "01900000-0000-7000-8000-2938ce830000",
          "annotations": [
            "<annotations>"
          ]
        }
      ]
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": null,
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}

Errors this call can answer