Shopify Webhook Integration
Shopify webhooks notify your application in real-time when events occur in your Shopify store, including order creation, inventory updates, customer actions, and more. Perfect for order fulfillment, inventory management, and customer engagement automation.Quick Start
- Get your Unhook URL:
https://unhook.sh/wh_YOUR_ID - Configure via Shopify Admin API or Partner Dashboard
- Start receiving events locally:
unhook listen
Configuration Methods
Method 1: Using Shopify Admin API
Method 2: Using GraphQL Admin API
Method 3: Using Shopify CLI (Development)
Webhook Topics
Order Events
orders/create- New order placedorders/updated- Order modifiedorders/paid- Order payment receivedorders/cancelled- Order cancelledorders/fulfilled- Order shippedorders/partially_fulfilled- Partial shipmentrefunds/create- Refund issuedtransactions/create- Payment transaction
Product Events
products/create- Product addedproducts/update- Product modifiedproducts/delete- Product removedinventory_levels/update- Stock level changedinventory_items/create- Inventory item addedinventory_items/update- Inventory item modifiedinventory_items/delete- Inventory item removed
Customer Events
customers/create- New customer registeredcustomers/update- Customer profile updatedcustomers/delete- Customer deletedcustomers/enable- Customer account activatedcustomers/disable- Customer account deactivated
Collection Events
collections/create- Collection createdcollections/update- Collection modifiedcollections/delete- Collection removedcollection_listings/add- Product added to collectioncollection_listings/remove- Product removed from collection
Cart & Checkout Events
carts/create- Cart createdcarts/update- Cart modifiedcheckouts/create- Checkout startedcheckouts/update- Checkout updatedcheckouts/delete- Checkout abandoned
App Events
app/uninstalled- App uninstalledshop/update- Shop settings changedthemes/publish- Theme publishedthemes/update- Theme modified
Event Payload Examples
Order Created
Product Updated
Customer Created
Webhook Verification
Verify HMAC Signature
Shopify signs all webhooks. Always verify:Additional Headers
Shopify includes useful headers:X-Shopify-Topic- Event type (e.g., ‘orders/create’)X-Shopify-Shop-Domain- Shop domainX-Shopify-API-Version- API version usedX-Shopify-Webhook-Id- Unique webhook ID
Best Practices
1. Idempotent Processing
Handle duplicate webhooks:2. Quick Response
Respond within 5 seconds:3. Mandatory Webhooks
For public apps, implement mandatory webhooks:4. Error Handling
Implement robust error handling:Testing Webhooks
Create Test Notifications
Development Testing
Use ngrok or similar for local testing:Common Issues
Webhook Not Received
- Verify webhook is registered correctly
- Check webhook notification history in admin
- Ensure Unhook tunnel is active
- Verify HMAC secret is correct
Verification Failures
- Use raw request body for HMAC calculation
- Ensure webhook secret matches
- Check for middleware modifying body
Missing Topics
- Some topics require specific API access scopes
- Check app permissions
- Verify API version compatibility
Rate Limits
- Shopify limits webhook creation (4 per second)
- Maximum 1000 webhooks per app
- Consider batching operations
Environment Variables
Useful Links
- Shopify Admin: admin.shopify.com
- Webhook Documentation: shopify.dev/docs/apps/webhooks
- Webhook Topics Reference: shopify.dev/docs/api/admin-rest/2024-01/resources/webhook#event-topics
- Partner Dashboard: partners.shopify.com
- Shopify CLI: shopify.dev/docs/apps/tools/cli
- API Reference: shopify.dev/docs/api
Support
Need help with Shopify webhooks?- Join our Discord community
- Visit Shopify Community
- Check Shopify Help Center
- Email us at support@unhook.sh