Quickbooky

Accounting News

Inventory & Items

Retrieving Inventory Quantity by Site in QuickBooks via the SDK

QuickBooks developers struggling to pull site-specific inventory counts can use a dedicated query request designed for Advanced Inventory location tracking.

COMMUNITY ISSUESQUICKBOOKY

When working with QuickBooks Desktop’s Advanced Inventory module through the SDK, pulling a total quantity on hand for an item is straightforward. Retrieving the quantity available at a specific site, however, is less obvious — and the workaround most developers stumble onto first does not scale.

The Problem

A developer building against the QuickBooks SDK needs to answer a basic question: how many units of a given item are currently held at a specific inventory site? The standard item query returns the aggregate quantity across every site, which is useful for a bird’s-eye view but unhelpful when you need location-level detail.

The natural fallback is to query historical inventory adjustment records for the item, walk through every transaction entry, and calculate the current balance manually. That approach works in principle, but it degrades quickly. As purchase orders, sales orders, transfers, and adjustments accumulate over time, reconstructing the balance transaction-by-transaction becomes prohibitively slow.

What Doesn’t Work Well

The standard ItemInventoryQuery gives you the total quantity on hand for an item across all sites — not broken down by location. Developers who need site-level data sometimes turn to transaction-level queries, essentially replaying inventory history to derive a current snapshot. This is computationally expensive and unnecessary.

The Accepted Solution

The fix is a dedicated request type that many developers overlook: ItemSitesQueryRq. This request is purpose-built for Advanced Inventory site tracking and returns exactly the data needed — quantities tied to specific sites — without requiring you to reconstruct history from transactions.

You can filter the query by a particular site name to get quantities for one location, or leave the filter open to receive quantities across every site in one pass.

What the Response Contains

The data returned by the site query is rich and directly usable. For each item-site combination, the response includes references to both the inventory item and the site, along with operational quantities that go well beyond a simple on-hand count.

Specifically, the response provides the item’s list identifier and name, the site’s list identifier and name, reorder level, and the current quantity on hand at that site. It also breaks out quantities tied to supply and demand: units on purchase orders, units on order more broadly, units committed to sales orders, units required by pending builds, units expected from pending build transactions, and units on pending transfers between sites.

That level of detail means developers can calculate not just what is sitting on a shelf, but what is inbound, what is reserved, and what is in motion — all scoped to the exact site in question.

Practical Takeaway

For anyone building integrations or reporting tools on top of QuickBooks Desktop with Advanced Inventory enabled, the site-level query is the right tool for location-specific stock counts. It eliminates the need for slow transaction reconstruction and returns a comprehensive snapshot of inventory status per site in a single round trip.

If your company file has grown large enough that even well-structured queries are performing poorly — whether for inventory lookups or general ledger rebuilds — condensing the file can reduce the payload and improve responsiveness across the board.

← Back to Community Issues