I’m pulling catalog items by category from the /v2/catalog/search-catalog-items function. I am getting an array of item objects as expected, but they don’t seem to include the visibility property. When I run the query in the API Explorer, I get the following (partial list) properties:
"type": "ITEM",
"id": "**************",
"updated_at": "2022-03-16T15:39:01.731Z",
"created_at": "2022-03-06T22:29:46.131Z",
"version": 1647445141731,
"is_deleted": false,
"present_at_all_locations": true,
"item_data": {
"name": "*************",
"description": "*************",
"visibility": "PRIVATE",
"category_id": "*************",
...
As you can see, there is a item->item_data->visibility property here, but when I pull the data through the PHP API, the visibility property is not available! This is the output of get_class_methods on the Square\Models\CatalogItem object
print_r(get_class_methods($item->getItemData()));
Array
(
[0] => getName
[1] => setName
[2] => getDescription
[3] => setDescription
[4] => getAbbreviation
[5] => setAbbreviation
[6] => getLabelColor
[7] => setLabelColor
[8] => getAvailableOnline
[9] => setAvailableOnline
[10] => getAvailableForPickup
[11] => setAvailableForPickup
[12] => getAvailableElectronically
[13] => setAvailableElectronically
[14] => getCategoryId
[15] => setCategoryId
[16] => getTaxIds
[17] => setTaxIds
[18] => getModifierListInfo
[19] => setModifierListInfo
[20] => getVariations
[21] => setVariations
[22] => getProductType
[23] => setProductType
[24] => getSkipModifierScreen
[25] => setSkipModifierScreen
[26] => getItemOptions
[27] => setItemOptions
[28] => getImageIds
[29] => setImageIds
[30] => getSortName
[31] => setSortName
[32] => jsonSerialize
)
No sign of the getVisibility() method I am expecting.
I have verified both queries are using the 2022-03-16 version of the API, so from what I can tell, this is bug in the PHP version of the CatalogItem model?
I need visibility to filter out hidden items from the catalog, so any help would be appreciated!
whiteatom