venkat
venkat

Reputation: 39

Acumatica REST API - StockItem - how to expand Price Item in request

I am using the Acumatica REST endpoint https://sandbox.kimballinc.com/AcumaticaERP/entity/Default/6.00.001 in my application

I am using the URL https://sandbox.kimballinc.com/AcumaticaERP/entity/Default/6.00.001/StockItem?$filter=InventoryID eq '123456'&$expand=WarehouseDetails to fetch info about a Product and to get complete warehouse details

My query is how to expand and get Price/CostInfo details in the response

Upvotes: 0

Views: 642

Answers (2)

Hugues Beauséjour
Hugues Beauséjour

Reputation: 8278

Expand should be used for the arrays declared inside the entity in the web service endpoint: enter image description here

Price/CostInfo is not an array so it can't be expanded. The default endpoint doesn't contain those fields so you'll need to extend the endpoint and add them: enter image description here

Select the StockItem entity and use POPULATE button to add the fields: enter image description here

Extended endpoint requires that you specify a different endpoint name: enter image description here

In this example I choose DefaultPlus so I need to connect to:

https://xyz/AcumaticaERP/entity/DefaultPlus/6.00.001/StockItem

Instead of:

https://xyz/AcumaticaERP/entity/Default/6.00.001/StockItem

The added fields will be part of the GET response for StockItem, no special parameter is required for that.

Upvotes: 1

samol518
samol518

Reputation: 1404

I took a look at your site and noticed that you are using Acumatica 2018 R2.

I would then recommend that you use the latest version of the endpoint 18.200.001 as there are more field there by default.

If I saw correctly some of the fields for the Price/Cost Info are already in the main entity as they have a relation 1:1 to it.

To resume it using the latest version of the endpoint would allow you to see these field without the need to expand anything.

Upvotes: 1

Related Questions