Authorize
curl --request POST \
--url https://payout-api.cashfree.com/payout/v1/authorize \
--header 'X-Client-Id: <x-client-id>' \
--header 'X-Client-Secret: <x-client-secret>'import requests
url = "https://payout-api.cashfree.com/payout/v1/authorize"
headers = {
"X-Client-Secret": "<x-client-secret>",
"X-Client-Id": "<x-client-id>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Client-Secret': '<x-client-secret>', 'X-Client-Id': '<x-client-id>'}
};
fetch('https://payout-api.cashfree.com/payout/v1/authorize', 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://payout-api.cashfree.com/payout/v1/authorize",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"X-Client-Id: <x-client-id>",
"X-Client-Secret: <x-client-secret>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://payout-api.cashfree.com/payout/v1/authorize"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("X-Client-Secret", "<x-client-secret>")
req.Header.Add("X-Client-Id", "<x-client-id>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://payout-api.cashfree.com/payout/v1/authorize")
.header("X-Client-Secret", "<x-client-secret>")
.header("X-Client-Id", "<x-client-id>")
.asString();require 'uri'
require 'net/http'
url = URI("https://payout-api.cashfree.com/payout/v1/authorize")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Client-Secret"] = '<x-client-secret>'
request["X-Client-Id"] = '<x-client-id>'
response = http.request(request)
puts response.read_body{
"status": "SUCCESS",
"message": "Token is valid",
"subCode": "200"
}{
"status": "ERROR",
"subCode": "401",
"message": "Invalid clientId and clientSecret combination"
}Authorize
Use this API to authenticate with the Cashfree system and obtain the authorization bearer token. All other API calls must have this token as Authorization header in the format 'Bearer <token>' (without quotes) for them to get processed.
POST
/
payout
/
v1
/
authorize
Authorize
curl --request POST \
--url https://payout-api.cashfree.com/payout/v1/authorize \
--header 'X-Client-Id: <x-client-id>' \
--header 'X-Client-Secret: <x-client-secret>'import requests
url = "https://payout-api.cashfree.com/payout/v1/authorize"
headers = {
"X-Client-Secret": "<x-client-secret>",
"X-Client-Id": "<x-client-id>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Client-Secret': '<x-client-secret>', 'X-Client-Id': '<x-client-id>'}
};
fetch('https://payout-api.cashfree.com/payout/v1/authorize', 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://payout-api.cashfree.com/payout/v1/authorize",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"X-Client-Id: <x-client-id>",
"X-Client-Secret: <x-client-secret>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://payout-api.cashfree.com/payout/v1/authorize"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("X-Client-Secret", "<x-client-secret>")
req.Header.Add("X-Client-Id", "<x-client-id>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://payout-api.cashfree.com/payout/v1/authorize")
.header("X-Client-Secret", "<x-client-secret>")
.header("X-Client-Id", "<x-client-id>")
.asString();require 'uri'
require 'net/http'
url = URI("https://payout-api.cashfree.com/payout/v1/authorize")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Client-Secret"] = '<x-client-secret>'
request["X-Client-Id"] = '<x-client-id>'
response = http.request(request)
puts response.read_body{
"status": "SUCCESS",
"message": "Token is valid",
"subCode": "200"
}{
"status": "ERROR",
"subCode": "401",
"message": "Invalid clientId and clientSecret combination"
}⌘I
