Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

payfit-webhooks

БесплатноЗапускает вложенные скриптыНе проверен

Receive and verify PayFit webhooks (partner API, delivered by Svix). Use when requesting webhook access from PayFit, opening the webhooks dashboard through…

hookdeckот hookdeck★ 104 звезды на GitHub

Об этом скилле

PayFit Webhooks

PayFit (European payroll and HR) notifies partner integrations when key events happen for their client companies: an integration is activated or deactivated, or a payroll is run. Webhooks are partner-only and enabled on request: once PayFit sets you up, GET https://oauth.payfit.com/webhooks?clientSecret=…&clientId=… returns a webhookConfigUrl that opens your webhooks dashboard, where you add endpoints and choose events.

PayFit delivers through Svix. Its event catalogue is a Svix-hosted page for PayFit's Svix organization, which points to Svix's guide for consuming webhooks. PayFit's own docs don't mention headers or signing.

When to Use This Skill

  • How do I receive PayFit webhooks?
  • How do I verify a PayFit webhook signature? (Svix: svix-id, svix-timestamp, svix-signature)
  • Where do I find the PayFit webhook signing secret? (the webhookConfigUrl dashboard)
  • Why does my PayFit signature never match? (usually: the whsec_ secret wasn't base64-decoded, or the body was re-serialised)
  • How do I handle payroll.run?

Verification (core)

Header Value
svix-id Unique message ID: dedupe on it
svix-timestamp Seconds since epoch
svix-signature Space-separated v1,<base64 HMAC-SHA256> entries

Signed content is {svix-id}.{svix-timestamp}.{raw body}. The key is the endpoint's signing secret with the whsec_ prefix removed, base64-decoded.

const crypto = require('crypto');

function verifyPayfitWebhook(rawBody, headers, secret) {   // rawBody: exact bytes
  const id = headers['svix-id'], timestamp = headers['svix-timestamp'], signatures = headers['svix-signature'];
  if (!secret || !id || !timestamp || !signatures) return false;
  const key = Buffer.from(secret.replace(/^whsec_/, ''), 'base64');   // decode, don't use the string
  const expected = crypto.createHmac('sha256', key).update(`${id}.${timestamp}.`).update(rawBody).digest();
  return signatures.trim().split(/\s+/).some((entry) => {
    const [version, signature] = entry.split(',');
    if (version !== 'v1' || !signature) return false;
    const given = Buffer.from(signature, 'base64');
    return given.length === expected.length && crypto.timingSafeEqual(given, expected);
  });
}
  • Decode the secret. Keying the HMAC with the whsec_… string as text never matches. The examples check the secret is canonical base64 and return 500 if it isn't.
  • Check every v1 entry. During a secret rotation the header carries one signature per secret.
  • Timestamp. Svix's guide says to compare svix-timestamp with your clock "within your tolerance" (Svix's libraries use 5 minutes). The examples make the window optional (PAYFIT_WEBHOOK_TOLERANCE_SECONDS, off by default), because a delivery replayed later (from your queue, or Svix's Recover Failed) keeps its original timestamp. Dedupe on svix-id either way.
  • Bad or missing signature: 401. Secret not set or not base64: 500.

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

The official svix packages (Node, Python and others) do the same check with new Webhook(secret).verify(payload, headers). See references/verification.md.

Hookdeck: the PayFit source type (PAYFIT) verifies the Svix headers with the whsec_… signing secret from the PayFit webhooks dashboard.

Payload

Every body is { type, data }:

{ "type": "payroll.run", "data": { "companyId": "602e441f3e724b4d74a9cc87", "effectiveDate": "2023-01-30T13:02:33+00:00", "payrollMonth": "202301" } }

Event Types

Event Fired when data
integration.activated A client activates your integration companyId, effectiveDate
integration.deactivated A client deactivates your integration companyId, effectiveDate
payroll.run A client runs a payroll companyId, effectiveDate, payrollMonth (YYYYMM)

PayFit says more employee lifecycle events will be added. Treat unknown types as no-ops. See references/overview.md.

Environment Variables

PAYFIT_WEBHOOK_SECRET=whsec_...          # endpoint signing secret from the webhookConfigUrl dashboard
PAYFIT_WEBHOOK_TOLERANCE_SECONDS=        # optional timestamp window, off when empty

Local Development

# Express / Next.js (use 8000 for FastAPI). No install or account required.
npx hookdeck-cli listen 3000 payfit --path /webhooks/payfit

Add the printed URL as an endpoint in the webhooks dashboard, copy its signing secret, and send a test event from the dashboard. See references/setup.md.

Reference Materials

Полный SKILL.md на GitHub

Установить payfit-webhooks в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

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/payfit/route.tsexamples/nextjs/lib/verify-payfit.tsexamples/nextjs/package.jsonexamples/nextjs/vitest.config.tsreferences/overview.mdreferences/setup.mdreferences/verification.md

FAQ

Что делает скилл payfit-webhooks?

Receive and verify PayFit webhooks (partner API, delivered by Svix). Use when requesting webhook access from PayFit, opening the webhooks dashboard through webhookConfigUrl, verifying the svix-id, svix-timestamp and svix-signature headers (base64 HMAC-SHA256 keyed with the base64-decoded whsec_ signing secret), debugging signature mismatches, or handling integration.activated, integration.deactivated and payroll.run events.

Как установить скилл payfit-webhooks?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл payfit-webhooks запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить payfit-webhooks с