curl --request POST \
--url https://api.cashfree.com/ppi/wallet/credit \
--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 '
{
"credit_id": "CREDIT126345",
"user_id": "USER827364",
"wallet_id": "WALLET936721",
"cf_sub_wallet_id": "35246543210987654321",
"amount": 100.5,
"remarks": "Refund for order 123",
"notes": {
"example_key1": "example_value1",
"example_key2": "example_value2"
}
}
'import requests
url = "https://api.cashfree.com/ppi/wallet/credit"
payload = {
"credit_id": "CREDIT126345",
"user_id": "USER827364",
"wallet_id": "WALLET936721",
"cf_sub_wallet_id": "35246543210987654321",
"amount": 100.5,
"remarks": "Refund for order 123",
"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({
credit_id: 'CREDIT126345',
user_id: 'USER827364',
wallet_id: 'WALLET936721',
cf_sub_wallet_id: '35246543210987654321',
amount: 100.5,
remarks: 'Refund for order 123',
notes: {example_key1: 'example_value1', example_key2: 'example_value2'}
})
};
fetch('https://api.cashfree.com/ppi/wallet/credit', 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/credit",
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([
'credit_id' => 'CREDIT126345',
'user_id' => 'USER827364',
'wallet_id' => 'WALLET936721',
'cf_sub_wallet_id' => '35246543210987654321',
'amount' => 100.5,
'remarks' => 'Refund for order 123',
'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/credit"
payload := strings.NewReader("{\n \"credit_id\": \"CREDIT126345\",\n \"user_id\": \"USER827364\",\n \"wallet_id\": \"WALLET936721\",\n \"cf_sub_wallet_id\": \"35246543210987654321\",\n \"amount\": 100.5,\n \"remarks\": \"Refund for order 123\",\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/credit")
.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 \"credit_id\": \"CREDIT126345\",\n \"user_id\": \"USER827364\",\n \"wallet_id\": \"WALLET936721\",\n \"cf_sub_wallet_id\": \"35246543210987654321\",\n \"amount\": 100.5,\n \"remarks\": \"Refund for order 123\",\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/credit")
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 \"credit_id\": \"CREDIT126345\",\n \"user_id\": \"USER827364\",\n \"wallet_id\": \"WALLET936721\",\n \"cf_sub_wallet_id\": \"35246543210987654321\",\n \"amount\": 100.5,\n \"remarks\": \"Refund for order 123\",\n \"notes\": {\n \"example_key1\": \"example_value1\",\n \"example_key2\": \"example_value2\"\n }\n}"
response = http.request(request)
puts response.read_bodyCredit Wallet
Credits funds to a specified user sub-wallet, adding money to their available balance. Supports various sub-wallet types with behaviour determined by wallet configuration.
curl --request POST \
--url https://api.cashfree.com/ppi/wallet/credit \
--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 '
{
"credit_id": "CREDIT126345",
"user_id": "USER827364",
"wallet_id": "WALLET936721",
"cf_sub_wallet_id": "35246543210987654321",
"amount": 100.5,
"remarks": "Refund for order 123",
"notes": {
"example_key1": "example_value1",
"example_key2": "example_value2"
}
}
'import requests
url = "https://api.cashfree.com/ppi/wallet/credit"
payload = {
"credit_id": "CREDIT126345",
"user_id": "USER827364",
"wallet_id": "WALLET936721",
"cf_sub_wallet_id": "35246543210987654321",
"amount": 100.5,
"remarks": "Refund for order 123",
"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({
credit_id: 'CREDIT126345',
user_id: 'USER827364',
wallet_id: 'WALLET936721',
cf_sub_wallet_id: '35246543210987654321',
amount: 100.5,
remarks: 'Refund for order 123',
notes: {example_key1: 'example_value1', example_key2: 'example_value2'}
})
};
fetch('https://api.cashfree.com/ppi/wallet/credit', 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/credit",
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([
'credit_id' => 'CREDIT126345',
'user_id' => 'USER827364',
'wallet_id' => 'WALLET936721',
'cf_sub_wallet_id' => '35246543210987654321',
'amount' => 100.5,
'remarks' => 'Refund for order 123',
'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/credit"
payload := strings.NewReader("{\n \"credit_id\": \"CREDIT126345\",\n \"user_id\": \"USER827364\",\n \"wallet_id\": \"WALLET936721\",\n \"cf_sub_wallet_id\": \"35246543210987654321\",\n \"amount\": 100.5,\n \"remarks\": \"Refund for order 123\",\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/credit")
.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 \"credit_id\": \"CREDIT126345\",\n \"user_id\": \"USER827364\",\n \"wallet_id\": \"WALLET936721\",\n \"cf_sub_wallet_id\": \"35246543210987654321\",\n \"amount\": 100.5,\n \"remarks\": \"Refund for order 123\",\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/credit")
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 \"credit_id\": \"CREDIT126345\",\n \"user_id\": \"USER827364\",\n \"wallet_id\": \"WALLET936721\",\n \"cf_sub_wallet_id\": \"35246543210987654321\",\n \"amount\": 100.5,\n \"remarks\": \"Refund for order 123\",\n \"notes\": {\n \"example_key1\": \"example_value1\",\n \"example_key2\": \"example_value2\"\n }\n}"
response = http.request(request)
puts response.read_bodyAuthorizations
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 credit funds to a user's sub-wallet.
Unique identifier that you create to identify the credit transaction in your system. Only alphanumeric characters, periods (.), hyphens (-), and underscores (_) are allowed.
1 - 50"CREDIT126345"
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 which the amount will be credited. Only numeric characters are allowed.
1 - 19"35246543210987654321"
Amount to credit. Decimal values are allowed. The minimum value should be equal to or greater than 1.00 (>= 1.00).
100.5
Alphanumeric and whitespaces are allowed. The maximum character limit is 60.
"Refund for order #123"
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 crediting a wallet.
Unique identifier for the credit transaction, as provided by you during the credit request.
"CREDIT126345"
Unique identifier for the credit transaction, generated by Cashfree.
"8901234567890123456"
Unique identifier for the wallet, as provided by you during wallet creation.
"WALLET936721"
Unique identifier for the user, as provided by you during PPI user creation.
"USER827364"
Amount that was credited.
100.5
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Status of the credit operation.
"SUCCESS"
Remarks for the credit transaction.
"Refund for order 123"
Timestamp when the credit transaction was initiated.
"2025-09-02T10:15:30Z"
Timestamp when the credit transaction was processed.
"2025-09-02T10:20:45Z"
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
Was this page helpful?