Currently when app URL changes for some reason, Shopify would keep sending webhook callbacks to old URL. This would result in webhook failures and potential removals if apps don't ack in 24 hours. Currently Shopify doesn't allow you to bulk update callback URL.
Script that goes through all stores where your app is installed and then updates the webhook callback URL.
- Shopify domain names for all stores that has your app installed. (refer
data.json
) - Access token of each token to make mutation call.
- Python
- Patience :)
- Populate
data.json
with relevant store URL along with access token. - Update old & new callback URLs in
script.py
at line 19 & 20 - Install python dependencies.
pip install requests
pip install colorama
- Run script using
python script.py
- Sit back & relax.
The script introduces a 1-second delay between requests to avoid rate limiting and let's assume the time taken for each API request to complete (including network latency and server processing time) is approximately 1 second. So, it would take approximately 2.78 hours to process 5000 objects with the current script.