Skip to main content

Inventory Daily Divergence Series

GET 

/api/ledger/reconciliation/inventory/daily

The materialized daily reconciliation series, one entry per earmarked account (or per nominal_code_ids[] when given): SKU's point-in-time inventory value vs the provider GL balance for each end-of-day, and the stored divergence — the "which days diverge" view. Reads materialized rows only (no live provider or valuation call); the SKU side is built by the rebuild job and the provider side by capture-provider.

Not yet available to API tokens

This endpoint currently requires session authentication; Personal Access Token scope support is in progress.

Each day's SKU value uses the same valuation cutoff as the inventory valuation report, so a day ties to running that report for that end-of-day.

Authentication: Requires Bearer token.

Series fields: nominal_code_id, code, name, provider_account_name, days_total, days_divergent, days_matched, days_provider_missing, months_total, months_divergent, latest_sku_value, latest_provider_balance, latest_divergence, latest_as_of_date, points[], has_valuation_source.

Point fields: as_of_date, sku_value, sku_quantity, provider_balance (null on days not yet captured), divergence (null when either side missing), status (divergent | matched | provider_missing | sku_missing), displaced_value, sku_value_inventory.

Month verdicts. months_total / months_divergent judge each calendar month at its LAST comparable point — the month-end close. Under monthly batching every intra-month day diverges by design (the batch journal is dated at period end), so days_divergent overstates trouble on a book that closes clean; a month only counts as divergent when its close diverges.

Each account also returns opening_reconciled (boolean): true when the account has a booked reconciliation adjustment, so its opening was reconciled by an adjusting journal rather than being naturally aligned.

Each account also returns has_valuation_source (boolean): false when NO SKU-side reader can claim the account — no warehouse maps to it and it is not the configured Inventory In Transit account — so its sku_value is a structural $0 rather than a measured zero. Such an account is never divergent (both sides read 0), which is exactly why it must NOT be rendered as "Matched": clients should show a distinct "No valuation source" state and suppress the SKU figure. Accounts backed by a warehouse (standard, Amazon FBA, or Amazon AWD) return true.

Accounting calendar (lock dates). sku_value is stated on the accounting calendar so it is directly comparable with a GL balance. When an accounting lock date pushes a posting past the day the stock actually moved, that value is held back on the SKU side for exactly as long as the GL holds it back — so a lock date can never manufacture a divergence. sku_value_inventory is the untouched inventory valuation for the same day (the figure the inventory valuation report shows) and displaced_value is the difference between them, so sku_value_inventory = sku_value + displaced_value. On books with no displacement displaced_value is 0 and the two values are identical.

Request

Responses

OK

Response Headers
    Content-Type