curl --request POST \
--url https://sandbox.cashfree.com/verification/form \
--header 'Content-Type: application/json' \
--header 'x-client-id: <api-key>' \
--header 'x-client-secret: <api-key>' \
--data '
{
"phone": "9999999999",
"template_name": "Aadhaar_verification",
"verification_id": "ABC00123",
"name": "John Doe",
"email": "test@cashfree.com",
"link_expiry": "2025-06-01",
"notification_types": [
"sms"
]
}
'import requests
url = "https://sandbox.cashfree.com/verification/form"
payload = {
"phone": "9999999999",
"template_name": "Aadhaar_verification",
"verification_id": "ABC00123",
"name": "John Doe",
"email": "test@cashfree.com",
"link_expiry": "2025-06-01",
"notification_types": ["sms"]
}
headers = {
"x-client-id": "<api-key>",
"x-client-secret": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-client-id': '<api-key>',
'x-client-secret': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
phone: '9999999999',
template_name: 'Aadhaar_verification',
verification_id: 'ABC00123',
name: 'John Doe',
email: 'test@cashfree.com',
link_expiry: '2025-06-01',
notification_types: ['sms']
})
};
fetch('https://sandbox.cashfree.com/verification/form', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandbox.cashfree.com/verification/form",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'phone' => '9999999999',
'template_name' => 'Aadhaar_verification',
'verification_id' => 'ABC00123',
'name' => 'John Doe',
'email' => 'test@cashfree.com',
'link_expiry' => '2025-06-01',
'notification_types' => [
'sms'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-client-id: <api-key>",
"x-client-secret: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandbox.cashfree.com/verification/form"
payload := strings.NewReader("{\n \"phone\": \"9999999999\",\n \"template_name\": \"Aadhaar_verification\",\n \"verification_id\": \"ABC00123\",\n \"name\": \"John Doe\",\n \"email\": \"test@cashfree.com\",\n \"link_expiry\": \"2025-06-01\",\n \"notification_types\": [\n \"sms\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-client-id", "<api-key>")
req.Header.Add("x-client-secret", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://sandbox.cashfree.com/verification/form")
.header("x-client-id", "<api-key>")
.header("x-client-secret", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"phone\": \"9999999999\",\n \"template_name\": \"Aadhaar_verification\",\n \"verification_id\": \"ABC00123\",\n \"name\": \"John Doe\",\n \"email\": \"test@cashfree.com\",\n \"link_expiry\": \"2025-06-01\",\n \"notification_types\": [\n \"sms\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.cashfree.com/verification/form")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-client-id"] = '<api-key>'
request["x-client-secret"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"phone\": \"9999999999\",\n \"template_name\": \"Aadhaar_verification\",\n \"verification_id\": \"ABC00123\",\n \"name\": \"John Doe\",\n \"email\": \"test@cashfree.com\",\n \"link_expiry\": \"2025-06-01\",\n \"notification_types\": [\n \"sms\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"name": "John Doe",
"phone": "9999999999",
"email": "test@cashfree.com",
"verification_id": "ABC00123",
"reference_id": 235461,
"form_link": "https://forms-test.cashfree.com/verification/Y7tpcan5ksm0",
"form_status": "RECEIVED"
}Generate KYC Link
Use this API to generate a verification form to verify the KYC information of your users digitally.
curl --request POST \
--url https://sandbox.cashfree.com/verification/form \
--header 'Content-Type: application/json' \
--header 'x-client-id: <api-key>' \
--header 'x-client-secret: <api-key>' \
--data '
{
"phone": "9999999999",
"template_name": "Aadhaar_verification",
"verification_id": "ABC00123",
"name": "John Doe",
"email": "test@cashfree.com",
"link_expiry": "2025-06-01",
"notification_types": [
"sms"
]
}
'import requests
url = "https://sandbox.cashfree.com/verification/form"
payload = {
"phone": "9999999999",
"template_name": "Aadhaar_verification",
"verification_id": "ABC00123",
"name": "John Doe",
"email": "test@cashfree.com",
"link_expiry": "2025-06-01",
"notification_types": ["sms"]
}
headers = {
"x-client-id": "<api-key>",
"x-client-secret": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-client-id': '<api-key>',
'x-client-secret': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
phone: '9999999999',
template_name: 'Aadhaar_verification',
verification_id: 'ABC00123',
name: 'John Doe',
email: 'test@cashfree.com',
link_expiry: '2025-06-01',
notification_types: ['sms']
})
};
fetch('https://sandbox.cashfree.com/verification/form', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandbox.cashfree.com/verification/form",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'phone' => '9999999999',
'template_name' => 'Aadhaar_verification',
'verification_id' => 'ABC00123',
'name' => 'John Doe',
'email' => 'test@cashfree.com',
'link_expiry' => '2025-06-01',
'notification_types' => [
'sms'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-client-id: <api-key>",
"x-client-secret: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandbox.cashfree.com/verification/form"
payload := strings.NewReader("{\n \"phone\": \"9999999999\",\n \"template_name\": \"Aadhaar_verification\",\n \"verification_id\": \"ABC00123\",\n \"name\": \"John Doe\",\n \"email\": \"test@cashfree.com\",\n \"link_expiry\": \"2025-06-01\",\n \"notification_types\": [\n \"sms\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-client-id", "<api-key>")
req.Header.Add("x-client-secret", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://sandbox.cashfree.com/verification/form")
.header("x-client-id", "<api-key>")
.header("x-client-secret", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"phone\": \"9999999999\",\n \"template_name\": \"Aadhaar_verification\",\n \"verification_id\": \"ABC00123\",\n \"name\": \"John Doe\",\n \"email\": \"test@cashfree.com\",\n \"link_expiry\": \"2025-06-01\",\n \"notification_types\": [\n \"sms\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.cashfree.com/verification/form")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-client-id"] = '<api-key>'
request["x-client-secret"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"phone\": \"9999999999\",\n \"template_name\": \"Aadhaar_verification\",\n \"verification_id\": \"ABC00123\",\n \"name\": \"John Doe\",\n \"email\": \"test@cashfree.com\",\n \"link_expiry\": \"2025-06-01\",\n \"notification_types\": [\n \"sms\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"name": "John Doe",
"phone": "9999999999",
"email": "test@cashfree.com",
"verification_id": "ABC00123",
"reference_id": 235461,
"form_link": "https://forms-test.cashfree.com/verification/Y7tpcan5ksm0",
"form_status": "RECEIVED"
}Authorizations
Your unique client identifier issued by Cashfree. You can find this in your Merchant Dashboard.
The secret key associated with your client ID. Use this to authenticate your API requests. You can find this in your Merchant Dashboard.
Headers
Send the signature if two-factor authentication is selected as Public Key. More details.
Body
Find the request parameters for Generate KYC Link.
It is the name of the template you created using the merchant dashboard. You can also use the default template found there to generate the verification form. The default template is Aadhaar_verification. Using merchant dashboard, customized KYC Link templates can be created.
"Aadhaar_verification"
Response
Response Body for Generate KYC Link API.
Was this page helpful?