Skip to main content

Notifications

Announcements

No record found.

Business Central forum

POST new items to BC365 using REST API

Posted on by Microsoft Employee

Hi there community, 

I am trying to make a simple post request to the items api endpoint of my company in Business Central 365. I have used Postman to get started. When making the request, I get an error about not having the correct permissions.

permissions_5F00_2.png

However, I can't seem to figure out how to change my permissions so that I can add new stock? 

permissions_5F00_1.png

  • Verified answer
    Renato Fajdiga Profile Picture
    Renato Fajdiga 1,849 on at
    RE: POST new items to BC365 using REST API

    try to remove field "Inventory" : 100 from your procedure, then you should be able to import item master data. 

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: POST new items to BC365 using REST API

    I see what you are saying. Maybe I should not have used the term inventory/stock then. I am trying to add new items as master data - as in importing completely new items (for example: from another external system). Is this possible with the "items" endpoint? If so, why the permission error? And how can I change the permission?

  • Suggested answer
    Renato Fajdiga Profile Picture
    Renato Fajdiga 1,849 on at
    RE: POST new items to BC365 using REST API

    Yes, when we speak about the item as master data you can create an item and that is fine. But you want to insert in field Inventory which is lookup on remaining quantity from item ledger entry because field inventory indicates how much (quantity) of the item you have on stock.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: POST new items to BC365 using REST API

    Sorry, I am a bit confused.

    Why would you not be able to create an item with a POST call to the /items endpoint? Please see the documentation here: docs.microsoft.com/.../dynamics_create_item

  • Suggested answer
    Renato Fajdiga Profile Picture
    Renato Fajdiga 1,849 on at
    RE: POST new items to BC365 using REST API

    You are not able to insert into item ledger entry table by default. I would always suggest to insert into item journal line, and then trigger the posting of item journal line to create stock for that item (item ledger entries).

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: POST new items to BC365 using REST API

    And via the API?

  • Suggested answer
    Renato Fajdiga Profile Picture
    Renato Fajdiga 1,849 on at
    RE: POST new items to BC365 using REST API

    hi,

    to add stock for certain item you need to fill item journal line (table 83) and then post item journal.

    Br,

    Renato.

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans