A signature mismatch is almost never a problem with the hashing. It is the string being hashed — a re-serialised body, a missing pipe, an amount that arrived as 1499 and got compared as 1499.00. This shows you that string, which is the one thing no provider’s documentation prints.
Everything happens in this page. Your secret is never sent anywhere.
Paste the body exactly as received, byte for byte. Re-serialising parsed JSON is the most common cause of a mismatch: JSON.stringify can reorder keys and will turn 170.00 into 170.
Set when you created the webhook in the dashboard. Not your API key secret.
This is where the bug almost always is. Pipes are highlighted so you can count them.
Fill in the fields to see the string.
What these inputs should produce
—
Paste it to compare. Case is ignored for hex.
Transcribed from each provider’s own page, including the pipes. Four providers, four different schemes: two keyed HMACs with different output encodings, one plain salted digest, and one that does not sign the payload at all.
| Provider | What is signed | Formula | Header | Source |
|---|---|---|---|---|
| Razorpay | Webhook payload | hex( HMAC-SHA256( raw_request_body, webhook_secret ) ) | X-Razorpay-Signature | Validate and Test Webhooks (opens in a new tab) |
| Cashfree | Webhook payload | base64( HMAC-SHA256( x-webhook-timestamp + raw_request_body, secret_key ) ) | x-webhook-signature | Webhook Signature Verification (opens in a new tab) |
| PayU | Payment response (reverse hash) | sha512( SALT|status||||||udf5|udf4|udf3|udf2|udf1|email|firstname|productinfo|amount|txnid|key ) | hash (POST field, not a header) | Generate Hash (opens in a new tab) |
| PhonePe | Callback Authorization header | sha256( username:password ) | Authorization | Webhook Handling (opens in a new tab) |
Per provider, the things that actually break. These come from reading the documentation against itself, so several of them are places where a provider’s own pages disagree.
hmac-sha256 → hex
hmac-sha256 → base64
sha512 → hex
sha256 → hex
Each formula above links to the provider’s own page. Where their pages contradict each other we say so rather than picking the version that makes a tidier table — the methodology explains why that rule exists.
Part of OnlinePayment.in. Found a mistake? Tell us and we will fix it.