# Webhook-initiated nullifying of inventory
## Flow
Let's say theres at least 1 availability rule which is currently ongoin (after start before end, inventory was already nullified)
..and some1 manually modifies inv for this product to, say, 5
there should be a callback on inventory update from Shopify to our App
App consumes webhook
detects if product is of one of ongoing rules
~~detects if update was user initiated or our app-initiated (in which case we should do nothing)~~
we would just check if the new inv level is > 0
if webhook was user-initiated and product is of ongoing rule then:
product inventory level should be nullified for this product by POST request just like we do this on availability rule start.
## nullifying inventory
```curl
curl -X POST 'https://aime-leon-dore-dev-store.myshopify.com/admin/api/2020-10/inventory_levels/set.json' \
-H 'Authorization: Basic blabla=' \
--data-raw '{
"inventory_item_id": 36439723638921,
"location_id": 35407921289,
"available": 0
}'
```
## Other considerations
Webhooks should be auto-configured for every Shopify shop involved
https://shopify.dev/docs/admin-api/rest/reference/events/webhook
https://shopify.dev/tutorials/manage-webhooks#configuring-webhooks