Skip to main content
PayBridgeNP signs every webhook delivery with an HMAC-SHA256 signature. You should always verify this signature before processing an event - otherwise anyone could send fake payment notifications to your endpoint.

Signature format

Every webhook request includes an X-PayBridgeNP-Signature header:

Verifying with the SDK

The easiest way is PayBridgeNP.webhooks.constructEvent() - it handles signature parsing, HMAC comparison, and replay attack protection (rejects events older than 5 minutes).

Verifying manually (without the SDK)

If you’re not using the TypeScript SDK:
Python
PHP

Important: use the raw request body

The HMAC is computed over the raw request body string. If you parse the JSON first (e.g. with express.json() middleware) and then re-serialize it, the string may differ and signature verification will fail. Always read the body as a string before passing it to constructEvent.

Webhook event payload

customer_address is present when the checkout session or payment link had collectAddress: true. It is null otherwise. livemode is true when the event was generated by a live (sk_live_) key and false for sandbox (sk_test_). Branch on it in your handler to avoid processing a sandbox event as a real payment, especially when the same handler URL serves both modes.

Event types

This list is not exhaustive - billing, subscription, coupon, and dunning events fire too. See the billing, coupons, and dunning guides for those event types.

Retry schedule

If your endpoint returns a non-2xx status or times out, PayBridgeNP retries with exponential backoff: After 5 failed attempts the delivery is marked as permanently failed. You can see all delivery attempts and their response codes in the Webhooks → delivery log in your dashboard.

Testing webhooks locally

Your webhook endpoint must be publicly reachable. For local development, use a tunnel:
Use the public URL as your webhook endpoint in the dashboard during development.

Inspecting payloads in the browser

Want to sanity-check your HMAC implementation without running any server code? Use the Webhook Debugger - paste your signing secret, the raw request body, and the X-PayBridgeNP-Signature header, and it tells you whether the signature would verify and why.