Hi want to retrieve data of deleted item through webhook?

 

Hi,

I'd like to discuss retrieving deleted item data via webhook in our app's community.

Currently, I'm utilizing the webhook event - catalog.version.updated. Whenever an item is deleted, this webhook triggers, providing the following response:

 

{ "merchant_id": "MLJAVG3923PHF", "type": "catalog.version.updated", "event_id": "53cdd6cf-9f05-3bc9-8f1d-25bc6025afd8", "created_at": "2024-05-08T07:56:47.587202072Z", "data": { "type": "catalog_version", "id": "", "object": { "catalog_version": { "updated_at": "2024-05-08T07:56:45.438Z" } } } }

According to the documentation, we're required to call the API below, utilizing the updated_time from the webhook response as the begin time:

 

curl https://connect.squareup.com/v2/catalog/search \ -X POST \ -H 'Square-Version: 2024-04-17' \ -H 'Authorization: Bearer ACCESS_TOKEN' \ -H 'Content-Type: application/json' \ -d '{ "include_deleted_objects": true, "object_types": [ "ITEM" ], "begin_time": "2024-05-08T07:12:34.79Z" }'

The API provides the following response:

{ "objects": [ { "type": "ITEM", "id": "ZC2QBCBGMQYAMUM7AGIHUREO", "updated_at": "2024-05-08T07:12:35.79Z", "created_at": "2024-05-08T07:03:45.114Z", "version": 1715152355790, "is_deleted": true, "present_at_all_locations": false, "present_at_location_ids": [ "L92N477RWT4DR" ], "absent_at_location_ids": [ "L2J39YZENSRK0", "LN23PK6DED00X" ], "item_data": { "name": "Item1", "is_taxable": true, "visibility": "PRIVATE", "product_type": "REGULAR", "skip_modifier_screen": false, "ecom_visibility": "UNINDEXED", "pickup_fulfillment_preferences_id": "fprefs_127zshyokc0idpxxi466vlzvt", "delivery_fulfillment_preferences_id": "fprefs_127zshyojbq6dedez6eud52ax", "shipping_fulfillment_preferences_id": "fprefs_127zshyoksfhvua2954dnwf6x", "dine_in_fulfillment_preferences_id": "fprefs_127zshyojty615dgdgdefzca1", "is_archived": false } } ], "latest_time": "2024-05-08T07:56:48.116Z" }

 

However, I'm unable to retrieve details like UPC and stock level from this response. Could you please guide me on how to access such product details?

516 Views
Message 1 of 2
Report
1 Solution

Solution

Hey there Nishantyadav,

 

You may want to visit the Developer Forum for possible assistance as your question is a bit beyond the scope of this Community.   Most of the volunteer Community Members are small business owners who have hands on experience using Square's Apps and Hardware.  The folks who work with coding usually hang out in the Developer's Forum.  Hopefully someone there can help you out.

 

View Solution >

493 Views
Message 2 of 2
Report
1 REPLY 1

Solution

Hey there Nishantyadav,

 

You may want to visit the Developer Forum for possible assistance as your question is a bit beyond the scope of this Community.   Most of the volunteer Community Members are small business owners who have hands on experience using Square's Apps and Hardware.  The folks who work with coding usually hang out in the Developer's Forum.  Hopefully someone there can help you out.

 

494 Views
Message 2 of 2
Report