Stored in this browser only. The samples below fill in as you type; only "Try It" sends them, to sign a read request.
KEY_ID="pk_live_your_key_id"
SECRET="sk_live_your_signing_secret"
P='/ext/v1/aeps/cash-deposit'
QUERY=''
BODY='{ "merchant_ref": "OUTLET-1001", "client_reference": "CD-2026-000127", "tpin": "1234", "aadhaar": "987698769870", "bank_iin": "607094", "amount": 3000, "pid_data": "<PidData>... the XML the RD service returned ...</PidData>", "latitude": 25.5941, "longitude": 85.1376 }'
TS=$(date +%s)
NONCE=$(openssl rand -hex 16)
HASH=$(printf %s "$BODY" | openssl dgst -sha256 | awk '{print $NF}')
SIG=$(printf 'POC1\n%s\n%s\n%s\n%s\n%s\n%s' 'POST' "$P" "$QUERY" "$TS" "$NONCE" "$HASH" \
| openssl dgst -sha256 -hmac "$SECRET" | awk '{print $NF}')
curl -X POST "https://payonclick.in$P" \
-H "X-Api-Key-Id: $KEY_ID" \
-H "X-Timestamp: $TS" \
-H "X-Nonce: $NONCE" \
-H "X-Signature: $SIG" \
-H 'Content-Type: application/json' \
-d "$BODY"
import hashlib, hmac, json, secrets, time, requests
KEY_ID = "pk_live_your_key_id"
SECRET = "sk_live_your_signing_secret"
PATH = "/ext/v1/aeps/cash-deposit"
QUERY = ""
BODY = json.dumps({
"merchant_ref": "OUTLET-1001",
"client_reference": "CD-2026-000127",
"tpin": "1234",
"aadhaar": "987698769870",
"bank_iin": "607094",
"amount": 3000,
"pid_data": "<PidData>... the XML the RD service returned ...</PidData>",
"latitude": 25.5941,
"longitude": 85.1376
}).encode()
ts = str(int(time.time()))
nonce = secrets.token_hex(16)
msg = "\n".join(["POC1", "POST", PATH, QUERY, ts, nonce,
hashlib.sha256(BODY).hexdigest()])
sig = hmac.new(SECRET.encode(), msg.encode(), hashlib.sha256).hexdigest()
r = requests.request(
"POST", "https://payonclick.in" + PATH + ("?" + QUERY if QUERY else ""), data=BODY,
headers={
"X-Api-Key-Id": KEY_ID,
"X-Timestamp": ts,
"X-Nonce": nonce,
"X-Signature": sig,
"Content-Type": "application/json",
}, timeout=90)
print(r.json())
const crypto = require('crypto');
const KEY_ID = 'pk_live_your_key_id';
const SECRET = 'sk_live_your_signing_secret';
const path = '/ext/v1/aeps/cash-deposit';
const query = '';
const body = JSON.stringify({ "merchant_ref": "OUTLET-1001", "client_reference": "CD-2026-000127", "tpin": "1234", "aadhaar": "987698769870", "bank_iin": "607094", "amount": 3000, "pid_data": "<PidData>... the XML the RD service returned ...</PidData>", "latitude": 25.5941, "longitude": 85.1376 });
const ts = Math.floor(Date.now() / 1000).toString();
const nonce = crypto.randomBytes(16).toString('hex');
const hash = crypto.createHash('sha256').update(body).digest('hex');
const msg = ['POC1', 'POST', path, query, ts, nonce, hash].join('\n');
const sig = crypto.createHmac('sha256', SECRET).update(msg).digest('hex');
async function main() {
const res = await fetch('https://payonclick.in' + path + (query ? '?' + query : ''), {
method: 'POST',
headers: {
'X-Api-Key-Id': KEY_ID,
'X-Timestamp': ts,
'X-Nonce': nonce,
'X-Signature': sig,
'Content-Type': 'application/json',
},
body,
signal: AbortSignal.timeout(90000),
});
console.log(JSON.stringify(await res.json(), null, 2));
}
main();
<?php
$keyId = 'pk_live_your_key_id';
$secret = 'sk_live_your_signing_secret';
$path = '/ext/v1/aeps/cash-deposit';
$query = '';
$body = '{ "merchant_ref": "OUTLET-1001", "client_reference": "CD-2026-000127", "tpin": "1234", "aadhaar": "987698769870", "bank_iin": "607094", "amount": 3000, "pid_data": "<PidData>... the XML the RD service returned ...</PidData>", "latitude": 25.5941, "longitude": 85.1376 }';
$ts = (string) time();
$nonce = bin2hex(random_bytes(16));
$msg = implode("\n", ['POC1', 'POST', $path, $query, $ts, $nonce, hash('sha256', $body)]);
$sig = hash_hmac('sha256', $msg, $secret);
$headers = [
"X-Api-Key-Id: {$keyId}",
"X-Timestamp: {$ts}",
"X-Nonce: {$nonce}",
"X-Signature: {$sig}",
'Content-Type: application/json',
];
$ch = curl_init('https://payonclick.in' . $path . ($query !== '' ? '?' . $query : ''));
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 90,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => $body,
CURLOPT_HTTPHEADER => $headers,
]);
echo curl_exec($ch);
import java.net.URI;
import java.net.http.*;
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import java.security.SecureRandom;
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
public class PayonclickExample {
static final String HOST = "https://payonclick.in";
static final String KEY_ID = "pk_live_your_key_id";
static final String SECRET = "sk_live_your_signing_secret";
public static void main(String[] args) throws Exception {
String path = "/ext/v1/aeps/cash-deposit";
String query = "";
String body = "{ \"merchant_ref\": \"OUTLET-1001\", \"client_reference\": \"CD-2026-000127\", \"tpin\": \"1234\", \"aadhaar\": \"987698769870\", \"bank_iin\": \"607094\", \"amount\": 3000, \"pid_data\": \"<PidData>... the XML the RD service returned ...</PidData>\", \"latitude\": 25.5941, \"longitude\": 85.1376 }";
String ts = String.valueOf(System.currentTimeMillis() / 1000);
byte[] rnd = new byte[16];
new SecureRandom().nextBytes(rnd);
String nonce = hex(rnd);
String hash = hex(MessageDigest.getInstance("SHA-256")
.digest(body.getBytes(StandardCharsets.UTF_8)));
String msg = String.join("\n", "POC1", "POST", path, query, ts, nonce, hash);
Mac mac = Mac.getInstance("HmacSHA256");
mac.init(new SecretKeySpec(SECRET.getBytes(StandardCharsets.UTF_8), "HmacSHA256"));
String sig = hex(mac.doFinal(msg.getBytes(StandardCharsets.UTF_8)));
HttpRequest.Builder req = HttpRequest.newBuilder(
URI.create(HOST + path + (query.isEmpty() ? "" : "?" + query)))
.timeout(java.time.Duration.ofSeconds(90))
.header("X-Api-Key-Id", KEY_ID)
.header("X-Timestamp", ts)
.header("X-Nonce", nonce)
.header("X-Signature", sig);
req.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString(
body, StandardCharsets.UTF_8));
HttpResponse<String> res = HttpClient.newHttpClient()
.send(req.build(), HttpResponse.BodyHandlers.ofString());
System.out.println(res.body());
}
static String hex(byte[] bytes) {
StringBuilder sb = new StringBuilder();
for (byte b : bytes) sb.append(String.format("%02x", b));
return sb.toString();
}
}