Square Inventory Webhook QUESTION

When a merchant marks the Item Availability of an item in Square for Restaurants as unavailable, should that trigger an Inventory update webhook event? I have a merchant saying that it used to work differently where this action was updating item availability in our app (via webhook under the hood), but does not anymore. They last saw it working how they expected on Saturday, April 3rd. What’s the expected behavior here? Is there any chance this behavior was changed recently?

As far as I know, this shouldn’t trigger an inventory webhook, as it’s not actually changing the inventory. It probably would trigger a catalog.version.updated webhook if it actually changes the availability field, but I wouldn’t suspect it to fire an inventory webhook.

If you think it really was working, please share your Square app id, and the Square location id of the merchant so I can take a look at the logs on our side to see if I can match up anything.

Hi Stephen,

I’m not sure if it was working this way, but your explanation makes sense. I just thought it was strange that it was supposedly working then changed. I tried myself but wasn’t able to get it to trigger an inventory webhook. I’ll go ahead and DM you that information.

Hi Stephen,

After some investigation + looking at the catalog_object_type from the webhook event, I found that the webhook triggers for the top level ITEM itself when setting availability via Square for Restaurants, however, usually we see it trigger for an ITEM_VARIATION by other means (e.g. a sale) which is how our app handles showing stock to the customer. Is this working as intended or did it change back when we originally talked about this? Seems strange that the user mention it working before but it changed at one point.

Would it be possible on Square’s end to fire an event to zero out the quantity count for both the ITEM and all ITEM_VARIATIONs when marking an item as unavailable in Square for Restaurants? That seems like it would be consistent with normal sales as well.

As far as I’m aware of this is working as expected in regards to availability. The webhook returns the entire ITEM.

As for automatically zeroing out inventory when an ITEM and all the ITEM_VARIATIONs that isn’t currently available. That be something that your application would need to trigger when an ITEM is make unavailable.

The last comment I had on zeroing out ITEM + ITEM_VARIATION(s) was more of a suggestion. I think it would make a ton more sense so that third party applications can make use of webhooks without having to trigger additional logic to search for which item variations are involved with an item inventory event. I’d think it makes more sense from a high level perspective too: if an item is sold out shouldn’t all of its variations be sold out?

Hi Bryan, do you know of other actions in Square that might trigger an ITEM level event for zero inventory? I have one user that has 0 stock at the item level but we’re not sure where that triggered. I can confirm that the merchant is not using Square for Restaurants. They are using Square Online, but I couldn’t find any relevant action that triggers at the ITEM level.

Was there any upserts to the item with the Catalog API?

No idea, if there was it was done outside of our app, since we don’t use the API endpoint at all. Is that the only other way this might happen? I can DM more details if it helps in investigating!