curl --request POST \
--url https://sandbox.cashfree.com/pg/risk-details \
--header 'Content-Type: application/json' \
--header 'x-api-version: <x-api-version>' \
--header 'x-client-id: <x-client-id>' \
--header 'x-client-secret: <x-client-secret>' \
--header 'x-request-id: <x-request-id>' \
--data '
{
"merchant_order_id": "swapnil127",
"customer_details": {
"customer_name": "Swapnil B",
"customer_login_status": "logged_in",
"customer_email": "test@example.com",
"customer_phone": "9876543210"
},
"device_fingerprint": {
"uuid": "ibasidb-2oj31i2j-kjbskd",
"browser": {
"java_enabled": false,
"javascript_enabled": false,
"timezone_offset": 11,
"color_depth": 23,
"screen_width": 23,
"screen_height": 100,
"referer": "https://merchansite.com/example/paybill",
"user_agent": "Mozilla/5.0",
"session_duration": 1200
},
"ip": "105.106.107.108"
},
"risk_controls": {
"preferred_non_3ds": false,
"step_up_3ds": true,
"cbp_coverage_requested": true
},
"industries": [
{
"industry_type": "flight",
"industry_details": {
"billing_address": {
"address_line_1": "123 Street",
"city": "New York City",
"state": "New York",
"country": "USA",
"zipcode": 11001
},
"guests": [
{
"name": "Swapnil Buchke",
"age": 26,
"class": "Economy",
"nationality": "Indian",
"relationship_with_primary": "self"
},
{
"name": "Kushagra Sahni",
"age": 26,
"class": "Economy",
"nationality": "Indian",
"relationship_with_primary": "sibling"
}
],
"itinerary": [
{
"departure_airport": "BOM",
"arrival_airport": "DEL",
"departure_date": "2025-10-15T00:00:00.000Z",
"total_segments": 1,
"flight_numbers": [
"AI-101"
],
"addons": {
"concierge": true,
"luggage": true,
"meals": true,
"delay_protection": false,
"travel_insurance": true,
"seats": true
}
}
],
"fare_details": {
"base_fare": "10000",
"offer_fare": "9200",
"promo_used": true
}
}
}
]
}
'import requests
url = "https://sandbox.cashfree.com/pg/risk-details"
payload = {
"merchant_order_id": "swapnil127",
"customer_details": {
"customer_name": "Swapnil B",
"customer_login_status": "logged_in",
"customer_email": "test@example.com",
"customer_phone": "9876543210"
},
"device_fingerprint": {
"uuid": "ibasidb-2oj31i2j-kjbskd",
"browser": {
"java_enabled": False,
"javascript_enabled": False,
"timezone_offset": 11,
"color_depth": 23,
"screen_width": 23,
"screen_height": 100,
"referer": "https://merchansite.com/example/paybill",
"user_agent": "Mozilla/5.0",
"session_duration": 1200
},
"ip": "105.106.107.108"
},
"risk_controls": {
"preferred_non_3ds": False,
"step_up_3ds": True,
"cbp_coverage_requested": True
},
"industries": [
{
"industry_type": "flight",
"industry_details": {
"billing_address": {
"address_line_1": "123 Street",
"city": "New York City",
"state": "New York",
"country": "USA",
"zipcode": 11001
},
"guests": [
{
"name": "Swapnil Buchke",
"age": 26,
"class": "Economy",
"nationality": "Indian",
"relationship_with_primary": "self"
},
{
"name": "Kushagra Sahni",
"age": 26,
"class": "Economy",
"nationality": "Indian",
"relationship_with_primary": "sibling"
}
],
"itinerary": [
{
"departure_airport": "BOM",
"arrival_airport": "DEL",
"departure_date": "2025-10-15T00:00:00.000Z",
"total_segments": 1,
"flight_numbers": ["AI-101"],
"addons": {
"concierge": True,
"luggage": True,
"meals": True,
"delay_protection": False,
"travel_insurance": True,
"seats": True
}
}
],
"fare_details": {
"base_fare": "10000",
"offer_fare": "9200",
"promo_used": True
}
}
}
]
}
headers = {
"x-client-id": "<x-client-id>",
"x-client-secret": "<x-client-secret>",
"x-api-version": "<x-api-version>",
"x-request-id": "<x-request-id>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-client-id': '<x-client-id>',
'x-client-secret': '<x-client-secret>',
'x-api-version': '<x-api-version>',
'x-request-id': '<x-request-id>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
merchant_order_id: 'swapnil127',
customer_details: {
customer_name: 'Swapnil B',
customer_login_status: 'logged_in',
customer_email: 'test@example.com',
customer_phone: '9876543210'
},
device_fingerprint: {
uuid: 'ibasidb-2oj31i2j-kjbskd',
browser: {
java_enabled: false,
javascript_enabled: false,
timezone_offset: 11,
color_depth: 23,
screen_width: 23,
screen_height: 100,
referer: 'https://merchansite.com/example/paybill',
user_agent: 'Mozilla/5.0',
session_duration: 1200
},
ip: '105.106.107.108'
},
risk_controls: {preferred_non_3ds: false, step_up_3ds: true, cbp_coverage_requested: true},
industries: [
{
industry_type: 'flight',
industry_details: {
billing_address: {
address_line_1: '123 Street',
city: 'New York City',
state: 'New York',
country: 'USA',
zipcode: 11001
},
guests: [
{
name: 'Swapnil Buchke',
age: 26,
class: 'Economy',
nationality: 'Indian',
relationship_with_primary: 'self'
},
{
name: 'Kushagra Sahni',
age: 26,
class: 'Economy',
nationality: 'Indian',
relationship_with_primary: 'sibling'
}
],
itinerary: [
{
departure_airport: 'BOM',
arrival_airport: 'DEL',
departure_date: '2025-10-15T00:00:00.000Z',
total_segments: 1,
flight_numbers: ['AI-101'],
addons: {
concierge: true,
luggage: true,
meals: true,
delay_protection: false,
travel_insurance: true,
seats: true
}
}
],
fare_details: {base_fare: '10000', offer_fare: '9200', promo_used: true}
}
}
]
})
};
fetch('https://sandbox.cashfree.com/pg/risk-details', 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/pg/risk-details",
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([
'merchant_order_id' => 'swapnil127',
'customer_details' => [
'customer_name' => 'Swapnil B',
'customer_login_status' => 'logged_in',
'customer_email' => 'test@example.com',
'customer_phone' => '9876543210'
],
'device_fingerprint' => [
'uuid' => 'ibasidb-2oj31i2j-kjbskd',
'browser' => [
'java_enabled' => false,
'javascript_enabled' => false,
'timezone_offset' => 11,
'color_depth' => 23,
'screen_width' => 23,
'screen_height' => 100,
'referer' => 'https://merchansite.com/example/paybill',
'user_agent' => 'Mozilla/5.0',
'session_duration' => 1200
],
'ip' => '105.106.107.108'
],
'risk_controls' => [
'preferred_non_3ds' => false,
'step_up_3ds' => true,
'cbp_coverage_requested' => true
],
'industries' => [
[
'industry_type' => 'flight',
'industry_details' => [
'billing_address' => [
'address_line_1' => '123 Street',
'city' => 'New York City',
'state' => 'New York',
'country' => 'USA',
'zipcode' => 11001
],
'guests' => [
[
'name' => 'Swapnil Buchke',
'age' => 26,
'class' => 'Economy',
'nationality' => 'Indian',
'relationship_with_primary' => 'self'
],
[
'name' => 'Kushagra Sahni',
'age' => 26,
'class' => 'Economy',
'nationality' => 'Indian',
'relationship_with_primary' => 'sibling'
]
],
'itinerary' => [
[
'departure_airport' => 'BOM',
'arrival_airport' => 'DEL',
'departure_date' => '2025-10-15T00:00:00.000Z',
'total_segments' => 1,
'flight_numbers' => [
'AI-101'
],
'addons' => [
'concierge' => true,
'luggage' => true,
'meals' => true,
'delay_protection' => false,
'travel_insurance' => true,
'seats' => true
]
]
],
'fare_details' => [
'base_fare' => '10000',
'offer_fare' => '9200',
'promo_used' => true
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-version: <x-api-version>",
"x-client-id: <x-client-id>",
"x-client-secret: <x-client-secret>",
"x-request-id: <x-request-id>"
],
]);
$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/pg/risk-details"
payload := strings.NewReader("{\n \"merchant_order_id\": \"swapnil127\",\n \"customer_details\": {\n \"customer_name\": \"Swapnil B\",\n \"customer_login_status\": \"logged_in\",\n \"customer_email\": \"test@example.com\",\n \"customer_phone\": \"9876543210\"\n },\n \"device_fingerprint\": {\n \"uuid\": \"ibasidb-2oj31i2j-kjbskd\",\n \"browser\": {\n \"java_enabled\": false,\n \"javascript_enabled\": false,\n \"timezone_offset\": 11,\n \"color_depth\": 23,\n \"screen_width\": 23,\n \"screen_height\": 100,\n \"referer\": \"https://merchansite.com/example/paybill\",\n \"user_agent\": \"Mozilla/5.0\",\n \"session_duration\": 1200\n },\n \"ip\": \"105.106.107.108\"\n },\n \"risk_controls\": {\n \"preferred_non_3ds\": false,\n \"step_up_3ds\": true,\n \"cbp_coverage_requested\": true\n },\n \"industries\": [\n {\n \"industry_type\": \"flight\",\n \"industry_details\": {\n \"billing_address\": {\n \"address_line_1\": \"123 Street\",\n \"city\": \"New York City\",\n \"state\": \"New York\",\n \"country\": \"USA\",\n \"zipcode\": 11001\n },\n \"guests\": [\n {\n \"name\": \"Swapnil Buchke\",\n \"age\": 26,\n \"class\": \"Economy\",\n \"nationality\": \"Indian\",\n \"relationship_with_primary\": \"self\"\n },\n {\n \"name\": \"Kushagra Sahni\",\n \"age\": 26,\n \"class\": \"Economy\",\n \"nationality\": \"Indian\",\n \"relationship_with_primary\": \"sibling\"\n }\n ],\n \"itinerary\": [\n {\n \"departure_airport\": \"BOM\",\n \"arrival_airport\": \"DEL\",\n \"departure_date\": \"2025-10-15T00:00:00.000Z\",\n \"total_segments\": 1,\n \"flight_numbers\": [\n \"AI-101\"\n ],\n \"addons\": {\n \"concierge\": true,\n \"luggage\": true,\n \"meals\": true,\n \"delay_protection\": false,\n \"travel_insurance\": true,\n \"seats\": true\n }\n }\n ],\n \"fare_details\": {\n \"base_fare\": \"10000\",\n \"offer_fare\": \"9200\",\n \"promo_used\": true\n }\n }\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-client-id", "<x-client-id>")
req.Header.Add("x-client-secret", "<x-client-secret>")
req.Header.Add("x-api-version", "<x-api-version>")
req.Header.Add("x-request-id", "<x-request-id>")
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/pg/risk-details")
.header("x-client-id", "<x-client-id>")
.header("x-client-secret", "<x-client-secret>")
.header("x-api-version", "<x-api-version>")
.header("x-request-id", "<x-request-id>")
.header("Content-Type", "application/json")
.body("{\n \"merchant_order_id\": \"swapnil127\",\n \"customer_details\": {\n \"customer_name\": \"Swapnil B\",\n \"customer_login_status\": \"logged_in\",\n \"customer_email\": \"test@example.com\",\n \"customer_phone\": \"9876543210\"\n },\n \"device_fingerprint\": {\n \"uuid\": \"ibasidb-2oj31i2j-kjbskd\",\n \"browser\": {\n \"java_enabled\": false,\n \"javascript_enabled\": false,\n \"timezone_offset\": 11,\n \"color_depth\": 23,\n \"screen_width\": 23,\n \"screen_height\": 100,\n \"referer\": \"https://merchansite.com/example/paybill\",\n \"user_agent\": \"Mozilla/5.0\",\n \"session_duration\": 1200\n },\n \"ip\": \"105.106.107.108\"\n },\n \"risk_controls\": {\n \"preferred_non_3ds\": false,\n \"step_up_3ds\": true,\n \"cbp_coverage_requested\": true\n },\n \"industries\": [\n {\n \"industry_type\": \"flight\",\n \"industry_details\": {\n \"billing_address\": {\n \"address_line_1\": \"123 Street\",\n \"city\": \"New York City\",\n \"state\": \"New York\",\n \"country\": \"USA\",\n \"zipcode\": 11001\n },\n \"guests\": [\n {\n \"name\": \"Swapnil Buchke\",\n \"age\": 26,\n \"class\": \"Economy\",\n \"nationality\": \"Indian\",\n \"relationship_with_primary\": \"self\"\n },\n {\n \"name\": \"Kushagra Sahni\",\n \"age\": 26,\n \"class\": \"Economy\",\n \"nationality\": \"Indian\",\n \"relationship_with_primary\": \"sibling\"\n }\n ],\n \"itinerary\": [\n {\n \"departure_airport\": \"BOM\",\n \"arrival_airport\": \"DEL\",\n \"departure_date\": \"2025-10-15T00:00:00.000Z\",\n \"total_segments\": 1,\n \"flight_numbers\": [\n \"AI-101\"\n ],\n \"addons\": {\n \"concierge\": true,\n \"luggage\": true,\n \"meals\": true,\n \"delay_protection\": false,\n \"travel_insurance\": true,\n \"seats\": true\n }\n }\n ],\n \"fare_details\": {\n \"base_fare\": \"10000\",\n \"offer_fare\": \"9200\",\n \"promo_used\": true\n }\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.cashfree.com/pg/risk-details")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-client-id"] = '<x-client-id>'
request["x-client-secret"] = '<x-client-secret>'
request["x-api-version"] = '<x-api-version>'
request["x-request-id"] = '<x-request-id>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"merchant_order_id\": \"swapnil127\",\n \"customer_details\": {\n \"customer_name\": \"Swapnil B\",\n \"customer_login_status\": \"logged_in\",\n \"customer_email\": \"test@example.com\",\n \"customer_phone\": \"9876543210\"\n },\n \"device_fingerprint\": {\n \"uuid\": \"ibasidb-2oj31i2j-kjbskd\",\n \"browser\": {\n \"java_enabled\": false,\n \"javascript_enabled\": false,\n \"timezone_offset\": 11,\n \"color_depth\": 23,\n \"screen_width\": 23,\n \"screen_height\": 100,\n \"referer\": \"https://merchansite.com/example/paybill\",\n \"user_agent\": \"Mozilla/5.0\",\n \"session_duration\": 1200\n },\n \"ip\": \"105.106.107.108\"\n },\n \"risk_controls\": {\n \"preferred_non_3ds\": false,\n \"step_up_3ds\": true,\n \"cbp_coverage_requested\": true\n },\n \"industries\": [\n {\n \"industry_type\": \"flight\",\n \"industry_details\": {\n \"billing_address\": {\n \"address_line_1\": \"123 Street\",\n \"city\": \"New York City\",\n \"state\": \"New York\",\n \"country\": \"USA\",\n \"zipcode\": 11001\n },\n \"guests\": [\n {\n \"name\": \"Swapnil Buchke\",\n \"age\": 26,\n \"class\": \"Economy\",\n \"nationality\": \"Indian\",\n \"relationship_with_primary\": \"self\"\n },\n {\n \"name\": \"Kushagra Sahni\",\n \"age\": 26,\n \"class\": \"Economy\",\n \"nationality\": \"Indian\",\n \"relationship_with_primary\": \"sibling\"\n }\n ],\n \"itinerary\": [\n {\n \"departure_airport\": \"BOM\",\n \"arrival_airport\": \"DEL\",\n \"departure_date\": \"2025-10-15T00:00:00.000Z\",\n \"total_segments\": 1,\n \"flight_numbers\": [\n \"AI-101\"\n ],\n \"addons\": {\n \"concierge\": true,\n \"luggage\": true,\n \"meals\": true,\n \"delay_protection\": false,\n \"travel_insurance\": true,\n \"seats\": true\n }\n }\n ],\n \"fare_details\": {\n \"base_fare\": \"10000\",\n \"offer_fare\": \"9200\",\n \"promo_used\": true\n }\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": "SUCCESS",
"message": "Risk details accepted"
}{
"status": "ERROR",
"message": "Invalid request or missing parameters."
}{
"status": "UNAUTHORIZED",
"message": "Authentication failure"
}{
"status": "ERROR",
"message": "Server error"
}Submit Risk Details
Use this API to submit comprehensive risk assessment data for an order to Cashfreeās risk management system. The API accepts customer details, device information, and industry-specific transaction data for enhanced fraud detection and risk analysis.
curl --request POST \
--url https://sandbox.cashfree.com/pg/risk-details \
--header 'Content-Type: application/json' \
--header 'x-api-version: <x-api-version>' \
--header 'x-client-id: <x-client-id>' \
--header 'x-client-secret: <x-client-secret>' \
--header 'x-request-id: <x-request-id>' \
--data '
{
"merchant_order_id": "swapnil127",
"customer_details": {
"customer_name": "Swapnil B",
"customer_login_status": "logged_in",
"customer_email": "test@example.com",
"customer_phone": "9876543210"
},
"device_fingerprint": {
"uuid": "ibasidb-2oj31i2j-kjbskd",
"browser": {
"java_enabled": false,
"javascript_enabled": false,
"timezone_offset": 11,
"color_depth": 23,
"screen_width": 23,
"screen_height": 100,
"referer": "https://merchansite.com/example/paybill",
"user_agent": "Mozilla/5.0",
"session_duration": 1200
},
"ip": "105.106.107.108"
},
"risk_controls": {
"preferred_non_3ds": false,
"step_up_3ds": true,
"cbp_coverage_requested": true
},
"industries": [
{
"industry_type": "flight",
"industry_details": {
"billing_address": {
"address_line_1": "123 Street",
"city": "New York City",
"state": "New York",
"country": "USA",
"zipcode": 11001
},
"guests": [
{
"name": "Swapnil Buchke",
"age": 26,
"class": "Economy",
"nationality": "Indian",
"relationship_with_primary": "self"
},
{
"name": "Kushagra Sahni",
"age": 26,
"class": "Economy",
"nationality": "Indian",
"relationship_with_primary": "sibling"
}
],
"itinerary": [
{
"departure_airport": "BOM",
"arrival_airport": "DEL",
"departure_date": "2025-10-15T00:00:00.000Z",
"total_segments": 1,
"flight_numbers": [
"AI-101"
],
"addons": {
"concierge": true,
"luggage": true,
"meals": true,
"delay_protection": false,
"travel_insurance": true,
"seats": true
}
}
],
"fare_details": {
"base_fare": "10000",
"offer_fare": "9200",
"promo_used": true
}
}
}
]
}
'import requests
url = "https://sandbox.cashfree.com/pg/risk-details"
payload = {
"merchant_order_id": "swapnil127",
"customer_details": {
"customer_name": "Swapnil B",
"customer_login_status": "logged_in",
"customer_email": "test@example.com",
"customer_phone": "9876543210"
},
"device_fingerprint": {
"uuid": "ibasidb-2oj31i2j-kjbskd",
"browser": {
"java_enabled": False,
"javascript_enabled": False,
"timezone_offset": 11,
"color_depth": 23,
"screen_width": 23,
"screen_height": 100,
"referer": "https://merchansite.com/example/paybill",
"user_agent": "Mozilla/5.0",
"session_duration": 1200
},
"ip": "105.106.107.108"
},
"risk_controls": {
"preferred_non_3ds": False,
"step_up_3ds": True,
"cbp_coverage_requested": True
},
"industries": [
{
"industry_type": "flight",
"industry_details": {
"billing_address": {
"address_line_1": "123 Street",
"city": "New York City",
"state": "New York",
"country": "USA",
"zipcode": 11001
},
"guests": [
{
"name": "Swapnil Buchke",
"age": 26,
"class": "Economy",
"nationality": "Indian",
"relationship_with_primary": "self"
},
{
"name": "Kushagra Sahni",
"age": 26,
"class": "Economy",
"nationality": "Indian",
"relationship_with_primary": "sibling"
}
],
"itinerary": [
{
"departure_airport": "BOM",
"arrival_airport": "DEL",
"departure_date": "2025-10-15T00:00:00.000Z",
"total_segments": 1,
"flight_numbers": ["AI-101"],
"addons": {
"concierge": True,
"luggage": True,
"meals": True,
"delay_protection": False,
"travel_insurance": True,
"seats": True
}
}
],
"fare_details": {
"base_fare": "10000",
"offer_fare": "9200",
"promo_used": True
}
}
}
]
}
headers = {
"x-client-id": "<x-client-id>",
"x-client-secret": "<x-client-secret>",
"x-api-version": "<x-api-version>",
"x-request-id": "<x-request-id>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-client-id': '<x-client-id>',
'x-client-secret': '<x-client-secret>',
'x-api-version': '<x-api-version>',
'x-request-id': '<x-request-id>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
merchant_order_id: 'swapnil127',
customer_details: {
customer_name: 'Swapnil B',
customer_login_status: 'logged_in',
customer_email: 'test@example.com',
customer_phone: '9876543210'
},
device_fingerprint: {
uuid: 'ibasidb-2oj31i2j-kjbskd',
browser: {
java_enabled: false,
javascript_enabled: false,
timezone_offset: 11,
color_depth: 23,
screen_width: 23,
screen_height: 100,
referer: 'https://merchansite.com/example/paybill',
user_agent: 'Mozilla/5.0',
session_duration: 1200
},
ip: '105.106.107.108'
},
risk_controls: {preferred_non_3ds: false, step_up_3ds: true, cbp_coverage_requested: true},
industries: [
{
industry_type: 'flight',
industry_details: {
billing_address: {
address_line_1: '123 Street',
city: 'New York City',
state: 'New York',
country: 'USA',
zipcode: 11001
},
guests: [
{
name: 'Swapnil Buchke',
age: 26,
class: 'Economy',
nationality: 'Indian',
relationship_with_primary: 'self'
},
{
name: 'Kushagra Sahni',
age: 26,
class: 'Economy',
nationality: 'Indian',
relationship_with_primary: 'sibling'
}
],
itinerary: [
{
departure_airport: 'BOM',
arrival_airport: 'DEL',
departure_date: '2025-10-15T00:00:00.000Z',
total_segments: 1,
flight_numbers: ['AI-101'],
addons: {
concierge: true,
luggage: true,
meals: true,
delay_protection: false,
travel_insurance: true,
seats: true
}
}
],
fare_details: {base_fare: '10000', offer_fare: '9200', promo_used: true}
}
}
]
})
};
fetch('https://sandbox.cashfree.com/pg/risk-details', 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/pg/risk-details",
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([
'merchant_order_id' => 'swapnil127',
'customer_details' => [
'customer_name' => 'Swapnil B',
'customer_login_status' => 'logged_in',
'customer_email' => 'test@example.com',
'customer_phone' => '9876543210'
],
'device_fingerprint' => [
'uuid' => 'ibasidb-2oj31i2j-kjbskd',
'browser' => [
'java_enabled' => false,
'javascript_enabled' => false,
'timezone_offset' => 11,
'color_depth' => 23,
'screen_width' => 23,
'screen_height' => 100,
'referer' => 'https://merchansite.com/example/paybill',
'user_agent' => 'Mozilla/5.0',
'session_duration' => 1200
],
'ip' => '105.106.107.108'
],
'risk_controls' => [
'preferred_non_3ds' => false,
'step_up_3ds' => true,
'cbp_coverage_requested' => true
],
'industries' => [
[
'industry_type' => 'flight',
'industry_details' => [
'billing_address' => [
'address_line_1' => '123 Street',
'city' => 'New York City',
'state' => 'New York',
'country' => 'USA',
'zipcode' => 11001
],
'guests' => [
[
'name' => 'Swapnil Buchke',
'age' => 26,
'class' => 'Economy',
'nationality' => 'Indian',
'relationship_with_primary' => 'self'
],
[
'name' => 'Kushagra Sahni',
'age' => 26,
'class' => 'Economy',
'nationality' => 'Indian',
'relationship_with_primary' => 'sibling'
]
],
'itinerary' => [
[
'departure_airport' => 'BOM',
'arrival_airport' => 'DEL',
'departure_date' => '2025-10-15T00:00:00.000Z',
'total_segments' => 1,
'flight_numbers' => [
'AI-101'
],
'addons' => [
'concierge' => true,
'luggage' => true,
'meals' => true,
'delay_protection' => false,
'travel_insurance' => true,
'seats' => true
]
]
],
'fare_details' => [
'base_fare' => '10000',
'offer_fare' => '9200',
'promo_used' => true
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-version: <x-api-version>",
"x-client-id: <x-client-id>",
"x-client-secret: <x-client-secret>",
"x-request-id: <x-request-id>"
],
]);
$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/pg/risk-details"
payload := strings.NewReader("{\n \"merchant_order_id\": \"swapnil127\",\n \"customer_details\": {\n \"customer_name\": \"Swapnil B\",\n \"customer_login_status\": \"logged_in\",\n \"customer_email\": \"test@example.com\",\n \"customer_phone\": \"9876543210\"\n },\n \"device_fingerprint\": {\n \"uuid\": \"ibasidb-2oj31i2j-kjbskd\",\n \"browser\": {\n \"java_enabled\": false,\n \"javascript_enabled\": false,\n \"timezone_offset\": 11,\n \"color_depth\": 23,\n \"screen_width\": 23,\n \"screen_height\": 100,\n \"referer\": \"https://merchansite.com/example/paybill\",\n \"user_agent\": \"Mozilla/5.0\",\n \"session_duration\": 1200\n },\n \"ip\": \"105.106.107.108\"\n },\n \"risk_controls\": {\n \"preferred_non_3ds\": false,\n \"step_up_3ds\": true,\n \"cbp_coverage_requested\": true\n },\n \"industries\": [\n {\n \"industry_type\": \"flight\",\n \"industry_details\": {\n \"billing_address\": {\n \"address_line_1\": \"123 Street\",\n \"city\": \"New York City\",\n \"state\": \"New York\",\n \"country\": \"USA\",\n \"zipcode\": 11001\n },\n \"guests\": [\n {\n \"name\": \"Swapnil Buchke\",\n \"age\": 26,\n \"class\": \"Economy\",\n \"nationality\": \"Indian\",\n \"relationship_with_primary\": \"self\"\n },\n {\n \"name\": \"Kushagra Sahni\",\n \"age\": 26,\n \"class\": \"Economy\",\n \"nationality\": \"Indian\",\n \"relationship_with_primary\": \"sibling\"\n }\n ],\n \"itinerary\": [\n {\n \"departure_airport\": \"BOM\",\n \"arrival_airport\": \"DEL\",\n \"departure_date\": \"2025-10-15T00:00:00.000Z\",\n \"total_segments\": 1,\n \"flight_numbers\": [\n \"AI-101\"\n ],\n \"addons\": {\n \"concierge\": true,\n \"luggage\": true,\n \"meals\": true,\n \"delay_protection\": false,\n \"travel_insurance\": true,\n \"seats\": true\n }\n }\n ],\n \"fare_details\": {\n \"base_fare\": \"10000\",\n \"offer_fare\": \"9200\",\n \"promo_used\": true\n }\n }\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-client-id", "<x-client-id>")
req.Header.Add("x-client-secret", "<x-client-secret>")
req.Header.Add("x-api-version", "<x-api-version>")
req.Header.Add("x-request-id", "<x-request-id>")
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/pg/risk-details")
.header("x-client-id", "<x-client-id>")
.header("x-client-secret", "<x-client-secret>")
.header("x-api-version", "<x-api-version>")
.header("x-request-id", "<x-request-id>")
.header("Content-Type", "application/json")
.body("{\n \"merchant_order_id\": \"swapnil127\",\n \"customer_details\": {\n \"customer_name\": \"Swapnil B\",\n \"customer_login_status\": \"logged_in\",\n \"customer_email\": \"test@example.com\",\n \"customer_phone\": \"9876543210\"\n },\n \"device_fingerprint\": {\n \"uuid\": \"ibasidb-2oj31i2j-kjbskd\",\n \"browser\": {\n \"java_enabled\": false,\n \"javascript_enabled\": false,\n \"timezone_offset\": 11,\n \"color_depth\": 23,\n \"screen_width\": 23,\n \"screen_height\": 100,\n \"referer\": \"https://merchansite.com/example/paybill\",\n \"user_agent\": \"Mozilla/5.0\",\n \"session_duration\": 1200\n },\n \"ip\": \"105.106.107.108\"\n },\n \"risk_controls\": {\n \"preferred_non_3ds\": false,\n \"step_up_3ds\": true,\n \"cbp_coverage_requested\": true\n },\n \"industries\": [\n {\n \"industry_type\": \"flight\",\n \"industry_details\": {\n \"billing_address\": {\n \"address_line_1\": \"123 Street\",\n \"city\": \"New York City\",\n \"state\": \"New York\",\n \"country\": \"USA\",\n \"zipcode\": 11001\n },\n \"guests\": [\n {\n \"name\": \"Swapnil Buchke\",\n \"age\": 26,\n \"class\": \"Economy\",\n \"nationality\": \"Indian\",\n \"relationship_with_primary\": \"self\"\n },\n {\n \"name\": \"Kushagra Sahni\",\n \"age\": 26,\n \"class\": \"Economy\",\n \"nationality\": \"Indian\",\n \"relationship_with_primary\": \"sibling\"\n }\n ],\n \"itinerary\": [\n {\n \"departure_airport\": \"BOM\",\n \"arrival_airport\": \"DEL\",\n \"departure_date\": \"2025-10-15T00:00:00.000Z\",\n \"total_segments\": 1,\n \"flight_numbers\": [\n \"AI-101\"\n ],\n \"addons\": {\n \"concierge\": true,\n \"luggage\": true,\n \"meals\": true,\n \"delay_protection\": false,\n \"travel_insurance\": true,\n \"seats\": true\n }\n }\n ],\n \"fare_details\": {\n \"base_fare\": \"10000\",\n \"offer_fare\": \"9200\",\n \"promo_used\": true\n }\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.cashfree.com/pg/risk-details")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-client-id"] = '<x-client-id>'
request["x-client-secret"] = '<x-client-secret>'
request["x-api-version"] = '<x-api-version>'
request["x-request-id"] = '<x-request-id>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"merchant_order_id\": \"swapnil127\",\n \"customer_details\": {\n \"customer_name\": \"Swapnil B\",\n \"customer_login_status\": \"logged_in\",\n \"customer_email\": \"test@example.com\",\n \"customer_phone\": \"9876543210\"\n },\n \"device_fingerprint\": {\n \"uuid\": \"ibasidb-2oj31i2j-kjbskd\",\n \"browser\": {\n \"java_enabled\": false,\n \"javascript_enabled\": false,\n \"timezone_offset\": 11,\n \"color_depth\": 23,\n \"screen_width\": 23,\n \"screen_height\": 100,\n \"referer\": \"https://merchansite.com/example/paybill\",\n \"user_agent\": \"Mozilla/5.0\",\n \"session_duration\": 1200\n },\n \"ip\": \"105.106.107.108\"\n },\n \"risk_controls\": {\n \"preferred_non_3ds\": false,\n \"step_up_3ds\": true,\n \"cbp_coverage_requested\": true\n },\n \"industries\": [\n {\n \"industry_type\": \"flight\",\n \"industry_details\": {\n \"billing_address\": {\n \"address_line_1\": \"123 Street\",\n \"city\": \"New York City\",\n \"state\": \"New York\",\n \"country\": \"USA\",\n \"zipcode\": 11001\n },\n \"guests\": [\n {\n \"name\": \"Swapnil Buchke\",\n \"age\": 26,\n \"class\": \"Economy\",\n \"nationality\": \"Indian\",\n \"relationship_with_primary\": \"self\"\n },\n {\n \"name\": \"Kushagra Sahni\",\n \"age\": 26,\n \"class\": \"Economy\",\n \"nationality\": \"Indian\",\n \"relationship_with_primary\": \"sibling\"\n }\n ],\n \"itinerary\": [\n {\n \"departure_airport\": \"BOM\",\n \"arrival_airport\": \"DEL\",\n \"departure_date\": \"2025-10-15T00:00:00.000Z\",\n \"total_segments\": 1,\n \"flight_numbers\": [\n \"AI-101\"\n ],\n \"addons\": {\n \"concierge\": true,\n \"luggage\": true,\n \"meals\": true,\n \"delay_protection\": false,\n \"travel_insurance\": true,\n \"seats\": true\n }\n }\n ],\n \"fare_details\": {\n \"base_fare\": \"10000\",\n \"offer_fare\": \"9200\",\n \"promo_used\": true\n }\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": "SUCCESS",
"message": "Risk details accepted"
}{
"status": "ERROR",
"message": "Invalid request or missing parameters."
}{
"status": "UNAUTHORIZED",
"message": "Authentication failure"
}{
"status": "ERROR",
"message": "Server error"
}Headers
Client app ID. You can find your app id in the Merchant Dashboard.
Client secret key. You can find your secret key in the Merchant Dashboard.
API version to be used. Format is in YYYY-MM-DD.
Request ID for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to Cashfree.
Content type that the client can accept.
Content type of the request body.
Body
Request parameters to submit risk details for an order.
Unique identifier for the merchant order.
"swapnil127"
Customer information for risk assessment.
Show child attributes
Show child attributes
{
"customer_name": "Swapnil B",
"customer_login_status": "logged_in",
"customer_email": "test@example.com",
"customer_phone": "9876543210"
}
Device and browser information for fraud detection.
Show child attributes
Show child attributes
Risk control preferences for the transaction.
Show child attributes
Show child attributes
{
"preferred_non_3ds": false,
"step_up_3ds": true,
"cbp_coverage_requested": true
}
Industry-specific transaction details.
Show child attributes
Show child attributes
Additional metadata for the transaction.
Show child attributes
Show child attributes
{
"metadata_key_1": "metadata_value_1",
"metadata_key_2": "metadata_value_2"
}
Was this page helpful?