curl --request POST \
--url https://payout-api.cashfree.com/payout/v1/createCashgram \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"cashgramId": "<string>",
"amount": 123,
"name": "<string>",
"phone": "<string>",
"linkExpiry": "<string>",
"email": "<string>",
"remarks": "<string>",
"notifyCustomer": true,
"payoutType": "<string>"
}
'import requests
url = "https://payout-api.cashfree.com/payout/v1/createCashgram"
payload = {
"cashgramId": "<string>",
"amount": 123,
"name": "<string>",
"phone": "<string>",
"linkExpiry": "<string>",
"email": "<string>",
"remarks": "<string>",
"notifyCustomer": True,
"payoutType": "<string>"
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "<content-type>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': '<content-type>'},
body: JSON.stringify({
cashgramId: '<string>',
amount: 123,
name: '<string>',
phone: '<string>',
linkExpiry: '<string>',
email: '<string>',
remarks: '<string>',
notifyCustomer: true,
payoutType: '<string>'
})
};
fetch('https://payout-api.cashfree.com/payout/v1/createCashgram', 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/createCashgram",
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([
'cashgramId' => '<string>',
'amount' => 123,
'name' => '<string>',
'phone' => '<string>',
'linkExpiry' => '<string>',
'email' => '<string>',
'remarks' => '<string>',
'notifyCustomer' => true,
'payoutType' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: <content-type>"
],
]);
$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://payout-api.cashfree.com/payout/v1/createCashgram"
payload := strings.NewReader("{\n \"cashgramId\": \"<string>\",\n \"amount\": 123,\n \"name\": \"<string>\",\n \"phone\": \"<string>\",\n \"linkExpiry\": \"<string>\",\n \"email\": \"<string>\",\n \"remarks\": \"<string>\",\n \"notifyCustomer\": true,\n \"payoutType\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("Content-Type", "<content-type>")
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/createCashgram")
.header("Authorization", "<authorization>")
.header("Content-Type", "<content-type>")
.body("{\n \"cashgramId\": \"<string>\",\n \"amount\": 123,\n \"name\": \"<string>\",\n \"phone\": \"<string>\",\n \"linkExpiry\": \"<string>\",\n \"email\": \"<string>\",\n \"remarks\": \"<string>\",\n \"notifyCustomer\": true,\n \"payoutType\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://payout-api.cashfree.com/payout/v1/createCashgram")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = '<content-type>'
request.body = "{\n \"cashgramId\": \"<string>\",\n \"amount\": 123,\n \"name\": \"<string>\",\n \"phone\": \"<string>\",\n \"linkExpiry\": \"<string>\",\n \"email\": \"<string>\",\n \"remarks\": \"<string>\",\n \"notifyCustomer\": true,\n \"payoutType\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"status": "SUCCESS",
"subCode": "200",
"message": "Cashgram Created",
"data": {
"referenceId": 123456,
"cashgramLink": "http://csgr.am/abcdefg"
}
}{
"status": "ERROR",
"subCode": "409",
"message": "Cashgram with id JOHaN10 already exists"
}Create Cashgram
Use this API to create a Cashgram.
curl --request POST \
--url https://payout-api.cashfree.com/payout/v1/createCashgram \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"cashgramId": "<string>",
"amount": 123,
"name": "<string>",
"phone": "<string>",
"linkExpiry": "<string>",
"email": "<string>",
"remarks": "<string>",
"notifyCustomer": true,
"payoutType": "<string>"
}
'import requests
url = "https://payout-api.cashfree.com/payout/v1/createCashgram"
payload = {
"cashgramId": "<string>",
"amount": 123,
"name": "<string>",
"phone": "<string>",
"linkExpiry": "<string>",
"email": "<string>",
"remarks": "<string>",
"notifyCustomer": True,
"payoutType": "<string>"
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "<content-type>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': '<content-type>'},
body: JSON.stringify({
cashgramId: '<string>',
amount: 123,
name: '<string>',
phone: '<string>',
linkExpiry: '<string>',
email: '<string>',
remarks: '<string>',
notifyCustomer: true,
payoutType: '<string>'
})
};
fetch('https://payout-api.cashfree.com/payout/v1/createCashgram', 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/createCashgram",
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([
'cashgramId' => '<string>',
'amount' => 123,
'name' => '<string>',
'phone' => '<string>',
'linkExpiry' => '<string>',
'email' => '<string>',
'remarks' => '<string>',
'notifyCustomer' => true,
'payoutType' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: <content-type>"
],
]);
$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://payout-api.cashfree.com/payout/v1/createCashgram"
payload := strings.NewReader("{\n \"cashgramId\": \"<string>\",\n \"amount\": 123,\n \"name\": \"<string>\",\n \"phone\": \"<string>\",\n \"linkExpiry\": \"<string>\",\n \"email\": \"<string>\",\n \"remarks\": \"<string>\",\n \"notifyCustomer\": true,\n \"payoutType\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("Content-Type", "<content-type>")
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/createCashgram")
.header("Authorization", "<authorization>")
.header("Content-Type", "<content-type>")
.body("{\n \"cashgramId\": \"<string>\",\n \"amount\": 123,\n \"name\": \"<string>\",\n \"phone\": \"<string>\",\n \"linkExpiry\": \"<string>\",\n \"email\": \"<string>\",\n \"remarks\": \"<string>\",\n \"notifyCustomer\": true,\n \"payoutType\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://payout-api.cashfree.com/payout/v1/createCashgram")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = '<content-type>'
request.body = "{\n \"cashgramId\": \"<string>\",\n \"amount\": 123,\n \"name\": \"<string>\",\n \"phone\": \"<string>\",\n \"linkExpiry\": \"<string>\",\n \"email\": \"<string>\",\n \"remarks\": \"<string>\",\n \"notifyCustomer\": true,\n \"payoutType\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"status": "SUCCESS",
"subCode": "200",
"message": "Cashgram Created",
"data": {
"referenceId": 123456,
"cashgramLink": "http://csgr.am/abcdefg"
}
}{
"status": "ERROR",
"subCode": "409",
"message": "Cashgram with id JOHaN10 already exists"
}Body
Unique ID of the Cashgram. Alphanumeric, underscore (_), and hyphen (-) allowed (36 character limit).
Amount to be transferred, >= 1.00.
Name of the contact. Only alphabets (aāz, AāZ) and spaces are allowed. Digits and special characters (including . - / &) are not supported. Maximum 100 characters.
Phone number of the contact. Exactly 10 digits. Enter an Indian mobile number without the country code or +91 prefix.
Date to expire the Cashgram link, in the format YYYY/MM/DD. Maximum 31 days from the date of creation. Defaults to 7 days if omitted.
Email of the contact. String in email id format should contain @ and dot(.) - (200 character limit).
Specify remarks, if any. Only alphanumeric and whitespaces ( ) are allowed.
If value is 1, a link is sent to customers phone and email.
Specifies the type of payout to the customer. Only alphabets (aāz, AāZ) and spaces are allowed. Digits and special characters are not supported. Maximum 20 characters. Examples: Refund, Repayment. Validation errors for this field refer to it as type.
Response
200
Was this page helpful?