JobMaterials filter by quantity not working as expected

My understanding is gt filter is not greater than or equal. Since the API explicitly calls out ge not being implemented. The following curl is surprising to me. Unless I am missing something.

curl --header "x-api-key: $API_KEY" 'https://api.servicem8.com/api_1.0/jobmaterial.json?%24filter=active+eq+1+and+job_uuid+eq+%2701a11425-e078-7bf6-9cb9-5f330e02348b%27+and+quantity+gt+0' | jq .
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   446    0   446    0     0    210      0 --:--:--  0:00:02 --:--:--   210
[
  {
    "uuid": "01a11425-fcbe-7bf6-9cb8-3ef925df48cb",
    "tax_rate_uuid": "600a36db-b00c-492c-a6a4-1e4abf0442cb",
    "quantity": "0.0000",
    "name": "Example item 001",
    "price": "20.0000",
    "active": 1,
    "displayed_amount_is_tax_inclusive": "0",
    "displayed_amount": "20.0000",
    "edit_date": "2026-10-07 13:16:36",
    "job_uuid": "01a11425-e078-7bf6-9cb9-5f330e02348b",
    "material_uuid": "01a0ccb3-fae6-7bf6-9cb8-31cfdeb78fbb",
    "sort_order": "0",
    "cost": "0.0000",
    "displayed_cost": "0.0000"
  }
]

In the above I use a filter where quantity gt 0 but this returns a job material that has a quantity of 0.

Hi Ed,
To exclude zero-quantity rows, replace quantity gt 0 with quantity ne 0 in your existing filter. ne means “not equal to”, so this also includes negative quantities.
We’ll confirm the inclusive behaviour of gt and lt, the four-decimal quantity precision, and the quantity gt 0.0001 workaround with the team.
Thanks,
Cody

1 Like