Hey thanks Brian but is there a reason this would not work with the API Explorer? Here is what I tried and get in return:
curl https://connect.squareup.com/v2/catalog/batch-retrieve \
-X POST \
-H 'Square-Version: 2022-02-16' \
-H 'Authorization: Bearer ??????? \
-H 'Content-Type: application/json' \
-d '{
"object_ids": [
"642H3DA7OUHG3WFGYUKNPML2"
],
"catalog_version": 1644933420825,
"include_related_objects": true
}'
200 Response
cache-control: max-age=0, private, must-revalidate
content-length: 2
content-type: application/json
date: Fri, 18 Feb 2022 21:31:17 GMT
square-version: 2022-02-16
{}
Here is my Item that I’m trying to locate that I was able to retrieve using SearchCatalogObjects:
curl https://connect.squareup.com/v2/catalog/search \
-X POST \
-H 'Square-Version: 2022-02-16' \
-H 'Authorization: Bearer ????????? \
-H 'Content-Type: application/json' \
-d '{
"include_deleted_objects": true,
"include_related_objects": true,
"object_types": [
"ITEM"
],
"query": {
"exact_query": {
"attribute_name": "name",
"attribute_value": "Cinnamon Roll-GF & DF"
}
}
}'
200 Response
cache-control: max-age=0, private, must-revalidate
content-encoding: gzip
content-type: application/json
date: Fri, 18 Feb 2022 21:38:49 GMT
square-version: 2022-02-16
{
"objects": [
{
"type": "ITEM",
"id": "642H3DA7OUHG3WFGYUKNPML2",
"updated_at": "2022-02-15T13:57:00.825Z",
"created_at": "2022-01-31T17:56:43.335Z",
"version": 1644933420825,
"is_deleted": true,
"present_at_all_locations": false,
"present_at_location_ids": [
"3CB1PY9VJHZ8X"
],
"item_data": {
"name": "Cinnamon Roll-GF & DF",
"description": "**INTRO PRICE!** These gluten free and dairy free rolls are just as tasty for those craving a traditional cinnamon roll!<br />They are not made with nut flour, but they do contain coconut milk. They also contain soy and eggs.",
"abbreviation": "GF CR",
"label_color": "E5BF00",
"visibility": "PRIVATE",
"available_online": false,
"available_for_pickup": false,
"available_electronically": false,
"category_id": "WPLQ4GJRYZ3ZY5ISWI2XHS5O",
"ordinal": 0,
"product_type": "REGULAR",
"skip_modifier_screen": false,
"ecom_uri": "https://fusionbrew.square.site/product/cinnamon-roll-gf-df/322",
"ecom_image_uris": [
"https://fusionbrew.square.site/uploads/1/2/6/1/126108013/s134838118258639312_p322_i1_w1949.jpeg"
],
"ecom_available": false,
"ecom_visibility": "UNAVAILABLE",
"image_ids": [
"4CWCLXNMB7PZY72VDT3TGTA4"
]
}
}
],
"related_objects": [
{
"type": "CATEGORY",
"id": "WPLQ4GJRYZ3ZY5ISWI2XHS5O",
"updated_at": "2019-04-05T22:59:12.406Z",
"created_at": "2019-03-27T13:23:47.192Z",
"version": 1554505152406,
"is_deleted": false,
"present_at_all_locations": true,
"category_data": {
"name": "PASTRY",
"abbreviation": "Pstry",
"label_color": "ffe5bf00"
}
},
{
"type": "IMAGE",
"id": "4CWCLXNMB7PZY72VDT3TGTA4",
"updated_at": "2022-02-11T12:00:46.51Z",
"created_at": "2022-02-11T12:00:46.51Z",
"version": 1644580846510,
"is_deleted": false,
"present_at_all_locations": true,
"image_data": {
"name": "GF Cinnamon Roll.jpg",
"url": "https://items-images-production.s3.us-west-2.amazonaws.com/files/1d00645070dc12225efc627ca315193b0e9c21ec/original.jpeg"
}
}
],
"latest_time": "2022-02-18T21:29:39.558Z"
}
Am I missing something?
Also, it appears that there isn’t a related Variation which is what the order will have for a catalog_object_id. I’d try to run the query using the Item Variation id but I don’t know what it is since my task is to try and locate an order that has that deleted Item Variation on it.
Thanks,