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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

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

How do I get the bins from a purchase order line item from the Business Central APIs?

(5) ShareShare
ReportReport
Posted on by 64

I have a C# app that calls Business Central APIs. I can use https://api.businesscentral.dynamics.com/v2.0/{{tenantId}}/Sandbox/api/v2.0/companies({{company_id}})/purchaseOrders({{PO}})/purchaseOrderLines?$expand=location to get more data about the purchase order lines and the locations, but it doesn't give the bin code. I've looked everywhere and asked Copilot, but I can't seem to find more information on this.

 

To give further information, I made a purchase order for the sandbox company, Cronus, in a TEST warehouse, in a TESTZONE, in a TESTBIN that I
made. I finally managed to set the location code and bin code of an item, but this is not returned from the /purchaseOrderLines API call.
The $expand=location gives me more detail about the location, but still doesn't include the bin. It doesn't work for the default sandbox POs either.

At this point, I've tried companies({{co_id})/locations({loc_id})/bins?tenant={{tenantId}} and different variations of that to try to get anything relating to bin codes and I can't get anything returned. These were invalid requests.

 

Any steer in the right direction would be greatly appreciated.

I have the same question (1)
  • Suggested answer
    OussamaSabbouh Profile Picture
    12,965 Super User 2026 Season 1 on at
    Hello,
     
    The standard purchaseOrderLines API does not expose Bin Code.
    $expand=location also won’t give it, and there is no built-in /bins endpoint.
     
    If you need Bin Code in your C# app, you must expose it yourself with a custom API page (or OData page). That’s the only way.
     
    Regards,
    Oussama Sabbouh
  • TL-08121507-0 Profile Picture
    64 on at
    Oussama,
     
    Thanks for the response. That's what it was starting to look like. If I implemented a custom API, how would I be able to interact with any bin data within Business Central? For example, if a user wanted to update the bin to be received to, how would we update that from the API?
     
    Thanks again.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,993 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,116 Super User 2026 Season 1

#3
Khushbu Rajvi. Profile Picture

Khushbu Rajvi. 557 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans