I'm trying to retrieve items in stock via the API, specifically higher value items.
I am able to retrieve items in a storage device through the API fine, however I do not appear to be able to use the orderby parameter to sort by InventoryValue (or Name/ID) using ?orderby=InventoryValue
I suppose I could pull down a list of all items in stock and sort it programatically, however the maximum page size is 250 - is there a way to retrieve the total number of items in a storage device so I could calculate how many pages i would need to pull?
Retrieve Items in Stock
Forum rules
- Check the documentation first. Before posting questions, please check the documentation to ensure it doesn't already cover what you need.
- No spam. All automated messages, advertisements, and links to competitor websites will be deleted immediately.
- Post in relevant sub-forums only. Messages posted in the wrong topic area will be removed and placed in the correct sub-forum by moderators.
- Respect other users. No flaming or abusing fellow forum members. Users who continue to post inflammatory, abusive comments will be deleted from the forum after two warnings are issued by moderators.
- Harassment. No threats or harassment of other users will be tolerated. Any instance of threatening or harassing behavior is grounds for deletion from the forums.
- Adult content. No profanity or pornography is allowed. Posts containing adult material will be deleted.
- Bandwidth. All images and signatures must be 500 x 500 pixels or smaller. Posts containing over-sized images and signatures will be removed.
- Illegal content. No re-posting of copyrighted materials or other illegal content is allowed. Any posts containing illegal content or copyrighted materials will be deleted.
Re: Retrieve Items in Stock
Hi rohan,
The stock items is not supporting the orderby parameter. If you wish to retrieve the higher value items you can filter based on a minimum amount. For example 300 as seen below and it will return all items with Inventory value 300 and higher.
If you wish to see the number of results of your list and also the number of pages you need to retrieve this is all available in the result header. Here you can find 'result-total' and 'result-pages'.
I hope this helps.
Regards
The stock items is not supporting the orderby parameter. If you wish to retrieve the higher value items you can filter based on a minimum amount. For example 300 as seen below and it will return all items with Inventory value 300 and higher.
Code: Select all
/api/v1.0/companies/{companyID}/storageDevices/{storageDeviceID}/stock/?InventoryValue=ge(300)I hope this helps.
Regards
Sindre
API Developer | Simpro Software Group
API Developer | Simpro Software Group
Re: Retrieve Items in Stock
Thanks for the reply. Your suggestions have helped me greatly.
The documentation indicates that you can orderby.
https://developer.simprogroup.com/apido ... tock-Items
The documentation indicates that you can orderby.
https://developer.simprogroup.com/apido ... tock-Items
Re: Retrieve Items in Stock
Hi,
I'm glad you could improve your query.
I see that the documentation includes orderby. We will look into the possibility of adding the sorting or if we need to update the documentation.
Thank you for raising this.
regards
I'm glad you could improve your query.
I see that the documentation includes orderby. We will look into the possibility of adding the sorting or if we need to update the documentation.
Thank you for raising this.
regards
Sindre
API Developer | Simpro Software Group
API Developer | Simpro Software Group
DEVELOPER CENTER