Query for returning only products where inventory is available?

thisisbolothisisbolo Posts: 25Member
Is there a way to do this in the the call? Is there a query partaker for this like &qoh>0?
Super Cat Lightspeed
Tags:

2 comments

  • Alex LugoAlex Lugo Posts: 136Administrator, Lightspeed Staff moderator
    Hello @thisisbolo,

    Yes, this is possible loading first the relation "ItemShops" and then using the query parameter ">". See my code sample below.

    GET /API/Account/{{accountID}}/Item?load_relations=["ItemShops"]&ItemShops.qoh=>,0
    Alex Lugo
    API Support Specialist
    Lightspeed HQ
  • thisisbolothisisbolo Posts: 25Member
    That's great Alex. It worked! Thank you. For anyone that needs this URL encoded, this is what it would look like:

    https://api.lightspeedapp.com/API/Account/{{accountID}}/Item.json?load_relations=%5B%22ItemShops%22%5D&ItemShops.qoh=>,0

    It looks like you don't need the .qoh=>,0 encoded out. When I did this, it returned an error.
    Super Cat Lightspeed
Sign In or Register to comment.