Inventory Expiry & Shelf-Life
Get Expiry & Shelf-Life Report
Paginated Inventory Expiry & Shelf-Life report. Blends internal lot-tracked FIFO layers with Amazon FBA/AWD layers, bucketed by days-to-expiry. Defaults to the lot_detail view (one row per lot/FIFO layer, each carrying a real fifo_layer_id for disposition actions); pass view=product_summary for one row per product rolled up to the worst-case (soonest) expiry.
Get Expiry & Shelf-Life Report (POST, Advanced Filters)
POST variant of the expiry report. Mirrors every GET filter and additionally carries the larger product advanced-filter tree (filter_groups) in the request body.
Get Expiry Metrics
Summary metric cards for the expiry dashboard: total tracked value, expired value, value expiring within 30/60/90 days, at-risk and expired lot counts, the Amazon auto-disposal-risk value (FBA lots within Amazon's 50-day disposal window), and per-bucket value/quantity/percentage breakdowns.
Get Expiry Metrics (POST, Advanced Filters)
POST variant of the metric cards — same response as the GET, with the product advanced-filter tree in the body.
Get Expiry Distribution
Expiry bucket distribution for charts — one entry per bucket (in display order) with quantity, value, percentage-of-total-value, label and colour. Honours the same filters as the report.
Get Expiry Distribution (POST, Advanced Filters)
POST variant of the bucket distribution — same response as the GET, with the product advanced-filter tree in the body.
Export Expiry Report (async)
Starts an asynchronous CSV export of the expiry report (lot-detail or product-summary view).
Export Expiry Report (async, POST + filter_groups)
Starts an asynchronous CSV export of the expiry report (lot-detail or product-summary view).
Get Actionable Lot Count
Lightweight count of lot-tracked lots that are expired or within their near-expiry threshold and still need attention (no review record yet, or one left 'open'). Acknowledged, quarantined and written-off lots drop out. Powers the navigation badge.
Get Near-Expiry Alert Summary
Near-expiry alert summary for the report-header risk banner and the daily digest: expired and near-expiry lot counts/values (threshold-aware per product), the Amazon auto-disposal-risk value, the actionable (needs-review) lot count, and the highest-value at-risk products (worst-case first).
Write Off Lot
Write off a lot's remaining (or partial) quantity via an expired-stock DECREASE inventory adjustment (reason: expired). quantity is optional — when omitted the layer's full remaining available quantity is written off; when set, only that portion is consumed (partial write-off).
Quarantine Lot
Quarantine a lot — remove its quantity from available-to-promise via a reversible inventory hold (no stock movement). quantity is optional — when omitted the layer's full remaining available quantity is held. Returns the review record including the inventory_hold_id.
Release Quarantine
Release a lot from quarantine — return the held quantity to available-to-promise by lifting the inventory hold. No request body. The lot's review status returns to open.
Set Lot Review Status
Set a lot's non-stock review disposition (acknowledge a near-expiry lot, or re-open it). status is restricted to the bookkeeping states open and acknowledged — the stock-mutating dispositions (written_off / quarantined) are set only by their dedicated endpoints.
Preview Lot Write-Off Impact
Preview the demotion and label-void impact of writing off a lot before committing the write-off. Read-only — mutates nothing.
Download Lot Backfill Template (CSV)
Download the lot-data backfill CSV template (header row + one example row) so uploads start from the exact header layout the importer expects (filename: lot-data-backfill-template.csv, Content-Type: text/csv).
Import Lot Backfill CSV
Upload a lot-data backfill CSV (multipart/form-data). The file is parsed, then a tray-tracked job is dispatched that splits the named quantities off each product's existing un-lotted FIFO stock into dated lots (cost preserved). Returns the tracked_job_log_id so the frontend can follow progress via the tracked job log endpoints; per-row outcomes (assigned / partial / skipped / failed) are reported in the job summary.