Amazon FBA Stock Sync Health
Diagnostic dashboard that answers "is our Amazon FBA fulfillable-stock data fresh, and which FBA SKUs currently have units sitting in Amazon's warehouses?"
Purpose
- Stock/Amazon ops use it to confirm the scheduled AFN stock sync is actually running and not stale.
- Surfaces, per FBA Proxy SKU, the fulfillable (AFN) unit count Amazon last reported.
- Quick health check before pricing/strategy decisions that depend on FBA stock (the FBA strategy only fires when FBA stock > 0).
- Flags a red alert when the sync has silently fallen behind.
How to Access
Desk > Reports > Amazon FBA Stock Sync Health, or /app/query-report/Amazon%20FBA%20Stock%20Sync%20Health.
Report type: Script Report. Reference DocType: Proxy SKU.
Filters
| Filter | Type | Required | Description |
|---|---|---|---|
| Only In Stock | Check | No | When ticked, hides SKUs whose afn_stock is 0; only rows with fulfillable stock > 0 remain. |
Columns
| Column | Type | Description |
|---|---|---|
| Proxy SKU | Link (Proxy SKU) | The FBA Proxy SKU record (is_fba=1, is_active=1). |
| Item | Link (Item) | The ERPNext Item the Proxy SKU maps to. |
| UOM | Link (UOM) | Selling unit of the Proxy SKU. |
| ASIN | Data | Amazon ASIN of the listing. |
| AFN Stock (Fulfillable) | Float | Fulfillable units Amazon last reported (Proxy SKU.afn_stock), rounded to 4 dp. |
| In Stock | Check | 1 when afn_stock > 0, else 0. |
Report Summary (indicators)
The report also returns a summary strip (not table rows):
| Indicator | Meaning |
|---|---|
| Minutes Since Last FBA Stock Sync | Minutes between now and Navgold Settings.last_afn_stock_synced_at. Shown Red when sync is enabled and stale, else Green. - when never synced. |
| AFN Stock Sync | Enabled / Disabled, driven by Navgold Settings.enable_afn_stock_sync. Green when enabled, Gray when disabled. |
| FBA SKUs | Total active FBA Proxy SKUs scanned (Blue). |
| SKUs In Stock | Count with afn_stock > 0 (Green if any, else Gray). |
| Total Fulfillable Units | Sum of afn_stock across in-stock SKUs, 2 dp (Blue). |
How It Works
The report reads every active FBA Proxy SKU directly (is_fba=1, is_active=1), ordered by afn_stock desc, name asc. For each row it computes in_stock = afn_stock > 0, accumulates the in-stock count and total fulfillable units, then applies the optional only_in_stock filter. Freshness is judged from Navgold Settings: it reads last_afn_stock_synced_at and enable_afn_stock_sync, derives minutes since the last sync, and marks the data stale when there is no sync timestamp or more than 70 minutes have elapsed — chosen because the scheduled fetch runs every ~30 minutes, so 70 means it has missed roughly two windows.
flowchart LR PS["Proxy SKU<br/>is_fba=1, is_active=1"] --> R["per-SKU loop<br/>in_stock = afn_stock > 0"] R --> COLS["Columns:<br/>SKU, Item, UOM, ASIN,<br/>AFN Stock, In Stock"] NS["Navgold Settings<br/>last_afn_stock_synced_at<br/>enable_afn_stock_sync"] --> F["freshness check<br/>stale if > 70 min"] F --> SUM["Summary indicators<br/>(Red/Green/Blue/Gray)"] R --> SUM
Notes
- "Stale" is purely a clock check against the settings timestamp; it does not re-poll Amazon.
- AFN stock values originate from the scheduled AFN stock fetcher that writes back to each Proxy SKU; this report only displays the cached numbers.
- A Red "Minutes Since Last FBA Stock Sync" with sync Enabled is the key signal that the background fetch has stopped.
- Related: the FBA strategy in pricing depends on this same
afn_stockbeing > 0.