Choose which inventory lots to pick (FIFO, FEFO, LIFO, fewest lots)
Allocates a demand quantity across up to 200 inventory lots under a stated policy (FIFO by received date, FEFO by expiry, LIFO, or fewest lots), excluding held, expired, short-shelf-life and wrong-location lots, in whole case multiples if asked. For warehouse and order agents. Returns the pick plan, the shortfall and a reason for every excluded lot. A caller asOf date is required (the check never reads the clock). pass: demand fully covered; fail: the eligible stock cannot cover it (shortfall in the witness); unknown: a date the policy or shelf-life rule needs is missing or the dates are unusable. It does not reserve stock, handle partial-lot reservations or choose locations by travel distance.
What you get
Deterministic pick plan with exclusion reasons for one $0.005 call.
Call it
Send the JSON body below to https://agents.writerslogic.com/api/v1/lot-pick. An unpaid request answers 402 with the price and how to pay; a request that fails with a 5xx status is not charged.
curl -i -X POST https://agents.writerslogic.com/api/v1/lot-pick \
-H 'content-type: application/json' \
-d '{"asOf":"2026-11-04","demand":150,"policy":"FEFO","lots":[{"id":"L-100","qty":100,"expiry":"2026-12-01"},{"id":"L-200","qty":80,"expiry":"2026-11-20"},{"id":"L-300","qty":500,"expiry":"2026-11-01"},{"id":"L-400","qty":60,"expiry":"2027-03-01","hold":true}]}'
Input
| Field | Type | Required | Description |
|---|---|---|---|
asOf | string; length 0..10 | yes | Reference date, YYYY-MM-DD. An expiry date is the last usable day: a lot expiring on asOf has 0 days left. |
demand | integer; 0..1000000000 | yes | Units wanted (whole units). |
policy | string; one of "FIFO", "FEFO", "LIFO", "MIN_LOTS" | yes | FIFO: oldest received first. FEFO: earliest expiry first. LIFO: newest received first. MIN_LOTS: fewest lots (largest usable first; ties by earlier expiry, then id). |
lots | array<object>; max 200 items | yes | At most 200. |
minShelfLifeDays | integer; 0..36500 | no | Exclude lots with fewer than this many days left at asOf (needs expiry on every non-held lot). |
pickMultiple | integer; 1..1000000 | no | Each lot contributes whole multiples of this case size (default 1). |
allowOverpick | boolean | no | With pickMultiple, allow the last pick to round the total up to a whole case (default false: leave the remainder as shortfall). |
allowedLocations | array<string; length 0..64>; max 50 items | no | If set, lots elsewhere (or without a location) are excluded. |
Example request body
{
"asOf": "2026-11-04",
"demand": 150,
"policy": "FEFO",
"lots": [
{
"id": "L-100",
"qty": 100,
"expiry": "2026-12-01"
},
{
"id": "L-200",
"qty": 80,
"expiry": "2026-11-20"
},
{
"id": "L-300",
"qty": 500,
"expiry": "2026-11-01"
},
{
"id": "L-400",
"qty": 60,
"expiry": "2027-03-01",
"hold": true
}
]
}
Result
The response is { "data": ..., "_provenance": ... }. data carries these fields; _provenance is a signed W3C Verifiable Credential with a C2PA-style manifest, checked free at POST /api/v1/verify-provenance.
| Field | Type | Required | Description |
|---|---|---|---|
status | string; one of "pass", "fail", "unknown", "unsupported" | no | pass: every rule held. fail: a rule was violated (see witnesses). unknown: the input lacks the evidence to decide. unsupported: outside what this engine covers. Missing evidence is never a pass. |
picks | array<object> | no | |
picked | integer | no | |
shortfall | integer | no | Demand not covered. |
excluded | array<object> | no | |
policy | string | no | |
witnesses | array<object> | no | |
versions | object | no | Every semantic dependency of this answer (engine, tables and their as-of dates, tokenizer, calendar, rounding profile). |
limits | array<string> | no | |
deterministic | boolean | no | Always true: pure code, no model. |
Pay and connect
Available through: x402 (USDC on Base), MCP. MCP clients reach it through the physical-ops-kit package.
Machine-readable
- This agent as JSON (schemas, example, OpenAPI operation)
- Free signed sample response
- OpenAPI 3.1 · Catalog · Index of every agent