I’m using Square REST API to integrate Square into our custom ERP solution.
I’m listening to catalog.version.updated
event to list the updated items. Now I want to see what ITEM_OPTION
that variant has because I have an id of that itemOption in item i.e.
"itemOptions": [
{
"itemOptionId": "6LLNH26WQSUD57WDDJFAVJ34"
}
]
Now I want to get the itemOption
so that I can get its name and its option values but I can’t find any suitable APIs for that! I can search for itemOptions
using searchCatalogObjects
like the following…
curl https://connect.squareupsandbox.com/v2/catalog/search \
-X POST \
-H 'Square-Version: 2023-05-17' \
-H 'Authorization: Bearer TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"begin_time": "2023-01-31T07:16:11.786Z",
"include_deleted_objects": true,
"object_types": [
"ITEM_OPTION"
],
"query": {
"exact_query": {
"attribute_value": "Size",
"attribute_name": "name" // id argument doesn't work here but name works!
}
}
}'
But for that, I need a name of an option but I can’t seem to find any way in which I can use my id!
NOTE: I’ve already raised this query on slack but though to post here so that it may help someone else in the future!