Skip to content
Webhooks and errors

How do I verify a webhook signature?

Recalculate the signature with your signing secret and compare it with the one in the X-Webhook-Signature header. Process the event only if they match.

  1. Take the X-Webhook-Timestamp header, a full stop and the raw request body, exactly as received.
  2. Calculate an HMAC of that text with your signing secret, using the algorithm in the webhooks guide.
  3. Compare your result with the value in X-Webhook-Signature using a constant-time comparison.
  4. Reject the request if the timestamp is too far from your server's time.

Use the raw body: if you parse and re-serialise the JSON first, the signature won't match. Details and code samples are in the webhooks guide.

Was this helpful?

Contact

Still stuck?

Talk to a person. We'll never ask for your passcode, one-time codes or full card details.

PEXX API

Start with the docs

Guides and the API reference are at docs.pexx.com. For your integration, email us with your business name and the request or payout reference.