Resolve freshness chip thresholds for a scanned GTIN
Return the color-coded freshness-chip thresholds for a scanned GTIN, resolved from the GPC-brick → category-threshold config (C-2861) and any per-brand organization overrides.
Called by the public /scan/ overlay after a Digital Link / DataMatrix decode: the chip first renders with the client-side default thresholds, then re-tints with the values returned here.
Anonymous-allowed — no API key required. Always returns 200 with a usable threshold set: an unknown or malformed GTIN falls back to the global-default thresholds so the chip never breaks.
Query Parameters
The scanned GTIN (8/12/13/14 digits, hyphens/spaces tolerated).
1 - 20Response
OK
Resolved freshness-chip thresholds for a scanned GTIN (C-2987).
Returned by GET /freshness-thresholds and threaded into the
scanner overlay's summarizeDateAis so the color-coded chip tints
against the right category window (fresh produce expires far sooner
than canned goods). Mirrors
:class:apps.products.services.freshness.Thresholds; the day fields
use the camelCase shape the client-side
DEFAULT_FRESHNESS_THRESHOLDS already expects.
Days-remaining at or above which the chip is tinted 'fresh'. Below this (but at or above criticalDays) the chip is 'warning'.
x >= 0Days-remaining below which the chip is tinted 'expired'. Always less than or equal to warningDays.
x >= 0Human-readable category label for the matched GPC brick (e.g. 'Fresh / refrigerated'). Surfaced as the chip's secondary text. Empty-string is never returned — the fallback layers always carry a label.
Which precedence layer produced these values: org-override | org-fallback | global-default | global-fallback | built-in. Useful for transparency and debugging which rule applied.