Use this endpoint to modify the configuration of an existing active payment link.
Only send the fields you want to change. Your omitted fields retain their current values.
RestrictionsYou cannot:
- Update a cancelled link (
active: false).- Update a link that has been fully paid.
- Reduce
subAmountbelow the amount already collected on a partial payment link.
PUT
/payment-links/{invoiceNumber}
Environments
| Environment | URL |
|---|---|
| Test Environment | https://uatoneapi.payu.in |
| Production Environment | https://oneapi.payu.in |
Get your Bearer token before calling this endpointThis API uses OAuth 2.0 authentication.
- Call the Generate an Access Token token with
grant_type=client_credentialsandscope=create_payment_links- Copy the
access_tokenfrom the response- Pass it as
Authorization: Bearer {access_token}in every requestToken Expiry: Check
expires_inin the token response and refresh before it lapses.
Sample Request
curl -X POST "https://uatoneapi.payu.in/payment-links" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "merchantId: YOUR_MERCHANT_ID" \
-H "Content-Type: application/json" \
-d '{
"subAmount": 2000,
"description": "Update link testing",
"expiryDate": "2026-11-30 23:59:59",
"isPartialPaymentAllowed": true,
"minAmountForCustomer": 500,
"viaEmail": true,
"viaSms": true,
"viaWhatsapp": true
}'using System.Net.Http;
using System.Text;
using var client = new HttpClient();
var request = new HttpRequestMessage(
HttpMethod.Post,
"https://uatoneapi.payu.in/payment-links"
);
request.Headers.Add("Authorization", "Bearer YOUR_ACCESS_TOKEN");
request.Headers.Add("merchantId", "YOUR_MERCHANT_ID");
request.Content = new StringContent(
"""
{
"subAmount": 2000,
"description": "Update link testing",
"expiryDate": "2026-11-30 23:59:59",
"isPartialPaymentAllowed": true,
"minAmountForCustomer": 500,
"viaEmail": true,
"viaSms": true,
"viaWhatsapp": true
}
""",
Encoding.UTF8,
"application/json"
);
var response = await client.SendAsync(request);
var responseBody = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseBody);import requests
url = "https://uatoneapi.payu.in/payment-links"
headers = {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"merchantId": "YOUR_MERCHANT_ID",
"Content-Type": "application/json"
}
payload = {
"subAmount": 2000,
"description": "Update link testing",
"expiryDate": "2026-11-30 23:59:59",
"isPartialPaymentAllowed": True,
"minAmountForCustomer": 500,
"viaEmail": True,
"viaSms": True,
"viaWhatsapp": True
}
response = requests.post(url, headers=headers, json=payload)
print(response.text)const response = await fetch(
"https://uatoneapi.payu.in/payment-links",
{
method: "POST",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"merchantId": "YOUR_MERCHANT_ID",
"Content-Type": "application/json"
},
body: JSON.stringify({
subAmount: 2000,
description: "Update link testing",
expiryDate: "2026-11-30 23:59:59",
isPartialPaymentAllowed: true,
minAmountForCustomer: 500,
viaEmail: true,
viaSms: true,
viaWhatsapp: true
})
}
);
const responseBody = await response.text();
console.log(responseBody);import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
HttpClient client = HttpClient.newHttpClient();
String jsonBody = """
{
"subAmount": 2000,
"description": "Update link testing",
"expiryDate": "2026-11-30 23:59:59",
"isPartialPaymentAllowed": true,
"minAmountForCustomer": 500,
"viaEmail": true,
"viaSms": true,
"viaWhatsapp": true
}
""";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://uatoneapi.payu.in/payment-links"))
.header("Authorization", "Bearer YOUR_ACCESS_TOKEN")
.header("merchantId", "YOUR_MERCHANT_ID")
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(jsonBody))
.build();
HttpResponse<String> response = client.send(
request,
HttpResponse.BodyHandlers.ofString()
);
System.out.println(response.body());<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://uatoneapi.payu.in/payment-links',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer YOUR_ACCESS_TOKEN',
'merchantId: YOUR_MERCHANT_ID',
'Content-Type: application/json'
],
CURLOPT_POSTFIELDS => json_encode([
'subAmount' => 2000,
'description' => 'Update link testing',
'expiryDate' => '2026-11-30 23:59:59',
'isPartialPaymentAllowed' => true,
'minAmountForCustomer' => 500,
'viaEmail' => true,
'viaSms' => true,
'viaWhatsapp' => true
])
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;Refer to the Path Params, Headers, and Body Params sections for a full description of all request parameters and use cases.
Sample Response
{
"status": 0,
"message": "string",
"result": {},
"errorCode": 170,
"guid": "f529e375-739f-4c8a-b5f5-0e67fa3f533f"
}{
"status": -1,
"message": "expiry cannot be less than the current date",
"result": null,
"errorCode": null,
"guid": null
}Refer to the Response section for a full description of all response fields.
