I'm developing an application to sync Shopify product lists with my own database. When a product is deleted from the Shopify admin, I need to delete it in the MySQL database. I think I have to create a webhook to delete the product. I know a way to create a webhook in the Shopify admin page, but I want to create it when the app is installed. If you have any ideas please tell me your answers.
I tried looking for answers to this problem but couldn't find any solution.
I think you are looking forAutomated Webhook Subscriptionsvia API. Yes, Shopify does allow this. When your app is being installed or authorized by a Shopify store, you need to call the subscription hook through the API. Please check the documentation below.
Learn about webhooks and behaviors:https://shopify.dev/apps/webhooks
Webhook subscription API:https://shopify.dev/ api/admin-rest/2022-10/resources/webhook