Use this endpoint to deactivate an existing payment link so it can no longer accept payments. You should pass the active parameter value as false permanently to cancel a link.
Delete
/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 --location --request DELETE 'https://uatoneapi.payu.in/payment-links/{{invoice_number}}' \
--header 'Authorization: Bearer {{access_token}}' \
--header 'merchantId: {{merchantId}}' \
--header 'Accept: application/json'using var client = new HttpClient();
var request = new HttpRequestMessage(
HttpMethod.Delete,
"https://uatoneapi.payu.in/payment-links/{{invoice_number}}"
);
request.Headers.Add("Authorization", "Bearer {{access_token}}");
request.Headers.Add("merchantId", "{{merchantId}}");
request.Headers.Add("Accept", "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/{{invoice_number}}"
headers = {
"Authorization": "Bearer {{access_token}}",
"merchantId": "{{merchantId}}",
"Accept": "application/json"
}
response = requests.delete(url, headers=headers)
print(response.text)const response = await fetch(
"https://uatoneapi.payu.in/payment-links/{{invoice_number}}",
{
method: "DELETE",
headers: {
"Authorization": "Bearer {{access_token}}",
"merchantId": "{{merchantId}}",
"Accept": "application/json"
}
}
);
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();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(
"https://uatoneapi.payu.in/payment-links/{{invoice_number}}"
))
.header("Authorization", "Bearer {{access_token}}")
.header("merchantId", "{{merchantId}}")
.header("Accept", "application/json")
.DELETE()
.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/{{invoice_number}}',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer {{access_token}}',
'merchantId: {{merchantId}}',
'Accept: application/json'
]
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;Refer to the Path Params and Headers sections for a full description of all 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.
