NOT IN query

megabuildlabmegabuildlab Member Posts: 3
edited November 2018 in Development
I would like to query for sales where the customerTypeID is NOT IN an array of ids. We already query for sales for certain customers this way: 

const requestPath = `${lightspeedAPIuri}/Account/${lightspeedAccountId}/Sale.json?completed=true&load_relations=["SaleLines", "SaleLines.Item", "Customer", "Customer.Contact", "SalePayments"]&SalePayments.amount=>,0&Customer.customerTypeID=IN,[${dswrCustomerTypeIds.join(',')}]&timeStamp=><,${startDate},${endDate}`

but I don't see a way in the docs to query for customerTypeID NOT IN the array.
mega build lab
We build custom software and mobile apps for businesses.

1 comment

  • Adrian SamuelAdrian Samuel Moderator, Lightspeed Staff Posts: 654 moderator
    Hey @megabuildlab, unfortunately you can't write these filters for relations with nested data. You'd have to filter them yourself after you receive the data into your app

    Adrian Samuel

    Software Developer

    Lightspeed HQ

Sign In or Register to comment.