Receive real-time payment success, failure, and pending notifications for Payment Links transactions — set up your webhook endpoint and verify the signature using your client secret.
When a customer pays via a Payment Link, PayU sends a webhook POST to your registered endpoint. Webhooks notify your server the moment a payment status changes.
Step 1: Register Your Webhook Endpoint
- Log in to the PayU Dashboard.
- Go to Settings → Webhooks.
- Enter your endpoint URL under Webhook URL and click Save.
Note:Your endpoint must be publicly accessible over HTTPS.
localhostand HTTP URLs will not receive webhooks.
If the Webhooks option is not visible in your Dashboard, contact your PayU account manager to have it enabled for your merchant account.
Step 2: Handle Incoming Webhook Events
PayU sends a POST request to your endpoint in the application/x-www-form-urlencoded format. Refer to the Webhook Events and Payloads page for webhook events and sample payloads.
Step 3: Verify the Webhook Signature
Note:Payment Links uses
client_secretfor hash verification. This is the sameclient_secretused to generate OAuth2 tokens (see Authentication). Using the wrong secret will cause every hash check to fail.
Hash Formula
Compute the expected hash using the reverse of the payment hash formula:
sha512(client_secret|status||||||udf5|udf4|udf3|udf2|udf1|email|firstname|productinfo|amount|txnid|key)Compare this to the hash field in the webhook payload. If they match, the webhook is authentic.
Errors and Troubleshooting
Hash Verification Keeps Failing
The most common cause is using the merchant salt instead of the client_secret. For Payment Links, hash verification uses client_secret.
Check:
- Are you using the correct
client_secret(the same one used to generate OAuth2 tokens)? - Are you URL-decoding the payload fields before building the hash string? Special characters in
productinfo,firstname, oremailthat aren't decoded will produce a wrong hash. - Are you trimming whitespace from all fields?
- Is the
amountfield used exactly as received — including decimal places (e.g.,500.00, not500)?
I am not Receiving the Webhook
- Is the webhook URL registered? Check Dashboard → Settings → Webhooks.
- Is the URL HTTPS and publicly reachable? Test with a tool like Webhook.site to confirm PayU can reach your server.
- Is your server behind a firewall? Whitelist PayU's IP addresses.
- Check webhook logs in the Dashboard under Developers → Webhook Logs for failed delivery attempts.
I Received a Webhook But the Status is Pending
pending means the payment is still being processed by the bank. Do not mark the order as paid yet. PayU will send a follow-up webhook when the status resolves to success or failure.
If the payment stays pending for more than a few hours, use the Fetch Payment Links API or the Verify Payment API to check the current status.
