Resend the card OTP for a payment reference. On success the message is "OTP resent successfully".
Use this endpoint to resend the card OTP for a payment.
POST
/partner/resendCardOtp
Environment
| Environment | URL |
|---|---|
| Test Environment | https://test-partnerapilayer.payu.in/apilayer/partner/resendCardOtp |
| Production Environment | https://api.payu.in/partner/resendCardOtp |
Sample Request
curl -X POST https://test-partnerapilayer.payu.in/apilayer/partner/resendCardOtp \
-H "Content-Type: application/json" \
-H "Authorization: Bearer d4e5f6a7b8c90123456789abcdef0123456789abcdef0123456789abcdef0123" \
-d '{
"merchant_id": 8739528,
"reseller_id": "11ed-933c-ece48d50-a41d-023f883eb17c",
"hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"reference_id": "REFERENCE_ID"
}'import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class PartnerRequest {
public static void main(String[] args) throws Exception {
String body = "{\"merchant_id\": 8739528, \"reseller_id\": \"11ed-933c-ece48d50-a41d-023f883eb17c\", \"hash\": \"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\", \"reference_id\": \"REFERENCE_ID\"}";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://test-partnerapilayer.payu.in/apilayer/partner/resendCardOtp"))
.header("Content-Type", "application/json")
.header("Authorization", "Bearer d4e5f6a7b8c90123456789abcdef0123456789abcdef0123456789abcdef0123")
.method("POST", HttpRequest.BodyPublishers.ofString(body))
.build();
HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}import requests
url = "https://test-partnerapilayer.payu.in/apilayer/partner/resendCardOtp"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer d4e5f6a7b8c90123456789abcdef0123456789abcdef0123456789abcdef0123"
}
payload = {
"merchant_id": 8739528,
"reseller_id": "11ed-933c-ece48d50-a41d-023f883eb17c",
"hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"reference_id": "REFERENCE_ID"
}
response = requests.request("POST", url, headers=headers, json=payload)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://test-partnerapilayer.payu.in/apilayer/partner/resendCardOtp",
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\"merchant_id\": 8739528, \"reseller_id\": \"11ed-933c-ece48d50-a41d-023f883eb17c\", \"hash\": \"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\", \"reference_id\": \"REFERENCE_ID\"}",
CURLOPT_HTTPHEADER => ["Content-Type: application/json", "Authorization: Bearer d4e5f6a7b8c90123456789abcdef0123456789abcdef0123456789abcdef0123"],
CURLOPT_RETURNTRANSFER => true,
]);
echo curl_exec($curl);
curl_close($curl);const response = await fetch("https://test-partnerapilayer.payu.in/apilayer/partner/resendCardOtp", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer d4e5f6a7b8c90123456789abcdef0123456789abcdef0123456789abcdef0123"
},
body: JSON.stringify({
"merchant_id": 8739528,
"reseller_id": "11ed-933c-ece48d50-a41d-023f883eb17c",
"hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"reference_id": "REFERENCE_ID"
})
});
console.log(await response.text());using var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://test-partnerapilayer.payu.in/apilayer/partner/resendCardOtp");
request.Headers.TryAddWithoutValidation("Authorization", "Bearer d4e5f6a7b8c90123456789abcdef0123456789abcdef0123456789abcdef0123");
request.Content = new StringContent("{\"merchant_id\": 8739528, \"reseller_id\": \"11ed-933c-ece48d50-a41d-023f883eb17c\", \"hash\": \"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\", \"reference_id\": \"REFERENCE_ID\"}", System.Text.Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
Console.WriteLine(await response.Content.ReadAsStringAsync());require "net/http"
require "json"
uri = URI("https://test-partnerapilayer.payu.in/apilayer/partner/resendCardOtp")
request = Net::HTTP::Post.new(uri)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer d4e5f6a7b8c90123456789abcdef0123456789abcdef0123456789abcdef0123"
request.body = {"merchant_id": 8739528, "reseller_id": "11ed-933c-ece48d50-a41d-023f883eb17c", "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "reference_id": "REFERENCE_ID"}.to_json
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(request) }
puts response.body
Mandatory ParametersParameters marked with * are mandatory.
| Parameter | Description |
|---|---|
Content-Type* | string Send the body as application/json. |
Authorization* | string Partner access token. Send as Authorization Bearer token. |
merchant_id* | integer Merchant id. |
reseller_id* | string Reseller id. |
hash* | string Hash. |
reference_id* | string Reference id. |
Sample Response
{
"status": "success",
"message": "OTP resent successfully",
"attemptsLeft": 2,
"isSupported": true
}| Parameter | Description |
|---|---|
status | success when the OTP is resent. |
message | OTP resent successfully. |
attemptsLeft | Attempts left after the resend. |
isSupported | Returned with the resend result. The sample value is true. |
Errors
Below are the failure scenarios.
reference_id is mandatory
{
"errors": [
"reference_id is mandatory."
]
}Reason: This error occurs when reference_id is not included in the request.
Recommended Fix: Include the reference_id parameter in the request and retry.
Invalid Auth token
{
"error": "Invalid Auth token"
}Reason: This error occurs when the auth token is missing or invalid.
Recommended Fix: Generate a new auth token and send it in the Authorization header.
