Skip to main content

Webhook methods

All webhook-management methods are signed server-side operations.

Verify incoming webhooks

@coin-voyage/paykit/server also exports verifyWebhookSignature for the endpoint that receives deliveries. It takes the raw request body, the request headers, and your Webhook Secret, checks CoinVoyage-Webhook-Signature-V2 in constant time, and rejects deliveries whose CoinVoyage-Webhook-Timestamp is too far from the current time. It returns { valid: true, ... } or { valid: false, error: { code, message } } and never throws, so check result.valid. Pass the body exactly as received, before any JSON parsing. For a complete Route Handler, see Verify webhook signatures.

Order-scoped WebSocket subscriptions

subscribeOrderStatus() opens a WebSocket connection for real-time order events. Order-scoped subscriptions authenticate with your API key.

Organization-wide subscriptions

Organization-wide subscriptions require an authorization signature for GET /ws.
See the webhook event reference for event identifiers and payloads.