curl --request POST \
--url https://api.cashfree.com/ppi/wallet/closure \
--header 'Content-Type: application/json' \
--header 'x-api-version: <x-api-version>' \
--header 'x-client-id: <api-key>' \
--header 'x-client-secret: <api-key>' \
--data '
{
"closure_id": "CLOSURE420984",
"user_id": "USER827364",
"wallet_id": "WALLET936721",
"cf_sub_wallet_id": "35246543210987654321",
"remarks": "Wallet Closure",
"notes": {
"example_key1": "example_value1",
"example_key2": "example_value2"
}
}
'import requests
url = "https://api.cashfree.com/ppi/wallet/closure"
payload = {
"closure_id": "CLOSURE420984",
"user_id": "USER827364",
"wallet_id": "WALLET936721",
"cf_sub_wallet_id": "35246543210987654321",
"remarks": "Wallet Closure",
"notes": {
"example_key1": "example_value1",
"example_key2": "example_value2"
}
}
headers = {
"x-api-version": "<x-api-version>",
"x-client-id": "<api-key>",
"x-client-secret": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-api-version': '<x-api-version>',
'x-client-id': '<api-key>',
'x-client-secret': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
closure_id: 'CLOSURE420984',
user_id: 'USER827364',
wallet_id: 'WALLET936721',
cf_sub_wallet_id: '35246543210987654321',
remarks: 'Wallet Closure',
notes: {example_key1: 'example_value1', example_key2: 'example_value2'}
})
};
fetch('https://api.cashfree.com/ppi/wallet/closure', 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://api.cashfree.com/ppi/wallet/closure",
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([
'closure_id' => 'CLOSURE420984',
'user_id' => 'USER827364',
'wallet_id' => 'WALLET936721',
'cf_sub_wallet_id' => '35246543210987654321',
'remarks' => 'Wallet Closure',
'notes' => [
'example_key1' => 'example_value1',
'example_key2' => 'example_value2'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-version: <x-api-version>",
"x-client-id: <api-key>",
"x-client-secret: <api-key>"
],
]);
$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://api.cashfree.com/ppi/wallet/closure"
payload := strings.NewReader("{\n \"closure_id\": \"CLOSURE420984\",\n \"user_id\": \"USER827364\",\n \"wallet_id\": \"WALLET936721\",\n \"cf_sub_wallet_id\": \"35246543210987654321\",\n \"remarks\": \"Wallet Closure\",\n \"notes\": {\n \"example_key1\": \"example_value1\",\n \"example_key2\": \"example_value2\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-version", "<x-api-version>")
req.Header.Add("x-client-id", "<api-key>")
req.Header.Add("x-client-secret", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.cashfree.com/ppi/wallet/closure")
.header("x-api-version", "<x-api-version>")
.header("x-client-id", "<api-key>")
.header("x-client-secret", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"closure_id\": \"CLOSURE420984\",\n \"user_id\": \"USER827364\",\n \"wallet_id\": \"WALLET936721\",\n \"cf_sub_wallet_id\": \"35246543210987654321\",\n \"remarks\": \"Wallet Closure\",\n \"notes\": {\n \"example_key1\": \"example_value1\",\n \"example_key2\": \"example_value2\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cashfree.com/ppi/wallet/closure")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-version"] = '<x-api-version>'
request["x-client-id"] = '<api-key>'
request["x-client-secret"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"closure_id\": \"CLOSURE420984\",\n \"user_id\": \"USER827364\",\n \"wallet_id\": \"WALLET936721\",\n \"cf_sub_wallet_id\": \"35246543210987654321\",\n \"remarks\": \"Wallet Closure\",\n \"notes\": {\n \"example_key1\": \"example_value1\",\n \"example_key2\": \"example_value2\"\n }\n}"
response = http.request(request)
puts response.read_body{
"closure_id": "CLOSURE420984",
"user_id": "USER827364",
"cf_closure_id": "8901234567890123456",
"wallet_id": "WALLET936721",
"sub_wallet": {
"cf_sub_wallet_id": "35246543210987654321",
"name": "Gift Wallet",
"type": "GIFT_PPI",
"status": "CLOSED",
"balance": 0,
"available_balance": 0,
"funds_on_hold": 0
},
"status": "SUCCESS",
"remarks": "Wallet Closure",
"notes": {
"example_key1": "example_value1",
"example_key2": "example_value2"
},
"initiated_at": "2025-07-28T10:30:00Z",
"processed_at": "2025-07-28T10:30:00Z"
}Close Wallet
Closes a user’s sub-wallet, making it inactive for future transactions. The closure process may require approval depending on the sub-wallet type and business rules:
- Any remaining balance is handled according to the configured closure policy.
curl --request POST \
--url https://api.cashfree.com/ppi/wallet/closure \
--header 'Content-Type: application/json' \
--header 'x-api-version: <x-api-version>' \
--header 'x-client-id: <api-key>' \
--header 'x-client-secret: <api-key>' \
--data '
{
"closure_id": "CLOSURE420984",
"user_id": "USER827364",
"wallet_id": "WALLET936721",
"cf_sub_wallet_id": "35246543210987654321",
"remarks": "Wallet Closure",
"notes": {
"example_key1": "example_value1",
"example_key2": "example_value2"
}
}
'import requests
url = "https://api.cashfree.com/ppi/wallet/closure"
payload = {
"closure_id": "CLOSURE420984",
"user_id": "USER827364",
"wallet_id": "WALLET936721",
"cf_sub_wallet_id": "35246543210987654321",
"remarks": "Wallet Closure",
"notes": {
"example_key1": "example_value1",
"example_key2": "example_value2"
}
}
headers = {
"x-api-version": "<x-api-version>",
"x-client-id": "<api-key>",
"x-client-secret": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-api-version': '<x-api-version>',
'x-client-id': '<api-key>',
'x-client-secret': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
closure_id: 'CLOSURE420984',
user_id: 'USER827364',
wallet_id: 'WALLET936721',
cf_sub_wallet_id: '35246543210987654321',
remarks: 'Wallet Closure',
notes: {example_key1: 'example_value1', example_key2: 'example_value2'}
})
};
fetch('https://api.cashfree.com/ppi/wallet/closure', 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://api.cashfree.com/ppi/wallet/closure",
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([
'closure_id' => 'CLOSURE420984',
'user_id' => 'USER827364',
'wallet_id' => 'WALLET936721',
'cf_sub_wallet_id' => '35246543210987654321',
'remarks' => 'Wallet Closure',
'notes' => [
'example_key1' => 'example_value1',
'example_key2' => 'example_value2'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-version: <x-api-version>",
"x-client-id: <api-key>",
"x-client-secret: <api-key>"
],
]);
$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://api.cashfree.com/ppi/wallet/closure"
payload := strings.NewReader("{\n \"closure_id\": \"CLOSURE420984\",\n \"user_id\": \"USER827364\",\n \"wallet_id\": \"WALLET936721\",\n \"cf_sub_wallet_id\": \"35246543210987654321\",\n \"remarks\": \"Wallet Closure\",\n \"notes\": {\n \"example_key1\": \"example_value1\",\n \"example_key2\": \"example_value2\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-version", "<x-api-version>")
req.Header.Add("x-client-id", "<api-key>")
req.Header.Add("x-client-secret", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.cashfree.com/ppi/wallet/closure")
.header("x-api-version", "<x-api-version>")
.header("x-client-id", "<api-key>")
.header("x-client-secret", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"closure_id\": \"CLOSURE420984\",\n \"user_id\": \"USER827364\",\n \"wallet_id\": \"WALLET936721\",\n \"cf_sub_wallet_id\": \"35246543210987654321\",\n \"remarks\": \"Wallet Closure\",\n \"notes\": {\n \"example_key1\": \"example_value1\",\n \"example_key2\": \"example_value2\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cashfree.com/ppi/wallet/closure")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-version"] = '<x-api-version>'
request["x-client-id"] = '<api-key>'
request["x-client-secret"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"closure_id\": \"CLOSURE420984\",\n \"user_id\": \"USER827364\",\n \"wallet_id\": \"WALLET936721\",\n \"cf_sub_wallet_id\": \"35246543210987654321\",\n \"remarks\": \"Wallet Closure\",\n \"notes\": {\n \"example_key1\": \"example_value1\",\n \"example_key2\": \"example_value2\"\n }\n}"
response = http.request(request)
puts response.read_body{
"closure_id": "CLOSURE420984",
"user_id": "USER827364",
"cf_closure_id": "8901234567890123456",
"wallet_id": "WALLET936721",
"sub_wallet": {
"cf_sub_wallet_id": "35246543210987654321",
"name": "Gift Wallet",
"type": "GIFT_PPI",
"status": "CLOSED",
"balance": 0,
"available_balance": 0,
"funds_on_hold": 0
},
"status": "SUCCESS",
"remarks": "Wallet Closure",
"notes": {
"example_key1": "example_value1",
"example_key2": "example_value2"
},
"initiated_at": "2025-07-28T10:30:00Z",
"processed_at": "2025-07-28T10:30:00Z"
}Closure Status Descriptions
Closure Status Descriptions
| Status | Description |
|---|---|
SUCCESS | The wallet closure has been processed successfully and the sub-wallet is now inactive. All remaining balance has been handled according to the closure policy. |
PENDING | The closure request has been accepted and is currently being processed. |
APPROVAL_PENDING | The closure request requires manual approval. |
Authorizations
Your unique client identifier issued by Cashfree. You can find this in your Merchant Dashboard.
The secret key associated with your client ID. Use this to authenticate your API requests. You can find this in your Merchant Dashboard.
Headers
API version to be used. Format is in YYYY-MM-DD.
"2025-11-01"
Body
Request parameters to close a user's wallet.
Unique identifier that you create to identify the closure transaction in your system. Only alphanumeric characters, periods (.), hyphens (-), and underscores (_) are allowed.
1 - 50"CLOSURE420984"
Unique identifier for the user, as provided by you during PPI user creation. Only alphanumeric characters, periods (.), hyphens (-), and underscores (_) are allowed.
1 - 50"USER827364"
Unique identifier for the wallet, as provided by you during wallet creation. Only alphanumeric characters, periods (.), hyphens (-), and underscores (_) are allowed.
1 - 50"WALLET936721"
Unique identifier of the sub-wallet to be closed. Only numeric characters are allowed.
1 - 19"35246543210987654321"
Additional remarks for the closure request. Alphanumeric and whitespaces are allowed. The maximum character limit is 60.
60"Wallet Closure"
Optional key-value pairs for any extra information. Keys and values must be strings. The following constraints apply:
- Maximum 10 entries.
- Keys: maximum 50 characters. Alphanumeric characters, underscores (_), periods (.), commas (,), single quotes ('), ampersands (&), hyphens (-), and spaces are allowed.
- Values: maximum 200 characters. Same character set as keys.
Show child attributes
Show child attributes
Response
Success response for closing a wallet.
Unique identifier for the closure transaction, as provided by you during the closure request.
"CLOSURE420984"
Unique identifier for the user, as provided by you during PPI user creation.
"USER827364"
Unique identifier for the closure transaction, generated by Cashfree.
"8901234567890123456"
Primary wallet ID from which the sub-wallet is being closed.
"WALLET936721"
Show child attributes
Show child attributes
Status of the refund operation:
SUCCESS: Closure has been processed successfully.PENDING: Closure is being processed and will be completed shortlyAPPROVAL_PENDING: closure requires manual approval
SUCCESS, PENDING, APPROVAL_PENDING "SUCCESS"
Remarks for the closure transaction.
"Wallet Closure"
Optional key-value pairs for any extra information. Keys and values must be strings. The following constraints apply:
- Maximum 10 entries.
- Keys: maximum 50 characters. Alphanumeric characters, underscores (_), periods (.), commas (,), single quotes ('), ampersands (&), hyphens (-), and spaces are allowed.
- Values: maximum 200 characters. Same character set as keys.
Show child attributes
Show child attributes
Timestamp when the closure transaction was initiated.
"2025-07-28T10:30:00Z"
Timestamp when the closure transaction was processed. Null if still pending.
"2025-07-28T10:30:00Z"
Was this page helpful?