We have created an app in Shopify that populates product metadata. We are using Rest API with Laravel for this. If the app is uninstalled do we need to make sure that this metadata gets removed? We analyzed APIs and didn’t find a way to delete the metadata populate by the app using REST API. There are APIs on GraphQL but due to some development challenges, we would prefer using REST API.
I think it is simply not possible to delete the metafields when a merchant uninstalls the app, because the token to access their shop become invalid, so the app_uninstall webhook is not useful. A workaround could be to add a button to the app that removes every metafield using the metafieldDelete mutation. Maybe you need to store the ids of every metafield definition of the store in your own database to be able to delete them easily.