Skip to main content

Notifications

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.

  • kplatz Profile Picture
    5 on at
    RE: How to update Business Central Inventory through API

    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!

  • Suggested answer
    JAngle Profile Picture
    95 on at
    RE: How to update Business Central Inventory through API

    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

  • Suggested answer
    Teddy Herryanto (That NAV Guy) Profile Picture
    13,641 Moderator on at
    RE: How to update Business Central Inventory through API

    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.

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

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

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

#1
Sohail Ahmed Profile Picture

Sohail Ahmed 953

#2
YUN ZHU Profile Picture

YUN ZHU 921 Super User 2025 Season 1

#3
Mansi Soni Profile Picture

Mansi Soni 602

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans