Self Withdrawal
curl --request POST \
--url https://payout-api.cashfree.com/payout/v1/selfWithdrawal \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"withdrawalId": "<string>",
"amount": 123,
"remarks": "<string>"
}
'import requests
url = "https://payout-api.cashfree.com/payout/v1/selfWithdrawal"
payload = {
"withdrawalId": "<string>",
"amount": 123,
"remarks": "<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({withdrawalId: '<string>', amount: 123, remarks: '<string>'})
};
fetch('https://payout-api.cashfree.com/payout/v1/selfWithdrawal', 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/selfWithdrawal",
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([
'withdrawalId' => '<string>',
'amount' => 123,
'remarks' => '<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/selfWithdrawal"
payload := strings.NewReader("{\n \"withdrawalId\": \"<string>\",\n \"amount\": 123,\n \"remarks\": \"<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/selfWithdrawal")
.header("Authorization", "<authorization>")
.header("Content-Type", "<content-type>")
.body("{\n \"withdrawalId\": \"<string>\",\n \"amount\": 123,\n \"remarks\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://payout-api.cashfree.com/payout/v1/selfWithdrawal")
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 \"withdrawalId\": \"<string>\",\n \"amount\": 123,\n \"remarks\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"status": "SUCCESS",
"message": "Request submitted successfully. Withdrawal Id : W55",
"statusCode": "200"
}{}{
"status": "ERROR",
"subCode": "403",
"message": "APIs not enabled. Please fill out the [Support Form](https://merchant.cashfree.com/merchants/landing?env=prod&raise_issue=1)"
}Account
Self Withdrawal
Use this API to request a self withdrawal at Cashfree. Self withdrawal is allowed a maximum of 3 times a day. The API response will either result in an ERROR or SUCCESS response. The status of the withdrawal request is available on the dashboard.
POST
/
payout
/
v1
/
selfWithdrawal
Self Withdrawal
curl --request POST \
--url https://payout-api.cashfree.com/payout/v1/selfWithdrawal \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"withdrawalId": "<string>",
"amount": 123,
"remarks": "<string>"
}
'import requests
url = "https://payout-api.cashfree.com/payout/v1/selfWithdrawal"
payload = {
"withdrawalId": "<string>",
"amount": 123,
"remarks": "<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({withdrawalId: '<string>', amount: 123, remarks: '<string>'})
};
fetch('https://payout-api.cashfree.com/payout/v1/selfWithdrawal', 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/selfWithdrawal",
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([
'withdrawalId' => '<string>',
'amount' => 123,
'remarks' => '<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/selfWithdrawal"
payload := strings.NewReader("{\n \"withdrawalId\": \"<string>\",\n \"amount\": 123,\n \"remarks\": \"<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/selfWithdrawal")
.header("Authorization", "<authorization>")
.header("Content-Type", "<content-type>")
.body("{\n \"withdrawalId\": \"<string>\",\n \"amount\": 123,\n \"remarks\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://payout-api.cashfree.com/payout/v1/selfWithdrawal")
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 \"withdrawalId\": \"<string>\",\n \"amount\": 123,\n \"remarks\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"status": "SUCCESS",
"message": "Request submitted successfully. Withdrawal Id : W55",
"statusCode": "200"
}{}{
"status": "ERROR",
"subCode": "403",
"message": "APIs not enabled. Please fill out the [Support Form](https://merchant.cashfree.com/merchants/landing?env=prod&raise_issue=1)"
}Please use this Authorization token in headers to call any payout API (Refresh this page if the token is expired)
Click to view the response codes.
Click to view the response codes.
| Sub code | Status | Message | Next action |
|---|---|---|---|
| 200 | SUCCESS | - | |
| 403 | ERROR | Token is not valid | Verify the generated token. |
| 412 | ERROR | withdrawalId missing in the request | Enter a withdrawal ID. |
| 412 | ERROR | Token missing in the request | Enter the generated token as the value for Authorization under Headers |
Body
application/json
Was this page helpful?
⌘I