distributor_fulfillment_options
Evaluate a web order line-by-line to choose the cheapest distributor candidate, compare local stock, and get a fulfillment verdict with hold reasons for undetermined or restricted lines.
Instructions
Everything needed to decide how to fill ONE web order: per line, the distributor candidates (cheapest first), a LOCAL stock comparison row, and a verdict. Read-only — it plans nothing and orders nothing.
THREE-VALUED FIELDS. if not x is WRONG on both of these; null means "not
determined yet", never "fine":
verdict.fulfillable— true / false / null. Null carries areason:unknown_destination(the destination state is not captured yet — the NORMAL state while an order sits in Pending Route or before the buyer's FFL is on file) orstale_feed(the only quantity that could cover the line came off a feed past its refresh window).restricted_state— true / false / null, same null meaning.
Treat null as HOLD: report the line as undetermined and quote the reason.
Never state that such a line can ship — a restricted item to an unresolved
destination is exactly the case this must not wave through.
CANDIDATE FLAGS: not_carried = that distributor has no catalog row for the
item (listed rather than dropped, so it is not misread as out-of-stock);
blocked = carried but unbuyable (distributor block / vendor approval);
stale = quantity from an aged feed. Unbuyable rows sort to the BOTTOM, so
the first candidate is the one MOST LIKELY to be actionable — but the row's
own verdict and flags decide that, not its position. Ranking is not permission.
MONEY: unit_landed is PER UNIT and goods-only. Freight does not exist until
the order is placed, so shipping is null with shipping_known false. Do not
present unit_landed as a landed cost, and do not multiply it by quantity and
call the result final.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| woo_online_order | Yes |