
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.