Skip to content
Real-Time Automation

Signed Scan Webhooks (qr.scanned).

Receive an HTTPS POST callback within seconds of every dynamic QR scan. Every delivery is signed with HMAC-SHA256, SSRF-protected, and ready for Zapier, Make, n8n, or custom backends.

Event Payload & Headers

Configure up to 5 HTTPS endpoints at /api-keys or via POST /api/v1/webhooks. DynamicQR sends these headers with every request:

  • X-DynamicQR-Event: qr.scanned
  • X-DynamicQR-Delivery: unique delivery UUID
  • X-DynamicQR-Signature: t=<unix_timestamp>,v1=<hex_hmac_sha256>
  • Signed string format: <unix_timestamp>.<raw_request_body>
Example qr.scanned JSON payload
{
  "event": "qr.scanned",
  "occurred_at": "2026-11-27T12:30:00Z",
  "qr_code": {
    "id": 42,
    "name": "App Download Poster",
    "slug": "get-our-app",
    "destination_url": "https://apps.apple.com/app/example"
  },
  "scan": {
    "device_type": "mobile",
    "os_name": "iOS",
    "country_code": "DE"
  }
}

Verify HMAC-SHA256 Signatures

Always compute the HMAC-SHA256 digest over the raw request body (never re-serialized JSON) and compare using constant-time comparison. Reject timestamps older than 5 minutes to prevent replay attacks.

Node.js / TypeScript
import crypto from 'node:crypto';

export function verifyDynamicQRSignature(rawBody: string, header: string, secret: string): boolean {
  const parts = Object.fromEntries(header.split(',').map((p) => p.split('=')));
  if (!parts.t || !parts.v1) return false;
  if (Math.abs(Date.now() / 1000 - Number(parts.t)) > 300) return false;

  const expected = crypto
    .createHmac('sha256', secret)
    .update(`${parts.t}.${rawBody}`)
    .digest('hex');

  return crypto.timingSafeEqual(Buffer.from(parts.v1), Buffer.from(expected));
}
Go
func VerifySignature(rawBody []byte, header, secret string) bool {
    var ts, sig string
    for _, part := range strings.Split(header, ",") {
        if k, v, ok := strings.Cut(strings.TrimSpace(part), "="); ok {
            if k == "t" { ts = v }
            if k == "v1" { sig = v }
        }
    }
    if ts == "" || sig == "" {
        return false
    }
    mac := hmac.New(sha256.New, []byte(secret))
    mac.Write([]byte(ts + "."))
    mac.Write(rawBody)
    expected := hex.EncodeToString(mac.Sum(nil))
    return hmac.Equal([]byte(sig), []byte(expected))
}
Python
import hashlib, hmac, time

def verify_signature(raw_body: bytes, header: str, secret: str) -> bool:
    parts = dict(item.split("=", 1) for item in header.split(",") if "=" in item)
    ts, sig = parts.get("t", ""), parts.get("v1", "")
    if not ts or not sig or abs(time.time() - int(ts)) > 300:
        return False
    expected = hmac.new(secret.encode(), f"{ts}.".encode() + raw_body, hashlib.sha256).hexdigest()
    return hmac.compare_digest(sig, expected)
PHP / Laravel
function verifyDynamicQRSignature(string $rawBody, string $header, string $secret): bool {
    $parts = [];
    foreach (explode(',', $header) as $pair) {
        [$k, $v] = array_pad(explode('=', trim($pair), 2), 2, '');
        $parts[$k] = $v;
    }
    if (empty($parts['t']) || empty($parts['v1']) || abs(time() - (int) $parts['t']) > 300) {
        return false;
    }
    $expected = hash_hmac('sha256', $parts['t'] . '.' . $rawBody, $secret);
    return hash_equals($expected, $parts['v1']);
}

Frequently Asked Questions

Can I test my webhook before printing QR codes?

Yes. Click Send test in /api-keys or call POST /api/v1/webhooks/{id}/test to send a live signed test event and inspect the HTTP status immediately.

Does DynamicQR block private IP webhook targets?

Yes. Webhooks require public HTTPS endpoints and block loopback, link-local, and private network ranges automatically.

Ready to ship dynamic QR codes?

Generate a Bearer API key in seconds and connect your backend, Zapier, or AI agent.

Create Free Account