Forum Discussion

ardrau's avatar
ardrau
Copper Contributor
Jul 30, 2024

Is Warehouse management APIs are available in business central?

Hi Team,

 

I have use case like to enter goods item level and need to store it in business central.Like i need to do like to create purchase order from invoice document and do inventory put Away through API .Create PO API is there.Please guide me to get inventory put-away API?

 

 

Thanks,

Ardra

5 Replies

  • For Inventory Put-away, I would not treat it the same as the Warehouse Receipt process because the document flow depends on the warehouse setup of the Business Central location.

     

    If the location is configured with Require Put-away but not Require Receive, Business Central uses the Inventory Put-away flow. If Require Receive is enabled, the inbound process moves through Warehouse Receipt instead.

     

    For an external integration, creating a custom API page over the Inventory Put-away tables can expose the document data, but exposing the page itself does not automatically expose the standard posting action as an API endpoint.

     

    For posting/registering the Inventory Put-away, I would normally implement a controlled custom API/action that calls the appropriate standard Business Central posting logic/codeunit rather than trying to reproduce the posting logic externally.

     

    This is important because posting a warehouse activity updates several related warehouse and inventory records, so directly inserting/modifying the underlying tables through an API is not recommended.

     

    So the approach I would suggest is:

    • Create the Purchase Order through the standard API.
    • Create/get the Inventory Put-away using standard Business Central logic based on the source Purchase Order.
    • Expose the required Inventory Put-away information through a custom API if needed.
    • For the Register/Post operation, expose a controlled custom endpoint that invokes the standard Business Central posting routine.

    If you can share whether the location has Require Put-away, Require Receive and Bin Mandatory enabled, I can suggest the appropriate inbound flow and AL approach in more detail.

  • TobyJH's avatar
    TobyJH
    Copper Contributor

    But, after creating the api page, you cannot call the action, receiveAndInvoice from the inventory put-away.  I believe this is what the fellow is talking about.

    i tried copying and creating a new api page, but still cannot post the inventory put-away.

    Any ideas?  Can you please be more specific?

     

  • How about this?

     

    1. Create a Purchase Order: Use the Create Purchase Order API to create a new purchase order from your invoice document.
    2. Post the Purchase Order: Once the purchase order is created, you need to post it. This can be done using the "Post Purchase Order" API.
    3. Create Warehouse Receipt: After posting the purchase order, you can create a warehouse receipt. This can be done using the "Warehouse Receipt" API.
    4. Register the Warehouse Receipt: Finally, register the warehouse receipt to update the inventory. This can be done using the "Register Warehouse Receipt" API.
  • dfkconsult's avatar
    dfkconsult
    Brass Contributor

    Create an APIpage or publish existing pages as webservice (soap or odata).

    • TobyJH's avatar
      TobyJH
      Copper Contributor

      Did you do this for Inventory put-away?  I believe the fellow is referring to calling post, or receive and invoice.  The existing page cannot be published as an api v2.0 page, and copying the api to expose the service also did not work here.  Any ideas how to call the Post action using an api post?

      Can you please be more specific?