PayU's payment links API uses OAuth2 Bearer tokens rather than simple API keys. This guide covers the two-step process: getting a token, then creating a payment link, and sending it to a customer on WhatsApp.
PayU is one of India's most established payment gateways, processing a large share of domestic e-commerce transactions. Its newer REST API for payment links uses a standard OAuth2 token flow, which adds one step compared to Razorpay or Cashfree but is a well-understood pattern.
New to the External API Request step? Read the foundation guide first.
PayU's payment links API requires a Bearer token, not a static API key. That means you first call a token endpoint to get an access_token, then use that token in the payment link creation call. Many automation builders chain these as two sequential External API Request steps.
For the current token endpoint URL, scopes, and payment link parameters: docs.payu.in/reference/create-payment-links.
Once you have the access_token from step 1, use it in this step to create the payment link.
| Environment | Base URL |
|---|---|
| UAT (testing) | https://uatoneapi.payu.in/payment-links |
| Production (live) | https://info.payu.in/payment-links |
| Header | Value |
|---|---|
| Authorization | Bearer YOUR_ACCESS_TOKEN (from the token step) |
| merchantId | Your PayU Merchant ID |
| Content-Type | application/json |
{
"subAmount": 500,
"isPartialPaymentAllowed": false,
"description": "Payment for Order #{{order_id}}",
"source": "API",
"currency": "INR",
"customer": {
"name": "{{customer_name}}",
"phone": "{{customer_phone}}",
"email": "{{customer_email}}"
}
}subAmount is the payment amount in rupees (not paise). The response contains the payment link URL which you send to the customer on WhatsApp.
| Symptom | Likely cause | Fix |
|---|---|---|
| 401 Unauthorized | Expired or invalid access token | Call the token endpoint again to get a fresh token; tokens expire |
| 403 Forbidden | Wrong merchantId header | Confirm the merchantId matches the account that issued the token |
| 422 Unprocessable | Missing required body field | Ensure subAmount, description, and source are all present |
| UAT link not working on a phone | UAT links only work in test mode | Expected; use production endpoint and live credentials for real payments |
| Token expired mid-flow | Token TTL exceeded | Build a token refresh step at the start of your flow or cache the token with its expiry time |
Basic Auth, simpler setup, payment links with short_url.
Read guide →Custom headers, strong UPI support.
Read guide →Foundation guide.
Read guide →Automate follow-up on unpaid links.
Read guide →Send UPI payment requests directly.
Read guide →All connection guides.
Browse all →Free trial, no credit card required. And if you ever get stuck, we are the only platform in India that answers you live on WhatsApp.