Create 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
}
'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
}
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
})
};
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
]),
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}")
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}")
.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}"
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.
POST
/
payout
/
v1
/
createCashgram
Create 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
}
'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
}
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
})
};
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
]),
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}")
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}")
.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}"
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
application/json
Unique Id of the Cashgram. Alphanumeric, underscore (_), and hyphen (-) allowed (35 character limit)
Amount to be transferred, >= 1.00
Name of the contact
Phone number of the contact
Date to expire the cashgram link, Date format YYYY/MM/DD, maximum 30 days from the date of creation.
Email of the contact
Specify remarks, if any.
If value is 1, a link is sent to customers phone and email.
⌘I
