question

Sean avatar image
Sean asked Sean commented

[issue] Querying items using filter for SKU

The query was generated by https://www.clover.com/api_docs. Also tried the same thing with my web apps. Both of them returned empty result for the elements.

Is this an issue from the API side? or it's an error from my query? Any feedback would be appreciated.

I would like to know if there's a better way to query for items by using SKU as filter. Thank you.

URL

https://api.clover.com:443/v3/merchants/XXXX/items?filter=itemCode==PRT0001

Response body

{ "elements": [], "href": "http://api.clover.com/v3/merchants/RWT1ATGEWTT0C/items?filter=itemCode%3D%3DPRT0001&limit=100" }

Response code

200

1 comment
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Sean avatar image Sean commented ·

After some more testing, it's getting weirder. I tried using == in the filter query the first time, and the result returns nothing on elements.

But when I tried using >= , it would return 2 items. One of them is the correct item, while the other is just some other stuff with SKU.

Tried querying with the same >= , but this time, I searched using the SKU from the other item from before, result would give me that item only.

Tried querying each of them separately with <= , same thing happened in reverse order.

Would it be possible to have a more dependable result ?

0 Likes 0 ·

1 Answer

jim-patel avatar image
jim-patel answered Sean commented

The correct format is to use a single equal sign instead of a double equal sign, as below.

https://api.clover.com:443/v3/merchants/XXXX/items?filter=itemCode=PRT0001
1 comment
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Sean avatar image Sean commented ·

This is the correct answer. Thank you Jim!

0 Likes 0 ·

Welcome to the
Clover Developer Community