{"id":"19681583-562f-4faa-9e77-9e92a5b5777a","shortId":"GGScjW","kind":"skill","title":"woocommerce-webhooks","tagline":"Receive and verify WooCommerce webhooks. Use when setting up WooCommerce webhook handlers, debugging signature verification, or handling e-commerce events like order.created, order.updated, product.created, or customer.created.","description":"# WooCommerce Webhooks\n\n## When to Use This Skill\n\n- Setting up WooCommerce webhook handlers\n- Debugging signature verification failures\n- Understanding WooCommerce event types and payloads\n- Handling order, product, or customer events\n- Integrating with WooCommerce stores\n\n## Essential Code (USE THIS)\n\n### WooCommerce Signature Verification (JavaScript)\n\n```javascript\nconst crypto = require('crypto');\n\nfunction verifyWooCommerceWebhook(rawBody, signature, secret) {\n  if (!signature || !secret) return false;\n  \n  const hash = crypto\n    .createHmac('sha256', secret)\n    .update(rawBody)\n    .digest('base64');\n  \n  try {\n    return crypto.timingSafeEqual(\n      Buffer.from(signature), \n      Buffer.from(hash)\n    );\n  } catch {\n    return false;\n  }\n}\n```\n\n### Express Webhook Handler\n\n```javascript\nconst express = require('express');\nconst app = express();\n\n// CRITICAL: Use raw body for signature verification\napp.use('/webhooks/woocommerce', express.raw({ type: 'application/json' }));\n\napp.post('/webhooks/woocommerce', (req, res) => {\n  const signature = req.headers['x-wc-webhook-signature'];\n  const secret = process.env.WOOCOMMERCE_WEBHOOK_SECRET;\n  \n  if (!verifyWooCommerceWebhook(req.body, signature, secret)) {\n    return res.status(400).send('Invalid signature');\n  }\n  \n  const payload = JSON.parse(req.body);\n  const topic = req.headers['x-wc-webhook-topic'];\n  \n  console.log(`Received ${topic} event:`, payload.id);\n  res.status(200).send('OK');\n});\n```\n\n### Next.js API Route (App Router)\n\n```typescript\nimport crypto from 'crypto';\nimport { NextRequest } from 'next/server';\n\nexport async function POST(request: NextRequest) {\n  const signature = request.headers.get('x-wc-webhook-signature');\n  const secret = process.env.WOOCOMMERCE_WEBHOOK_SECRET;\n  \n  const rawBody = await request.text();\n  \n  if (!verifyWooCommerceWebhook(rawBody, signature, secret)) {\n    return new Response('Invalid signature', { status: 400 });\n  }\n  \n  const payload = JSON.parse(rawBody);\n  const topic = request.headers.get('x-wc-webhook-topic');\n  \n  console.log(`Received ${topic} event:`, payload.id);\n  return new Response('OK', { status: 200 });\n}\n```\n\n### FastAPI Handler\n\n```python\nimport hmac\nimport hashlib\nimport base64\nfrom fastapi import FastAPI, Request, HTTPException\n\napp = FastAPI()\n\ndef verify_woocommerce_webhook(raw_body: bytes, signature: str, secret: str) -> bool:\n    if not signature or not secret:\n        return False\n    \n    hash_digest = hmac.new(\n        secret.encode(),\n        raw_body,\n        hashlib.sha256\n    ).digest()\n    expected_signature = base64.b64encode(hash_digest).decode()\n    \n    return hmac.compare_digest(signature, expected_signature)\n\n@app.post('/webhooks/woocommerce')\nasync def handle_webhook(request: Request):\n    raw_body = await request.body()\n    signature = request.headers.get('x-wc-webhook-signature')\n    secret = os.getenv('WOOCOMMERCE_WEBHOOK_SECRET')\n    \n    if not verify_woocommerce_webhook(raw_body, signature, secret):\n        raise HTTPException(status_code=400, detail='Invalid signature')\n    \n    payload = await request.json()\n    topic = request.headers.get('x-wc-webhook-topic')\n    \n    print(f\"Received {topic} event: {payload.get('id')}\")\n    return {'status': 'success'}\n```\n\n## Common Event Types\n\n| Event | Triggered When | Common Use Cases |\n|-------|----------------|------------------|\n| `order.created` | New order placed | Send confirmation emails, update inventory |\n| `order.updated` | Order status changed | Track fulfillment, send notifications |\n| `order.deleted` | Order deleted | Clean up external systems |\n| `product.created` | Product added | Sync to external catalogs |\n| `product.updated` | Product modified | Update pricing, inventory |\n| `customer.created` | New customer registered | Welcome emails, CRM sync |\n| `customer.updated` | Customer info changed | Update profiles, preferences |\n\n## Environment Variables\n\n```bash\nWOOCOMMERCE_WEBHOOK_SECRET=your_webhook_secret_key\n```\n\n## Headers Reference\n\nWooCommerce webhooks include these headers:\n\n- `X-WC-Webhook-Signature` - HMAC SHA256 signature (base64)\n- `X-WC-Webhook-Topic` - Event type (e.g., \"order.created\")\n- `X-WC-Webhook-Resource` - Resource type (e.g., \"order\")\n- `X-WC-Webhook-Event` - Action (e.g., \"created\")\n- `X-WC-Webhook-Source` - Store URL\n- `X-WC-Webhook-ID` - Webhook ID\n- `X-WC-Webhook-Delivery-ID` - Unique delivery ID\n\n## Local Development\n\nFor local webhook testing, install Hookdeck CLI:\n\n```bash\n# Install via npm\nnpm install -g hookdeck-cli\n\n# Or via Homebrew\nbrew install hookdeck/hookdeck/hookdeck\n```\n\nThen start the tunnel:\n\n```bash\nhookdeck listen 3000 --path /webhooks/woocommerce\n```\n\nNo account required. Provides local tunnel + web UI for inspecting requests.\n\n## Reference Materials\n\n- `overview.md` - What WooCommerce webhooks are, common event types\n- `setup.md` - Configure webhooks in WooCommerce admin, get signing secret\n- `verification.md` - Signature verification details and gotchas\n- `examples/` - Complete runnable examples per framework\n\n## Recommended: webhook-handler-patterns\n\nFor production-ready webhook handlers, also install the webhook-handler-patterns skill for:\n\n- <a href=\"https://github.com/hookdeck/webhook-skills/blob/main/skills/webhook-handler-patterns/references/handler-sequence.md\">Handler sequence</a>\n- <a href=\"https://github.com/hookdeck/webhook-skills/blob/main/skills/webhook-handler-patterns/references/idempotency.md\">Idempotency</a>  \n- <a href=\"https://github.com/hookdeck/webhook-skills/blob/main/skills/webhook-handler-patterns/references/error-handling.md\">Error handling</a>\n- <a href=\"https://github.com/hookdeck/webhook-skills/blob/main/skills/webhook-handler-patterns/references/retry-logic.md\">Retry logic</a>\n\n## Related Skills\n\n- [stripe-webhooks](https://github.com/hookdeck/webhook-skills/tree/main/skills/stripe-webhooks) - Stripe payment webhooks with HMAC verification\n- [shopify-webhooks](https://github.com/hookdeck/webhook-skills/tree/main/skills/shopify-webhooks) - Shopify store webhooks with HMAC verification\n- [github-webhooks](https://github.com/hookdeck/webhook-skills/tree/main/skills/github-webhooks) - GitHub repository webhooks\n- [paddle-webhooks](https://github.com/hookdeck/webhook-skills/tree/main/skills/paddle-webhooks) - Paddle billing webhooks\n- [webhook-handler-patterns](https://github.com/hookdeck/webhook-skills/tree/main/skills/webhook-handler-patterns) - Idempotency, error handling, retry logic\n- [hookdeck-event-gateway](https://github.com/hookdeck/webhook-skills/tree/main/skills/hookdeck-event-gateway) - Production webhook infrastructure","tags":["woocommerce","webhooks","webhook","skills","hookdeck","agent-skills","ai-coding","api-integrations","event-driven","github-webhooks","llm-tools","shopify-webhooks"],"capabilities":["skill","source-hookdeck","skill-woocommerce-webhooks","topic-agent-skills","topic-ai-coding","topic-api-integrations","topic-event-driven","topic-github-webhooks","topic-llm-tools","topic-shopify-webhooks","topic-stripe-webhooks","topic-webhook-security","topic-webhook-signatures","topic-webhooks"],"categories":["webhook-skills"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/hookdeck/webhook-skills/woocommerce-webhooks","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add hookdeck/webhook-skills","source_repo":"https://github.com/hookdeck/webhook-skills","install_from":"skills.sh"}},"qualityScore":"0.484","qualityRationale":"deterministic score 0.48 from registry signals: · indexed on github topic:agent-skills · 69 github stars · SKILL.md body (6,631 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-05-02T06:55:48.248Z","embedding":null,"createdAt":"2026-04-18T22:14:05.637Z","updatedAt":"2026-05-02T06:55:48.248Z","lastSeenAt":"2026-05-02T06:55:48.248Z","tsv":"'/hookdeck/webhook-skills/tree/main/skills/github-webhooks)':639 '/hookdeck/webhook-skills/tree/main/skills/hookdeck-event-gateway)':670 '/hookdeck/webhook-skills/tree/main/skills/paddle-webhooks)':648 '/hookdeck/webhook-skills/tree/main/skills/shopify-webhooks)':627 '/hookdeck/webhook-skills/tree/main/skills/stripe-webhooks)':615 '/hookdeck/webhook-skills/tree/main/skills/webhook-handler-patterns)':658 '/webhooks/woocommerce':125,130,308,538 '200':175,249 '3000':536 '400':153,226,344 'account':540 'action':478 'ad':403 'admin':565 'also':592 'api':179 'app':115,181,265 'app.post':129,307 'app.use':124 'application/json':128 'async':193,309 'await':213,317,349 'base64':95,258,454 'base64.b64encode':297 'bash':431,513,533 'bill':650 'bodi':120,272,292,316,337 'bool':278 'brew':526 'buffer.from':99,101 'byte':273 'case':376 'catalog':407 'catch':103 'chang':389,425 'clean':397 'cli':512,522 'code':64,343 'commerc':23 'common':368,374,557 'complet':576 'configur':561 'confirm':382 'console.log':169,239 'const':72,86,110,114,133,141,157,161,198,206,211,227,231 'creat':480 'createhmac':89 'critic':117 'crm':420 'crypto':73,75,88,185,187 'crypto.timingsafeequal':98 'custom':57,416,423 'customer.created':30,414 'customer.updated':422 'debug':16,43 'decod':300 'def':267,310 'delet':396 'deliveri':499,502 'detail':345,572 'develop':505 'digest':94,288,294,299,303 'e':22 'e-commerc':21 'e.g':462,471,479 'email':383,419 'environ':429 'error':604,660 'essenti':63 'event':24,49,58,172,242,362,369,371,460,477,558,666 'exampl':575,578 'expect':295,305 'export':192 'express':106,111,113,116 'express.raw':126 'extern':399,406 'f':359 'failur':46 'fals':85,105,286 'fastapi':250,260,262,266 'framework':580 'fulfil':391 'function':76,194 'g':519 'gateway':667 'get':566 'github':635,640 'github-webhook':634 'github.com':614,626,638,647,657,669 'github.com/hookdeck/webhook-skills/tree/main/skills/github-webhooks)':637 'github.com/hookdeck/webhook-skills/tree/main/skills/hookdeck-event-gateway)':668 'github.com/hookdeck/webhook-skills/tree/main/skills/paddle-webhooks)':646 'github.com/hookdeck/webhook-skills/tree/main/skills/shopify-webhooks)':625 'github.com/hookdeck/webhook-skills/tree/main/skills/stripe-webhooks)':613 'github.com/hookdeck/webhook-skills/tree/main/skills/webhook-handler-patterns)':656 'gotcha':574 'handl':20,53,311,605,661 'handler':15,42,108,251,584,591,597,601,654 'hash':87,102,287,298 'hashlib':256 'hashlib.sha256':293 'header':439,445 'hmac':254,451,620,632 'hmac.compare':302 'hmac.new':289 'homebrew':525 'hookdeck':511,521,534,665 'hookdeck-c':520 'hookdeck-event-gateway':664 'hookdeck/hookdeck/hookdeck':528 'httpexcept':264,341 'id':364,492,494,500,503 'idempot':603,659 'import':184,188,253,255,257,261 'includ':443 'info':424 'infrastructur':673 'inspect':548 'instal':510,514,518,527,593 'integr':59 'invalid':155,223,346 'inventori':385,413 'javascript':70,71,109 'json.parse':159,229 'key':438 'like':25 'listen':535 'local':504,507,543 'logic':607,663 'materi':551 'modifi':410 'new':221,245,378,415 'next.js':178 'next/server':191 'nextrequest':189,197 'notif':393 'npm':516,517 'ok':177,247 'order':54,379,387,395,472 'order.created':26,377,463 'order.deleted':394 'order.updated':27,386 'os.getenv':327 'overview.md':552 'paddl':644,649 'paddle-webhook':643 'path':537 'pattern':585,598,655 'payload':52,158,228,348 'payload.get':363 'payload.id':173,243 'payment':617 'per':579 'place':380 'post':195 'prefer':428 'price':412 'print':358 'process.env.woocommerce':143,208 'product':55,402,409,588,671 'product.created':28,401 'product.updated':408 'production-readi':587 'profil':427 'provid':542 'python':252 'rais':340 'raw':119,271,291,315,336 'rawbodi':78,93,212,217,230 'readi':589 'receiv':4,170,240,360 'recommend':581 'refer':440,550 'regist':417 'relat':608 'repositori':641 'req':131 'req.body':148,160 'req.headers':135,163 'request':196,263,313,314,549 'request.body':318 'request.headers.get':200,233,320,352 'request.json':350 'request.text':214 'requir':74,112,541 'res':132 'res.status':152,174 'resourc':468,469 'respons':222,246 'retri':606,662 'return':84,97,104,151,220,244,285,301,365 'rout':180 'router':182 'runnabl':577 'secret':80,83,91,142,145,150,207,210,219,276,284,326,330,339,434,437,568 'secret.encode':290 'send':154,176,381,392 'sequenc':602 'set':11,38 'setup.md':560 'sha256':90,452 'shopifi':623,628 'shopify-webhook':622 'sign':567 'signatur':17,44,68,79,82,100,122,134,140,149,156,199,205,218,224,274,281,296,304,306,319,325,338,347,450,453,570 'skill':37,599,609 'skill-woocommerce-webhooks' 'sourc':485 'source-hookdeck' 'start':530 'status':225,248,342,366,388 'store':62,486,629 'str':275,277 'stripe':611,616 'stripe-webhook':610 'success':367 'sync':404,421 'system':400 'test':509 'topic':162,168,171,232,238,241,351,357,361,459 'topic-agent-skills' 'topic-ai-coding' 'topic-api-integrations' 'topic-event-driven' 'topic-github-webhooks' 'topic-llm-tools' 'topic-shopify-webhooks' 'topic-stripe-webhooks' 'topic-webhook-security' 'topic-webhook-signatures' 'topic-webhooks' 'track':390 'tri':96 'trigger':372 'tunnel':532,544 'type':50,127,370,461,470,559 'typescript':183 'ui':546 'understand':47 'uniqu':501 'updat':92,384,411,426 'url':487 'use':9,35,65,118,375 'variabl':430 'verif':18,45,69,123,571,621,633 'verifi':6,268,333 'verification.md':569 'verifywoocommercewebhook':77,147,216 'via':515,524 'wc':138,166,203,236,323,355,448,457,466,475,483,490,497 'web':545 'webhook':3,8,14,32,41,107,139,144,167,204,209,237,270,312,324,329,335,356,433,436,442,449,458,467,476,484,491,493,498,508,555,562,583,590,596,612,618,624,630,636,642,645,651,653,672 'webhook-handler-pattern':582,595,652 'welcom':418 'woocommerc':2,7,13,31,40,48,61,67,269,328,334,432,441,554,564 'woocommerce-webhook':1 'x':137,165,202,235,322,354,447,456,465,474,482,489,496 'x-wc-webhook-delivery-id':495 'x-wc-webhook-ev':473 'x-wc-webhook-id':488 'x-wc-webhook-resourc':464 'x-wc-webhook-signatur':136,201,321,446 'x-wc-webhook-sourc':481 'x-wc-webhook-top':164,234,353,455","prices":[{"id":"db9958ed-5107-465f-98e3-4ee74b1e040c","listingId":"19681583-562f-4faa-9e77-9e92a5b5777a","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"hookdeck","category":"webhook-skills","install_from":"skills.sh"},"createdAt":"2026-04-18T22:14:05.637Z"}],"sources":[{"listingId":"19681583-562f-4faa-9e77-9e92a5b5777a","source":"github","sourceId":"hookdeck/webhook-skills/woocommerce-webhooks","sourceUrl":"https://github.com/hookdeck/webhook-skills/tree/main/skills/woocommerce-webhooks","isPrimary":false,"firstSeenAt":"2026-04-18T22:14:05.637Z","lastSeenAt":"2026-05-02T06:55:48.248Z"}],"details":{"listingId":"19681583-562f-4faa-9e77-9e92a5b5777a","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"hookdeck","slug":"woocommerce-webhooks","github":{"repo":"hookdeck/webhook-skills","stars":69,"topics":["agent-skills","ai-coding","api-integrations","event-driven","github-webhooks","llm-tools","shopify-webhooks","stripe-webhooks","webhook-security","webhook-signatures","webhooks"],"license":"mit","html_url":"https://github.com/hookdeck/webhook-skills","pushed_at":"2026-02-25T14:00:40Z","description":"Webhook integration skills for AI coding agents (Claude Code, Cursor, Copilot). Step-by-step guidance for setting up webhook receivers, signature verification, and event handling for Stripe, Shopify, GitHub, and more. Built on the Agent Skills specification.","skill_md_sha":"1c9b55039f9c4a2085c9f376b7490fd42ea9082d","skill_md_path":"skills/woocommerce-webhooks/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/hookdeck/webhook-skills/tree/main/skills/woocommerce-webhooks"},"layout":"multi","source":"github","category":"webhook-skills","frontmatter":{"name":"woocommerce-webhooks","license":"MIT","description":"Receive and verify WooCommerce webhooks. Use when setting up WooCommerce webhook handlers, debugging signature verification, or handling e-commerce events like order.created, order.updated, product.created, or customer.created."},"skills_sh_url":"https://skills.sh/hookdeck/webhook-skills/woocommerce-webhooks"},"updatedAt":"2026-05-02T06:55:48.248Z"}}