Prerequisites
- A publicly accessible HTTPS endpoint that accepts POST requests
- Your webhook signing secret from the dashboard (Settings → Webhooks)
@arcenpay/nodefor signature verification
Registering a webhook endpoint
- Go to Settings → Webhooks in the ArcenPay dashboard.
- Enter your endpoint URL (e.g.,
https://api.myapp.com/webhooks/arcenpay). - Copy the signing secret (
whsec_...). - Click Enable Webhooks.
Verifying signatures
Every webhook request includes anX-ArcenPay-Signature header with an HMAC-SHA256 hex digest. Always verify this signature before processing the payload:
Pass the raw header value directly —
verifyWebhookSignature handles stripping the sha256= prefix internally. Always verify the raw request body before JSON parsing.Event types
Handling events idempotently
Webhooks may be delivered more than once. Use the eventid field to deduplicate:
Retry behavior
ArcenPay retries failed webhook deliveries with exponential backoff. If your endpoint returns a non-2xx status or the request fails, the event is retried up to 5 times with delays of 1 second, 5 seconds, 30 seconds, 5 minutes, and 30 minutes before delivery is abandoned.Testing webhooks
Send a test event from the dashboard under Settings → Webhooks → Send Test.Rotating the signing secret
Rotate the webhook secret from Settings → Webhooks → Rotate Secret. The new secret takes effect immediately and signs all subsequent webhooks. If your handler needs time to transition, store the previous secret yourself and accept both signatures during the switchover:Next steps
- Webhooks SDK reference —
verifyWebhookSignatureand error handling - Subscriptions API — the endpoints that trigger webhook events
- Authentication — webhook signing secret and credential management

