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

Notifications

Announcements

No record found.

Community site session details

Community site session details

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

How to update Business Central Inventory through API

(0) ShareShare
ReportReport
Posted on by 5

Hello, 

I am developing a Business Central Integration that requires creating Inventory adjustments. I understand creating Item Journal entries is the best way to do this, but is not possible through the APIs. There is a codeunit (1327) that can adjust Item Inventory, but I am struggling to find documentation on how to use it. I have added the codeunit row to Web Services, given it a name, and have an API endpoint to use. I am getting 415 Unsupported Media Type error in return when I supply any kind of body (json), but I can't find any documentation on what parameters are expected.

I have the same question (0)
  • Suggested answer
    Teddy Herryanto (That NAV Guy) Profile Picture
    14,284 Super User 2025 Season 2 on at

    Why is it not possible to create item journal through API ?

    You can create a new codeunit with function to create and post the journal, and call that function using API. We have done this a few times without no issue.

  • Suggested answer
    JAngle Profile Picture
    133 on at

    Depends on the procedure being used. Source code for the one I assume you might be trying is:

    procedure PostAdjustmentToItemLedger(Item: Record Item; NewInventory: Decimal) LastErrorText: Text

    I think the error is logical as a complete json representation of a rec value won’t be easy to replicate.

    Might be better creating your own codeunit based off this one. So instance if you swap the Item parameter to be a code[20]. Add logic to find the item record from your provided code value. After that the rest of the code is fine

  • kplatz Profile Picture
    5 on at

    Thanks for the responses!

    To clarify, I was only trying to create Item Journal Lines, not post them. I was referencing the MSFT's API documentation, which only discussed the standard APIs. I did not realize that you could expose an existing page from BC Web Services, and POST new lines through the generated API. 

    Exposing the Item Journals Page got me what I needed. 

    Thanks!

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,577

#2
YUN ZHU Profile Picture

YUN ZHU 888 Super User 2025 Season 2

#3
Jainam M. Kothari Profile Picture

Jainam M. Kothari 778 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans