sizeRunFill
query · in the family Reading your records
What it does
Spread a total over a size run’s ratio — whole units, the remainder to the largest shares, ties to the earlier size.
The fill: spread a total over a SizeRun's ratio — whole units by the largest-remainder law (each entry floor(total × share ÷ Σ shares), the remainder one unit at a time to the largest fractional parts, ties to the earlier entry; Σ = total exactly; a 0-share entry never receives a unit), answered in the run's stored order. The run tenant-scoped (a foreign/missing run refuses NOT_FOUND); total an integer 0..1000000000 (else VALIDATION). A pure read — nothing changes. 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:
- Owner
- System Administrator
- Manager
- Associate Manager
- Warehouse Associate
- Sales Associate
- An API key whose scope allows
api:sizeRunFill
What happens
A read — a calculation, nothing is written. The quantities always add up to the total exactly.
Arguments
Returns
SizeRunFillCell [SizeRunFillCell!]! — One filled entry of a size run: the OptionValue, its share, and the whole units it receives.
Example request
query ExampleSizeRunFill($sizeRunId: ID!, $total: Int!) {
sizeRunFill(sizeRunId: $sizeRunId, total: $total) {
optionValueId
share
quantity
}
}Variables:
{
"sizeRunId": "01900000-0000-7000-8000-53fab2990000",
"total": 1
}Example response
{
"data": {
"sizeRunFill": [
{
"optionValueId": "01900000-0000-7000-8000-011d2fcd0000",
"share": 1,
"quantity": 1
}
]
},
"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. Retry: no. (VALIDATION)AUTHN/REQUIRED— Sign in to do this. Retry: no. (AUTHN)AUTHZ/FORBIDDEN— Your role does not allow this action. Retry: no. (AUTHZ)RATE_LIMIT/THROTTLED— Too many requests in a short time. Retry: yes. (RATE_LIMIT)NOT_FOUND/*— That record could not be found. Retry: no. (NOT_FOUND)