curl --request POST \
--url https://sandbox.cashfree.com/verification/aa/consent \
--header 'Content-Type: application/json' \
--header 'x-client-id: <api-key>' \
--header 'x-client-secret: <api-key>' \
--data '
{
"consent_verification_id": "abc12345",
"customer_identifiers": [
{
"type": "MOBILE",
"value": "9876543210"
}
],
"consent_start": "2024-01-01T00:00:00Z",
"consent_expiry": "2024-12-31T23:59:59Z",
"fi_from": "2024-01-01T00:00:00Z",
"fi_to": "2024-12-31T23:59:59Z",
"redirect_url": "https://example.com/redirect",
"consent_mode": "STORE",
"consent_type": [
"PROFILE",
"SUMMARY",
"TRANSACTION"
],
"fi_types": [
"DEPOSIT"
],
"data_life_expiry": "2024-01-07",
"filter": [
{
"type": "TRANSACTION_AMOUNT",
"operator": "LESS_THAN",
"value": "20000"
}
],
"fetch_type": "ONETIME"
}
'import requests
url = "https://sandbox.cashfree.com/verification/aa/consent"
payload = {
"consent_verification_id": "abc12345",
"customer_identifiers": [
{
"type": "MOBILE",
"value": "9876543210"
}
],
"consent_start": "2024-01-01T00:00:00Z",
"consent_expiry": "2024-12-31T23:59:59Z",
"fi_from": "2024-01-01T00:00:00Z",
"fi_to": "2024-12-31T23:59:59Z",
"redirect_url": "https://example.com/redirect",
"consent_mode": "STORE",
"consent_type": ["PROFILE", "SUMMARY", "TRANSACTION"],
"fi_types": ["DEPOSIT"],
"data_life_expiry": "2024-01-07",
"filter": [
{
"type": "TRANSACTION_AMOUNT",
"operator": "LESS_THAN",
"value": "20000"
}
],
"fetch_type": "ONETIME"
}
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({
consent_verification_id: 'abc12345',
customer_identifiers: [{type: 'MOBILE', value: '9876543210'}],
consent_start: '2024-01-01T00:00:00Z',
consent_expiry: '2024-12-31T23:59:59Z',
fi_from: '2024-01-01T00:00:00Z',
fi_to: '2024-12-31T23:59:59Z',
redirect_url: 'https://example.com/redirect',
consent_mode: 'STORE',
consent_type: ['PROFILE', 'SUMMARY', 'TRANSACTION'],
fi_types: ['DEPOSIT'],
data_life_expiry: '2024-01-07',
filter: [{type: 'TRANSACTION_AMOUNT', operator: 'LESS_THAN', value: '20000'}],
fetch_type: 'ONETIME'
})
};
fetch('https://sandbox.cashfree.com/verification/aa/consent', 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/aa/consent",
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([
'consent_verification_id' => 'abc12345',
'customer_identifiers' => [
[
'type' => 'MOBILE',
'value' => '9876543210'
]
],
'consent_start' => '2024-01-01T00:00:00Z',
'consent_expiry' => '2024-12-31T23:59:59Z',
'fi_from' => '2024-01-01T00:00:00Z',
'fi_to' => '2024-12-31T23:59:59Z',
'redirect_url' => 'https://example.com/redirect',
'consent_mode' => 'STORE',
'consent_type' => [
'PROFILE',
'SUMMARY',
'TRANSACTION'
],
'fi_types' => [
'DEPOSIT'
],
'data_life_expiry' => '2024-01-07',
'filter' => [
[
'type' => 'TRANSACTION_AMOUNT',
'operator' => 'LESS_THAN',
'value' => '20000'
]
],
'fetch_type' => 'ONETIME'
]),
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/aa/consent"
payload := strings.NewReader("{\n \"consent_verification_id\": \"abc12345\",\n \"customer_identifiers\": [\n {\n \"type\": \"MOBILE\",\n \"value\": \"9876543210\"\n }\n ],\n \"consent_start\": \"2024-01-01T00:00:00Z\",\n \"consent_expiry\": \"2024-12-31T23:59:59Z\",\n \"fi_from\": \"2024-01-01T00:00:00Z\",\n \"fi_to\": \"2024-12-31T23:59:59Z\",\n \"redirect_url\": \"https://example.com/redirect\",\n \"consent_mode\": \"STORE\",\n \"consent_type\": [\n \"PROFILE\",\n \"SUMMARY\",\n \"TRANSACTION\"\n ],\n \"fi_types\": [\n \"DEPOSIT\"\n ],\n \"data_life_expiry\": \"2024-01-07\",\n \"filter\": [\n {\n \"type\": \"TRANSACTION_AMOUNT\",\n \"operator\": \"LESS_THAN\",\n \"value\": \"20000\"\n }\n ],\n \"fetch_type\": \"ONETIME\"\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/aa/consent")
.header("x-client-id", "<api-key>")
.header("x-client-secret", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"consent_verification_id\": \"abc12345\",\n \"customer_identifiers\": [\n {\n \"type\": \"MOBILE\",\n \"value\": \"9876543210\"\n }\n ],\n \"consent_start\": \"2024-01-01T00:00:00Z\",\n \"consent_expiry\": \"2024-12-31T23:59:59Z\",\n \"fi_from\": \"2024-01-01T00:00:00Z\",\n \"fi_to\": \"2024-12-31T23:59:59Z\",\n \"redirect_url\": \"https://example.com/redirect\",\n \"consent_mode\": \"STORE\",\n \"consent_type\": [\n \"PROFILE\",\n \"SUMMARY\",\n \"TRANSACTION\"\n ],\n \"fi_types\": [\n \"DEPOSIT\"\n ],\n \"data_life_expiry\": \"2024-01-07\",\n \"filter\": [\n {\n \"type\": \"TRANSACTION_AMOUNT\",\n \"operator\": \"LESS_THAN\",\n \"value\": \"20000\"\n }\n ],\n \"fetch_type\": \"ONETIME\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.cashfree.com/verification/aa/consent")
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 \"consent_verification_id\": \"abc12345\",\n \"customer_identifiers\": [\n {\n \"type\": \"MOBILE\",\n \"value\": \"9876543210\"\n }\n ],\n \"consent_start\": \"2024-01-01T00:00:00Z\",\n \"consent_expiry\": \"2024-12-31T23:59:59Z\",\n \"fi_from\": \"2024-01-01T00:00:00Z\",\n \"fi_to\": \"2024-12-31T23:59:59Z\",\n \"redirect_url\": \"https://example.com/redirect\",\n \"consent_mode\": \"STORE\",\n \"consent_type\": [\n \"PROFILE\",\n \"SUMMARY\",\n \"TRANSACTION\"\n ],\n \"fi_types\": [\n \"DEPOSIT\"\n ],\n \"data_life_expiry\": \"2024-01-07\",\n \"filter\": [\n {\n \"type\": \"TRANSACTION_AMOUNT\",\n \"operator\": \"LESS_THAN\",\n \"value\": \"20000\"\n }\n ],\n \"fetch_type\": \"ONETIME\"\n}"
response = http.request(request)
puts response.read_body{
"consent_verification_id": "abc12345",
"consent_ref_id": 67890,
"consent_redirect_url": "https://example.com/redirect",
"status": "PENDING",
"customer_identifiers": [
{
"type": "MOBILE",
"value": "9876543210"
}
],
"consent_start": "2024-01-01T00:00:00Z",
"consent_expiry": "2024-12-31T23:59:59Z",
"fi_from": "2024-01-01T00:00:00Z",
"fi_to": "2024-12-31T23:59:59Z",
"redirect_url": "https://example.com/redirect",
"consent_mode": "STORE",
"consent_type": [
"PROFILE",
"SUMMARY",
"TRANSACTION"
],
"fi_types": [
"DEPOSIT"
],
"data_life_expiry": "2024-01-07",
"filter": [
{
"type": "TRANSACTION_AMOUNT",
"operator": "LESS_THAN",
"value": "20000"
}
]
}Request Consent
Use this API to request consent from the individual to fetch the financial information.
curl --request POST \
--url https://sandbox.cashfree.com/verification/aa/consent \
--header 'Content-Type: application/json' \
--header 'x-client-id: <api-key>' \
--header 'x-client-secret: <api-key>' \
--data '
{
"consent_verification_id": "abc12345",
"customer_identifiers": [
{
"type": "MOBILE",
"value": "9876543210"
}
],
"consent_start": "2024-01-01T00:00:00Z",
"consent_expiry": "2024-12-31T23:59:59Z",
"fi_from": "2024-01-01T00:00:00Z",
"fi_to": "2024-12-31T23:59:59Z",
"redirect_url": "https://example.com/redirect",
"consent_mode": "STORE",
"consent_type": [
"PROFILE",
"SUMMARY",
"TRANSACTION"
],
"fi_types": [
"DEPOSIT"
],
"data_life_expiry": "2024-01-07",
"filter": [
{
"type": "TRANSACTION_AMOUNT",
"operator": "LESS_THAN",
"value": "20000"
}
],
"fetch_type": "ONETIME"
}
'import requests
url = "https://sandbox.cashfree.com/verification/aa/consent"
payload = {
"consent_verification_id": "abc12345",
"customer_identifiers": [
{
"type": "MOBILE",
"value": "9876543210"
}
],
"consent_start": "2024-01-01T00:00:00Z",
"consent_expiry": "2024-12-31T23:59:59Z",
"fi_from": "2024-01-01T00:00:00Z",
"fi_to": "2024-12-31T23:59:59Z",
"redirect_url": "https://example.com/redirect",
"consent_mode": "STORE",
"consent_type": ["PROFILE", "SUMMARY", "TRANSACTION"],
"fi_types": ["DEPOSIT"],
"data_life_expiry": "2024-01-07",
"filter": [
{
"type": "TRANSACTION_AMOUNT",
"operator": "LESS_THAN",
"value": "20000"
}
],
"fetch_type": "ONETIME"
}
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({
consent_verification_id: 'abc12345',
customer_identifiers: [{type: 'MOBILE', value: '9876543210'}],
consent_start: '2024-01-01T00:00:00Z',
consent_expiry: '2024-12-31T23:59:59Z',
fi_from: '2024-01-01T00:00:00Z',
fi_to: '2024-12-31T23:59:59Z',
redirect_url: 'https://example.com/redirect',
consent_mode: 'STORE',
consent_type: ['PROFILE', 'SUMMARY', 'TRANSACTION'],
fi_types: ['DEPOSIT'],
data_life_expiry: '2024-01-07',
filter: [{type: 'TRANSACTION_AMOUNT', operator: 'LESS_THAN', value: '20000'}],
fetch_type: 'ONETIME'
})
};
fetch('https://sandbox.cashfree.com/verification/aa/consent', 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/aa/consent",
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([
'consent_verification_id' => 'abc12345',
'customer_identifiers' => [
[
'type' => 'MOBILE',
'value' => '9876543210'
]
],
'consent_start' => '2024-01-01T00:00:00Z',
'consent_expiry' => '2024-12-31T23:59:59Z',
'fi_from' => '2024-01-01T00:00:00Z',
'fi_to' => '2024-12-31T23:59:59Z',
'redirect_url' => 'https://example.com/redirect',
'consent_mode' => 'STORE',
'consent_type' => [
'PROFILE',
'SUMMARY',
'TRANSACTION'
],
'fi_types' => [
'DEPOSIT'
],
'data_life_expiry' => '2024-01-07',
'filter' => [
[
'type' => 'TRANSACTION_AMOUNT',
'operator' => 'LESS_THAN',
'value' => '20000'
]
],
'fetch_type' => 'ONETIME'
]),
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/aa/consent"
payload := strings.NewReader("{\n \"consent_verification_id\": \"abc12345\",\n \"customer_identifiers\": [\n {\n \"type\": \"MOBILE\",\n \"value\": \"9876543210\"\n }\n ],\n \"consent_start\": \"2024-01-01T00:00:00Z\",\n \"consent_expiry\": \"2024-12-31T23:59:59Z\",\n \"fi_from\": \"2024-01-01T00:00:00Z\",\n \"fi_to\": \"2024-12-31T23:59:59Z\",\n \"redirect_url\": \"https://example.com/redirect\",\n \"consent_mode\": \"STORE\",\n \"consent_type\": [\n \"PROFILE\",\n \"SUMMARY\",\n \"TRANSACTION\"\n ],\n \"fi_types\": [\n \"DEPOSIT\"\n ],\n \"data_life_expiry\": \"2024-01-07\",\n \"filter\": [\n {\n \"type\": \"TRANSACTION_AMOUNT\",\n \"operator\": \"LESS_THAN\",\n \"value\": \"20000\"\n }\n ],\n \"fetch_type\": \"ONETIME\"\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/aa/consent")
.header("x-client-id", "<api-key>")
.header("x-client-secret", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"consent_verification_id\": \"abc12345\",\n \"customer_identifiers\": [\n {\n \"type\": \"MOBILE\",\n \"value\": \"9876543210\"\n }\n ],\n \"consent_start\": \"2024-01-01T00:00:00Z\",\n \"consent_expiry\": \"2024-12-31T23:59:59Z\",\n \"fi_from\": \"2024-01-01T00:00:00Z\",\n \"fi_to\": \"2024-12-31T23:59:59Z\",\n \"redirect_url\": \"https://example.com/redirect\",\n \"consent_mode\": \"STORE\",\n \"consent_type\": [\n \"PROFILE\",\n \"SUMMARY\",\n \"TRANSACTION\"\n ],\n \"fi_types\": [\n \"DEPOSIT\"\n ],\n \"data_life_expiry\": \"2024-01-07\",\n \"filter\": [\n {\n \"type\": \"TRANSACTION_AMOUNT\",\n \"operator\": \"LESS_THAN\",\n \"value\": \"20000\"\n }\n ],\n \"fetch_type\": \"ONETIME\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.cashfree.com/verification/aa/consent")
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 \"consent_verification_id\": \"abc12345\",\n \"customer_identifiers\": [\n {\n \"type\": \"MOBILE\",\n \"value\": \"9876543210\"\n }\n ],\n \"consent_start\": \"2024-01-01T00:00:00Z\",\n \"consent_expiry\": \"2024-12-31T23:59:59Z\",\n \"fi_from\": \"2024-01-01T00:00:00Z\",\n \"fi_to\": \"2024-12-31T23:59:59Z\",\n \"redirect_url\": \"https://example.com/redirect\",\n \"consent_mode\": \"STORE\",\n \"consent_type\": [\n \"PROFILE\",\n \"SUMMARY\",\n \"TRANSACTION\"\n ],\n \"fi_types\": [\n \"DEPOSIT\"\n ],\n \"data_life_expiry\": \"2024-01-07\",\n \"filter\": [\n {\n \"type\": \"TRANSACTION_AMOUNT\",\n \"operator\": \"LESS_THAN\",\n \"value\": \"20000\"\n }\n ],\n \"fetch_type\": \"ONETIME\"\n}"
response = http.request(request)
puts response.read_body{
"consent_verification_id": "abc12345",
"consent_ref_id": 67890,
"consent_redirect_url": "https://example.com/redirect",
"status": "PENDING",
"customer_identifiers": [
{
"type": "MOBILE",
"value": "9876543210"
}
],
"consent_start": "2024-01-01T00:00:00Z",
"consent_expiry": "2024-12-31T23:59:59Z",
"fi_from": "2024-01-01T00:00:00Z",
"fi_to": "2024-12-31T23:59:59Z",
"redirect_url": "https://example.com/redirect",
"consent_mode": "STORE",
"consent_type": [
"PROFILE",
"SUMMARY",
"TRANSACTION"
],
"fi_types": [
"DEPOSIT"
],
"data_life_expiry": "2024-01-07",
"filter": [
{
"type": "TRANSACTION_AMOUNT",
"operator": "LESS_THAN",
"value": "20000"
}
]
}Authorizations
Client ID. You can find your ID in the Merchant Dashboard.
Client secret key. You can find your secret key in the Merchant Dashboard.
Body
Find the request parameters to request consent for AA.
It is the type of configuration for handling the financial information of the individual. Possible values are
VIEW: It indicates that the information is for viewing purpose.STORE: It indicates that the information is for storing purpose.QUERY: It indicates that the information is for querying purposes, including performing searches, filtering results, or making data-driven decisions.STREAM: It indicates that the information is for streaming purposes.
"STORE"
It displays the type of information you require from the individual.
Possible values are
- PROFILE: It contains the basic information of the individual.
- SUMMARY: It contains the summary of the financial information of the individual.
- TRANSACTIONS: It contains the transactional information of the individual.
Response
Consent created successfully
It is the type of configuration for handling the financial information of the individual. Possible values are
VIEW: It indicates that the information is for viewing purpose.STORE: It indicates that the information is for storing purpose.QUERY: It indicates that the information is for querying purposes, including performing searches, filtering results, or making data-driven decisions.STREAM: It indicates that the information is for streaming purposes.
"STORE"
It displays the type of information you require from the individual.
Possible values are
- PROFILE: It contains the basic information of the individual.
- SUMMARY: It contains the summary of the financial information of the individual.
- TRANSACTIONS: It contains the transactional information of the individual.
