web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Answered

Standard API/OData for Item Variant Inventory Levels?

(5) ShareShare
ReportReport
Posted on by 12

Hello Dynamics Community,

I've been struggling for a few days trying to find a reliable way to fetch inventory stock levels by item variant, and I'm hoping someone here has a solution.

My Goal:
I need to get the current inventory stock (e.g., quantity on hand, or projected available balance) for each specific variant of an item (e.g., Item "TSHIRT", Variant "RED", Variant "BLUE").

What I Have Tested So Far:

  1. API v2.0 /items?$expand=itemVariants and /item and /itemVariants

    • This successfully returns the parent item and a list of its variants. However, the itemVariants entity only contains descriptive data (code, description) and does not contain any inventory fields.

  2. API v2.0 /itemLedgerEntries

    • My plan was to calculate the stock myself by summing the quantity from this endpoint.

    • The Problem: The itemLedgerEntries response only includes the parent itemNumber. It's missing the variantId or variantCode field, which makes it impossible to link a ledger entry to its specific variant.

  3. ODataV4 Endpoints

    • I have inspected several standard OData pages (like ItemLedgerEntries, PostedSalesShipments, etc.), but they all seem to have the same limitation. 

My Constraint (Important):
I am building an integration that needs to be scalable for multiple clients. Therefore, I cannot deploy custom AL code (like a custom API page or query) to the client's environment. The solution must use the standard, out-of-the-box API or OData endpoints.

My Question:
Is there a standard API or OData endpoint that I'm missing? How can I get the inventory stock for each specific item variant without writing custom code?

Thank you in advance for your help!

I have the same question (0)
  • Suggested answer
    Khushbu Rajvi. Profile Picture
    20,149 Super User 2025 Season 2 on at
  • Verified answer
    OussamaSabbouh Profile Picture
    2,952 on at
    Standard API/OData for Item Variant Inventory Levels?
    Hello,
     
    Currently, the standard Business Central APIs don’t expose variant-level inventory quantities. The itemVariants entity only includes descriptive data, and itemLedgerEntries doesn’t return a variantCode. So without custom AL code (custom API/page/query), there’s no way to get stock per variant through the public APIs.
    The only workarounds are:
    Use web services (OData) exposing the standard “Item Availability by Variant” page (if published manually per tenant).
    Or compute it inside BC using a custom API or query (needed for variant quantities).
    In short: no out-of-the-box API provides variant-level stock data — it requires a custom extension.
     
    Regards,
    Oussama Sabbouh
  • Suggested answer
    YUN ZHU Profile Picture
    94,508 Super User 2025 Season 2 on at
    Standard API/OData for Item Variant Inventory Levels?
    Hi, hope the following can give you some hints.
    Dynamics 365 Business Central: How to quickly check inventory quantity for locations at Item-Variant level (Variant inventory per location)
     
    Thanks.
    ZHU
     
  • Gerardo Rentería García Profile Picture
    24,227 Most Valuable Professional on at
    Standard API/OData for Item Variant Inventory Levels?
  • Suggested answer
    Rishabh Kanaskar Profile Picture
    5,760 on at
    Standard API/OData for Item Variant Inventory Levels?
    Hi,
     
    There is no standard API or OData endpoint that returns inventory by item variant out-of-the-box. The items API only provides variant details without inventory fields, and itemLedgerEntries does not include variant information. Business Central does not expose variant-level inventory in standard APIs.
     
    Thanks
    Rishabh

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,907

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 2,169 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,977 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans