I use the category of an item to track it's sale. Since the Clover inventory does not reliably alert me when an item's category has been changed, I wrote a work around to check the category of an item at the time of sale. It's a little more load on your system, but I need this information to be accurate. This is all done against the v3 API
So, at the time of sale, I will ask a question like this:
v3/merchants/QSNPDHZQDSP7C/items/6VRPDFAM99QJE/categories?limit=100
I will usually get an answer that looks correct, and it has some categories sometimes, or at least it used to. Now I'm seeing answers like this, so I ignore the sale. Is the problem that the categories command is responding with the "tags" response?
{
["elements"]=>
array(0) {
}
["href"]=>
string(83) "http://api.clover.com/v3/merchants/QSNPDHZQDSP7C/items/6VRPDFAM99QJE/tags?limit=100"
}
Now I find out that my reports are wrong! So I double check, and the customer swears there are categories are right. How can this be? So, I try it from another angle, and ask the following question of the API. R0HYVQMV5PWPG is the ID of the category that the customer says is attached to this item.
v3/merchants/QSNPDHZQDSP7C/categories/R0HYVQMV5PWPG/items
And in reply, I get 43 items. I cut most of them out, but the last one I find very interesting.
{
["elements"]=>
array(43) {
....
[42]=>
object(stdClass)#48 (14) {
["id"]=>
string(13) "6VRPDFAM99QJE"
["hidden"]=>
bool(false)
["name"]=>
string(25) "Blue Leather Swivel Chair"
["alternateName"]=>
string(0) ""
["code"]=>
string(12) "210842175006"
["sku"]=>
string(0) ""
["price"]=>
int(7500)
["priceType"]=>
string(5) "FIXED"
["defaultTaxRates"]=>
bool(true)
["unitName"]=>
string(0) ""
["cost"]=>
int(0)
["isRevenue"]=>
bool(true)
["stockCount"]=>
int(0)
["modifiedTime"]=>
int(1456934649000)
}
}
["href"]=>
string(89) "http://api.clover.com/v3/merchants/QSNPDHZQDSP7C/categories/R0HYVQMV5PWPG/items?limit=100"
}
There, my item is listed as being attached to the category! So, now I'm off to write another work around. Despite all the attitude in my post, I fully accept that I might be doing something wrong, and if that's the case, I would sure appreciate some help.