question

brokenoval avatar image
brokenoval asked andrewdzoom answered

Is it possible to query the /items api using an item name?

Looking through the API documentation at this call: https://api.clover.com:443/v3/merchan...

There is a filter field for "name" = how can we make this work? For example I want to search the inventory for an item called "Coffee" however, trying this doesn't work: https://api.clover.com:443/v3/merchan...

Is it possible to search for Items "like" Coffee i.e. so that "Small Coffee" would show up? i.e. can we use a wildcard?

Thanks!

Inventory
10 |2000 characters needed characters left characters exceeded

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

Mark Mullan avatar image
Mark Mullan answered

Hi,

Absolutely. In order to find an item whose name is an exact match, make a get request to the following URL: https://www.clover.com/v3/merchants/{...

Likewise, if you want to construct a search for close matches: https://www.clover.com/v3/merchants/{...

The URL encoded %'s (%25) on either side of the query (coffee) represent wildcards of any length. Surrounding the query on both sides with %'s would, in this case, yield results for item names of "Small Coffee" and "Coffee - Dark Roast".

Thanks,

Mark

10 |2000 characters needed characters left characters exceeded

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

Mark Mullan avatar image
Mark Mullan answered brokenoval commented

Hi,

Absolutely. In order to find an item whose name is an exact match, make a get request to the following URL:

https://www.clover.com/v3/merchants/{mId}/items?filter=name%3Dcoffee

Likewise, if you want to construct a search for close matches:

https://www.clover.com/v3/merchants/{mId}/items?filter=name+LIKE%25coffee%25

The URL encoded %'s (%25) on either side of the query (coffee) represent wildcards of any length. Surrounding the query on both sides with %'s would, in this case, yield results for item names of "Small Coffee" and "Coffee - Dark Roast".

Thanks,

Mark

1 comment
10 |2000 characters needed characters left characters exceeded

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

Awesome - thanks Mark. I was close! The wildcard will be very useful

0 Likes 0 ·
andrewdzoom avatar image
andrewdzoom answered
I'm attempting to perform this request but it doesn't work when I add the filter. I can get all the items when I remove the filter but when adding the filter it says 401 unauthorized.

?filter=name==coffee
?filter=name%3Dcoffee
10 |2000 characters needed characters left characters exceeded

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

Welcome to the
Clover Developer Community