Querying Item Endpoint for Only Archived Records

gregaricangregarican Member Posts: 466 

Here's a practical example where I think I have run into another gotcha regarding API response. We are removing a good chunk of aged, stale inventory from stock. We own the items so it's not a vendor return. We are "scrapping" them. But need to report out as to which specific SKU's we scrapped.


Now that our inventory team has gone into Lightspeed Retail, zeroed out the quantity, and archived them we need to report out on them for financials and asset reconciliation. If we run a Lightspeed Retail report in the web client (e.g. - Inventory Log Report for anything Archived and Removed), these reports don't show any SKU whatsoever. No System SKU, Custom SKU, or Manufacturer SKU. Which is another issue entirely, in how these web client reports typically don't uniquely identify product other than a short description which isn't unique. Same with a RTV report in the web client. You'd think a vendor would need to know the Manufacturer SKU of what's being returned in some document. How impractical is that?


Anyway, when I query the Item API endpoint, I am looking for any items that have the keyword "scrapped" in the notes, that are in Archived status, and were last touched over the past two days. Here is my URI:


https://api.merchantos.com/API/Account/{AccountId}/Item.json?load_relations=["Note"]&archived=true&timeStamp=><,2019-11-04T00:00:01-5:00,2019-11-06T23:59:59-5:00&Note.note=~,%scrapped%


The API response is a result set that includes both items with archived: "false" and archived: "true." Any suggestions as to why this is the case?

4 comments

Sign In or Register to comment.