Skip to main content
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,
  "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"
}

Headers

Authorization
string
required

Bearer auth token

Content-Type
string
required

application/json

Body

application/json
cashgramId
string
required

Unique ID of the Cashgram. Alphanumeric, underscore (_), and hyphen (-) allowed (35 character limit).

amount
number<float>
required

Amount to be transferred, >= 1.00.

name
string
required

Name of the contact. Only alphanumeric, whitespace ( ), period (.), hyphen ( - ), slash (/), and ampersand ( & ) are allowed - (100 character limit).

phone
string
required

Phone number of the contact. Phone number registered in India (only digits, 8 - 12 characters after stripping +91).

Date to expire the cashgram link, Date format YYYY/MM/DD, maximum 30 days from the date of creation.

email
string

Email of the contact. String in email id format should contain @ and dot(.) - (200 character limit).

remarks
string

Specify remarks, if any. Only alphanumeric and whitespaces ( ) are allowed.

notifyCustomer
boolean

If value is 1, a link is sent to customers phone and email.

payoutType
string

Specifies the type of payout to the customer. Example: Refund, Repayment, etc.

Response

200

status
string

It represents the status of the API request.

Example:

"SUCCESS"

subCode
string

It represents the subcode of the API request.

Example:

"200"

message
string

It displays details about the success or failure of the API request.

Example:

"Cashgram Created"

data
object