My Products
Help
Anonymous
Not applicable

Inventory not returning salesCategories

by Anonymous

I created a few SalesCategories in the GUI and connected a couple of Inventory items to them in screen IN204060. I connected the items to sub categories if that matters.

 

Then I check the article attributes on screen IN202500 to verify that the Inventory item is connected to the expected SalesCategory.

 

But when requesting the Inventory via API, using expandSalesCategories = true, every Inventory item returned has an empty array for "salesCategories".

 

Besides this, I concur with https://community.visma.com/t5/Ideas-in-Developers-Visma-net/Get-inventory-salesCategories-show-desc... that the value of salesCategories definitely should be SalesCategory.id and not SalesCategory.description - if you feel like this would break compability I guess you have to introduce another value on Inventory: salesCategoryIds

2 REPLIES 2

by Magnus Johnsen

Hi,

 

We are not able to reproduce this:

2020-10-12 07_21_17-Postman.png

 

Could you please doublecheck on your end? Please send us a screenshot of the inventoryItem in the UI's salesCategories and the API response for that item.

 

Regarding the last part, as mentioned in the other thread, there is a case in the backlog for the development to have a look at this.

 

Thank you. 

Accepted solution
Anonymous
Not applicable

by Anonymous

I looked closer and realized that I was building the request URL using PHP's 

http_build_query which converts boolean values to 0 or 1. So I was making the request with "expandSalesCategories=1" instead of "expandSalesCategories=true". My bad!