binRefills query
binRefills is a GraphQL query of the Chameleoon MAX API. Send it as POST https://max-api.chameleoon.sk/api/v1/graphql with your API key, see Chameleoon MAX.
Returns a page of the picking bins' levels in the named warehouses, by variant, bin code, then
bin id. A level is a product variant's minimum and maximum on a picking bin (pickable, kind
STOCK or RECEIVING). Each comes with what to move to the bin from the warehouse's reserve
bins, and from which rows of stockQuants. Use it to plan refills of the pick face,
then write a transfer advice. Nothing is moved.
- Requires the
stockCard.readandposition.readpermissions. - A source's
lotalso requires thelot.readpermission. - A warehouse outside your API key's warehouse, legal-entity or country scope is left out, as
in
stockCards. - The connection has no total count.
How the refill is worked out
need: whenonLocation+comingis under the minimum, the maximum (or else the minimum) minusonLocationandcoming. The variant's level bin that holds least (onLocation+coming, then bin code, then bin id) also needs the variant'swaitingin the warehouse (StockFigures), less itsincomingthere asstockDemandcounts it. A bin's need is the larger of the two.- Free reserve: for each row on a reserve bin (not pickable, kind
STOCKorRECEIVING, in use, its lot released and not expired where the warehouse blocks expired stock), its quantity less what is reserved on that bin and lot. refill: a variant's bins in one warehouse are served in that same order, each taking the lesser of its need and the free reserve the earlier bins left. It is exactly the sum ofsources.sources: the refill split over the free reserve, first expiry first (an expired lot last where the warehouse only warns), then the larger free quantity first, then bin code, bin id and lot. At most 20 per bin: a 21st row is not used, and the refill stops there.
The split is worked out over all of a variant's bins in a warehouse before any status filter or page is applied, so every page, and any set of pages, shows the split one read of everything shows.
A status filter that few bins match
One page looks at no more than 500 variants. When it stops there, the page may be short, or
even empty, and still has hasNextPage (hasPreviousPage with last) true, with its
endCursor (startCursor) at the last variant it looked at. Keep paging until it is false.
Excepting your own advices
filter.exceptAdviceIds names OPEN transfer advices that nobody has started, at most 20. The
answer reads as if they were not there: their remaining quantity is not coming, and what they
hold on reserve bins is free again, so the same rows can be named as sources again. A workflow
that plans again uses it to see the stock without the transfer advice it wrote last time.
- It requires the
transferAdvice.readpermission when it is not empty. Without it, the query returnsFORBIDDEN_ROLEwithextensions.fieldexceptAdviceIds. - Any OPEN transfer advice your API key may read can be named, whoever wrote it.
- An advice somebody has started (a transfer links it) returns
VALIDATIONatexceptAdviceIdswithextensions.reasonADVICE_STARTED. - Any other id (an advice of another status, outside your scope, or unknown) changes nothing.
Pass exactly one of first or last, from 1 to 250. first (with after) pages forward;
last (with before) pages backward. last alone returns the last page. Every edge carries
its own cursor.
A page costs 2 + first (or last) × the cost of one node.
Arguments
filter:BinRefillFilter!· requiredfirst:Intafter:Stringlast:Intbefore:String
Returns
BinRefillConnection!: a page of BinRefill.
Example
Query
Code
Variables
Code
Response
Code
Values are illustrative: replace IDs and codes with your own before you send the call.