Skip to main content
Webhooks let ArcenPay push real-time billing events to your server. When a subscription renews, a plan changes, or a payment completes, ArcenPay sends a signed HTTP POST to your registered endpoint.

Prerequisites

  • A publicly accessible HTTPS endpoint that accepts POST requests
  • Your webhook signing secret from the dashboard (Settings → Webhooks)
  • @arcenpay/node for signature verification

Registering a webhook endpoint

  1. Go to Settings → Webhooks in the ArcenPay dashboard.
  2. Enter your endpoint URL (e.g., https://api.myapp.com/webhooks/arcenpay).
  3. Copy the signing secret (whsec_...).
  4. Click Enable Webhooks.

Verifying signatures

Every webhook request includes an X-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 event id 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

Last modified on September 9, 2026