A production-ready Node.js server that receives, verifies, and processes Shopify webhooks in real time. Built for stores that need reliable order confirmation, payment status sync, and event-driven automation without third party app overhead.
Most Shopify stores handle webhooks poorly. Unverified endpoints, no signature checking, no error handling. One bad actor spoofing a payload and your order logic fires on fake data. This handler eliminates that entirely.
graph TD
A[Shopify Store] -->|Fires Webhook| B[POST /api/webhooks]
B --> C{Verify HMAC Signature}
C -->|Invalid| D[401 Unauthorized]
C -->|Valid| E[Extract Topic & Payload]
E --> F{Route by Topic}
F -->|orders/create| G[Handle New Order]
F -->|orders/paid| H[Handle Payment]
F -->|orders/cancelled| I[Handle Cancellation]
F -->|checkouts/create| J[Handle Checkout]
G & H & I & J --> K[200 Success Response]
| Topic | Description |
|---|---|
| orders/create | Fires when a new order is placed |
| orders/paid | Fires when payment is confirmed |
| orders/cancelled | Fires when an order is cancelled |
| checkouts/create | Fires when a checkout session starts |
Incoming Request:
{
"headers": {
"x-shopify-topic": "orders/paid",
"x-shopify-hmac-sha256": "base64_encoded_signature"
},
"body": {
"order_number": 1234,
"email": "customer@example.com",
"total_price": "149.99",
"currency": "USD",
"financial_status": "paid"
}
}Server Response:
{
"success": true,
"message": "Webhook processed: orders/paid"
}git clone https://github.com/Waynelynx12/shopify-webhook-handler.git
cd shopify-webhook-handler
npm install
cp .env.example .env
npm run dev| Variable | Description |
|---|---|
| SHOPIFY_WEBHOOK_SECRET | Found in Shopify Admin > Settings > Notifications |
| PORT | Server port, defaults to 3000 |
| SHOPIFY_ACCESS_TOKEN | Your store access token |
Once running, hit this endpoint to confirm the server is live:
GET http://localhost:3000/health
{
"status": "online",
"service": "Shopify Webhook Handler",
"timestamp": "2026-05-30T14:00:00.000Z"
}Sheriff Wayne, Growth Engineer and Shopify Technical Specialist. I build native code solutions for ecommerce stores that need reliability without app dependency.