violet-webhooks
БесплатноЗапускает вложенные скриптыНе проверенReceive and verify Violet webhooks. Use when setting up Violet (violet.io) webhook handlers, debugging X-Violet-Hmac signature verification, or handling…
от hookdeck★ 104 звезды на GitHubОб этом скилле
Violet Webhooks
When to Use This Skill
- How do I receive Violet webhooks?
- How do I verify the
X-Violet-Hmacsignature on a Violet webhook? - Why is my Violet webhook signature verification failing?
- How do I handle ORDER_COMPLETED, ORDER_SHIPPED, MERCHANT_CONNECTED or TRANSFER_SENT events?
- Why did Violet pause or disable my webhook?
Verification (core)
Violet sends X-Violet-Hmac: <base64>: the standard, padded base64 of the HMAC-SHA256 of the raw request body bytes, keyed with your app secret (the same secret you use for API calls) used as UTF-8 — not hex- or base64-decoded. Nothing else is signed (no timestamp or id), and the value has no prefix. Check the header's format, then compare the whole value in constant time.
Node:
const crypto = require('crypto');
function verifyVioletSignature(rawBody, header, secret) {
// 44 chars of padded base64: validate before comparing (never Buffer.from(header, 'base64'))
if (typeof header !== 'string' || !/^[A-Za-z0-9+/]{43}=$/.test(header)) return false;
const expected = Buffer.from(crypto.createHmac('sha256', secret).update(rawBody).digest('base64'));
const received = Buffer.from(header);
return received.length === expected.length && crypto.timingSafeEqual(received, expected);
}
Python:
import base64, hashlib, hmac, re
def verify_violet_signature(raw_body: bytes, header: str | None, secret: str) -> bool:
if not header or not re.fullmatch(r"[A-Za-z0-9+/]{43}=", header, re.ASCII):
return False
digest = hmac.new(secret.encode("utf-8"), raw_body, hashlib.sha256).digest()
return hmac.compare_digest(header.encode("ascii"), base64.b64encode(digest))
Respond 401 when the header is missing, malformed, or doesn't match. Compare the base64 string exactly: a value whose last character carries stray low bits decodes to the same bytes but is not what Violet sends.
For complete handlers with route wiring, event dispatch, and tests, see:
- examples/express/ (use
express.raw({ type: '*/*' })so the exact bytes are verified for any content type)- examples/nextjs/ (
await request.arrayBuffer())- examples/fastapi/ (
await request.body())
Dispatch on X-Violet-Topic
The body is usually the entity itself (a full Order, an Offer, a PayoutAccount, a transfer...) with no event field, and all ORDER_* events send an Order. Recovery case bodies are the exception and carry event and event_key. Route on the X-Violet-Topic header, which every delivery carries; most requests can't be classified without it.
Violet's docs spell the cancellation topic two ways: ORDER_CANCELLED on the events pages and ORDER_CANCELED in the API's event enum and the Orders page's ORDER_UPDATED text. Accept both. Parse the body only after verification, and treat every field as untrusted (check types before reading into it).
Common Event Types (Topics)
| Topic | Description |
|---|---|
ORDER_ACCEPTED |
Order accepted |
ORDER_UPDATED |
Order changed |
ORDER_COMPLETED |
Order completed |
ORDER_SHIPPED |
Order shipped |
ORDER_DELIVERED |
Order delivered |
ORDER_REFUNDED |
Order refunded |
ORDER_CANCELLED / ORDER_CANCELED |
Order cancelled (the docs use both spellings) |
ORDER_FAILED |
Order failed |
MERCHANT_CONNECTED |
Merchant connected to your app |
MERCHANT_DISCONNECTED |
Merchant disconnected |
MERCHANT_ENABLED / MERCHANT_DISABLED |
Merchant enabled or disabled |
MERCHANT_NEEDS_ATTENTION |
Merchant health check needs attention |
OFFER_ADDED / OFFER_UPDATED / OFFER_REMOVED / OFFER_DELETED |
Offer availability and changes |
PRODUCT_SYNC_COMPLETED / PRODUCT_SYNC_FAILED |
Catalog sync results |
TRANSFER_SENT / TRANSFER_FAILED / TRANSFER_REVERSED |
Payouts to merchants |
PAYMENT_TRANSACTION_DISPUTE_OPENED / ORDER_DISPUTED |
Chargebacks |
For the full list of 56 events, see references/overview.md and the Violet webhook events docs.
Delivery and Retries
- Respond 2XX within 10 seconds; queue the work and process it afterwards
- A failed event is retried 10 times with back-off over 24 hours, then marked
FAILED - More than 50 failures in 30 minutes pauses the webhook for 1 hour, then 3 hours, then up to 24 hours; if it still fails after three pauses the webhook is
DISABLEDuntil you re-activate it - Violet's docs name
X-Violet-Event-Idfor idempotency. A resend carries the original ID inX-Violet-Event-Id-Source, so dedupe on that when present - Recovery case events can be redelivered under a different
X-Violet-Event-Id: dedupe them onX-Violet-Recovery-Event-Key(the body'sevent_key) - For recovery case events, Violet treats a 4xx response as final and doesn't retry it. Return a 5xx when you want a retry
Environment Va
Установить violet-webhooks в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл violet-webhooks?
Receive and verify Violet webhooks. Use when setting up Violet (violet.io) webhook handlers, debugging X-Violet-Hmac signature verification, or handling events like ORDER_COMPLETED, ORDER_SHIPPED, MERCHANT_CONNECTED, or TRANSFER_SENT.
Как установить скилл violet-webhooks?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл violet-webhooks запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic