Skip to main content

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

  1. Get your Unhook URL: https://unhook.sh/wh_YOUR_ID
  2. Configure via Shopify Admin API or Partner Dashboard
  3. Start receiving events locally: unhook listen

Configuration Methods

Method 1: Using Shopify Admin API

Method 2: Using GraphQL Admin API

Variables:

Method 3: Using Shopify CLI (Development)

Webhook Topics

Order Events

  • orders/create - New order placed
  • orders/updated - Order modified
  • orders/paid - Order payment received
  • orders/cancelled - Order cancelled
  • orders/fulfilled - Order shipped
  • orders/partially_fulfilled - Partial shipment
  • refunds/create - Refund issued
  • transactions/create - Payment transaction

Product Events

  • products/create - Product added
  • products/update - Product modified
  • products/delete - Product removed
  • inventory_levels/update - Stock level changed
  • inventory_items/create - Inventory item added
  • inventory_items/update - Inventory item modified
  • inventory_items/delete - Inventory item removed

Customer Events

  • customers/create - New customer registered
  • customers/update - Customer profile updated
  • customers/delete - Customer deleted
  • customers/enable - Customer account activated
  • customers/disable - Customer account deactivated

Collection Events

  • collections/create - Collection created
  • collections/update - Collection modified
  • collections/delete - Collection removed
  • collection_listings/add - Product added to collection
  • collection_listings/remove - Product removed from collection

Cart & Checkout Events

  • carts/create - Cart created
  • carts/update - Cart modified
  • checkouts/create - Checkout started
  • checkouts/update - Checkout updated
  • checkouts/delete - Checkout abandoned

App Events

  • app/uninstalled - App uninstalled
  • shop/update - Shop settings changed
  • themes/publish - Theme published
  • themes/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 domain
  • X-Shopify-API-Version - API version used
  • X-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

Support

Need help with Shopify webhooks?