I was under the impression that inventory count event webhooks were only sent for variations, as only variations are able to have stock adjusted. Looking in my Square dashboard, I don’t see any options to adjust stock on an item, only variations. But we received a webhook that referenced an item in the inventory counts.
{
created_at: '2022-02-21T20:50:38.936612063Z',
data: {
id: '2aa1f3ba-aa07-4fa9-bca8-b03ce4bb2006',
object: {
inventory_counts: ["{'calculated_at': '2022-02-21T20:50:38.683Z', 'catalog_object_id': 'DK7L4POKJ6PRH67PRYP4DKHN', 'catalog_object_type': 'ITEM', 'location_id': '5TCJYTS0A7S17', 'quantity': '0', 'state': 'IN_STOCK'}"]
},
type: 'inventory'
},
event_id: '0fa7834e-2e80-4570-8ee1-def4a9f54871',
merchant_id: 'D1NE7EWCJ2PMA',
type: 'inventory.count.updated'
}
Since our webhook handler expects variations, this of course caused an error. Should we be expecting this webhook to handle both variations and items, or was this an error? I don’t even see how item stock can be updated, only variation.