Command Palette

Search for a command to run...

UnylyUnyly
Back to skills

flutterwave-webhooks

FreeRuns bundled scriptsNot checked

Receive and verify Flutterwave webhooks, v4 and v3. Use when setting up a Flutterwave webhook URL and secret hash, verifying the v4 flutterwave-signature…

hookdeckby hookdeck★ 104 GitHub stars

About this skill

Flutterwave Webhooks

Flutterwave sends a POST with a JSON body when something happens on your account: a payment completes, a transfer settles, a refund finishes. You set the webhook URL and a secret hash under Settings > Webhooks in the dashboard. How Flutterwave proves a request is genuine depends on the API version:

Version Header Value
v4 flutterwave-signature Base64 HMAC-SHA256 of the raw body, keyed with the secret hash
v3 verif-hash The secret hash itself (no signature)

Both versions are supported: Flutterwave has said it has no plans to deprecate v3.

When to Use This Skill

  • How do I receive Flutterwave webhooks?
  • How do I verify the Flutterwave flutterwave-signature header?
  • What's the difference between verif-hash and flutterwave-signature?
  • Why does my Flutterwave v4 signature never match? (usually: the body was re-serialised)
  • How do I handle charge.completed or transfer.disburse from Flutterwave?

Verification (core)

const crypto = require('crypto');

function verifyFlutterwaveWebhook(rawBody, headers, secretHash) {   // rawBody: exact bytes
  if (!secretHash) return false;
  const signature = headers['flutterwave-signature'];
  if (signature) {
    // v4: base64 HMAC-SHA256 of the raw body, keyed with the secret hash as-is.
    const expected = crypto.createHmac('sha256', secretHash).update(rawBody).digest();
    const given = Buffer.from(signature, 'base64');
    return given.length === expected.length && crypto.timingSafeEqual(given, expected);
  }
  const verifHash = headers['verif-hash'];          // v3: the secret hash itself
  if (!verifHash) return false;
  const a = crypto.createHash('sha256').update(verifHash).digest();
  const b = crypto.createHash('sha256').update(secretHash).digest();
  return crypto.timingSafeEqual(a, b);
}
  • v4 if flutterwave-signature is present, otherwise v3 verif-hash. A failed v4 check is a failure; it doesn't fall back to verif-hash.
  • Flutterwave's v4 docs contradict themselves. The "Sample hashing" helper computes createHmac('sha256', secretHash).update(rawBody).digest('base64'), but the framework examples further down the same page compare flutterwave-signature directly to the secret hash, like v3. The examples follow the HMAC helper. If live v4 deliveries fail verification and the header turns out to equal your secret hash, the framework examples describe your account: switch that branch to a constant-time compare against the secret hash.
  • Verify the raw body. The helper's raw-body capture (bodyParser.json({ verify })) exists for that reason; re-serialised JSON won't match.
  • Bad or missing signature: 401 (Flutterwave's samples do the same). Secret not set: 500. Success: exactly 200. Flutterwave treats every other code, 201 and 3xx included, as a failure.

For complete handlers with tests, see examples/express/, examples/nextjs/, examples/fastapi/.

Python uses the same steps with hmac.new(secret.encode(), raw_body, hashlib.sha256), base64.b64decode and hmac.compare_digest. See references/verification.md.

Hookdeck: the Flutterwave source type (FLUTTERWAVE) verifies the v4 flutterwave-signature with your secret hash. Verification is optional on the source; v3 sends no signature, so leave it off for v3 webhooks. Flutterwave signs no timestamp, and Hookdeck applies no timestamp window.

Payloads

v4 bodies have a webhook ID, a millisecond timestamp, a type and data:

{
  "webhook_id": "wbk_rp0bjKyAWA52ViM8xlZ0",
  "timestamp": 1739877172874,
  "type": "transfer.disburse",
  "data": { "id": "trf_yMZATJ11yVPNkZ", "amount": 50000, "status": "SUCCESSFUL", "reference": "5748745ug8ufdgjhveyebjhcdbchb" }
}

The webhooks page shows the ID as id; the API reference and other v4 pages call it webhook_id. Read either.

v3 bodies have event and data (and sometimes "event.type"):

{ "event": "charge.completed", "data": { "id": 285959875, "tx_ref": "Links-616626414629", "amount": 100, "currency": "NGN", "status": "successful" } }

Event Types

v4 type v3 event Fired when
charge.completed charge.completed A payment succeeds or fails (check data.status)
transfer.disburse transfer.completed A transfer (payout) reaches a final status
transfer.reversal A transfer is reversed (listed in the v4 API reference)
refund.completed refund payload (no event field) A refund finishes
order.authorization Listed in the v4 API reference's type enum; no payload documented
subscription.cancelled A payment plan subscription is cancelled
bvn.completed, singlebillpayment.status, chargeback.*, account.tokenize, quote.completed Produ
Full SKILL.md on GitHub

Install flutterwave-webhooks in Claude Code & Claude Desktop

Sign up to install this skill

Create a free account to reveal the install command and save the skill to your library.

  • Reveal the one-line install command
  • Save skills to your synced library
  • Get notified when skills update
Sign up freeI already have an account

Allowed tools

Tools this skill is permitted to call.

No restriction — this skill can use any tool.

Bundled files

examples/express/.env.exampleexamples/express/README.mdexamples/express/package.jsonexamples/express/src/index.jsexamples/fastapi/.env.exampleexamples/fastapi/README.mdexamples/fastapi/main.pyexamples/fastapi/requirements.txtexamples/fastapi/test_webhook.pyexamples/nextjs/.env.exampleexamples/nextjs/README.mdexamples/nextjs/app/webhooks/flutterwave/route.tsexamples/nextjs/lib/verify-flutterwave.tsexamples/nextjs/package.jsonexamples/nextjs/vitest.config.tsreferences/overview.mdreferences/setup.mdreferences/verification.md

FAQ

What does the flutterwave-webhooks skill do?

Receive and verify Flutterwave webhooks, v4 and v3. Use when setting up a Flutterwave webhook URL and secret hash, verifying the v4 flutterwave-signature header (base64 HMAC-SHA256 of the raw body) or the v3 verif-hash header, debugging signature mismatches, or handling events like charge.completed, transfer.disburse, transfer.completed, refund.completed and subscription.cancelled.

How do I install the flutterwave-webhooks skill?

Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.

Does the flutterwave-webhooks skill run scripts?

Yes, this skill bundles executable scripts. Review the source before installing.

Related skills

Compare flutterwave-webhooks with