curl -X POST https://api.razorpay.com/v1/transfers/trf_EAznuJ9cDLnF7Y/reversals \
-u [YOUR_KEY_ID]:[YOUR_KEY_SECRET]
-H 'content-type: application/json'
-d '{
"amount":100,
"notes":{
"branch":"Acme Corp Bangalore North",
"name":"Gaurav Kumar"
}
}'
RazorpayClient razorpay = new RazorpayClient("[YOUR_KEY_ID]", "[YOUR_KEY_SECRET]");
String transferId = "trf_EAznuJ9cDLnF7Y";
JSONObject transferRequest = new JSONObject();
transferRequest.put("amount","100");
JSONObject notes = new JSONObject();
notes.put("branch","Acme Corp Bangalore North");
notes.put("name","Gaurav Kumar");
transferParams.put("notes",notes);
Transfer transfer = razorpay.transfers.reversal(transferId,transferRequest);
$api = new Api($key_id, $secret);
$api->transfer->fetch($transferId)->reverse(array('amount'=>'100','notes' => array('branch' => 'Acme Corp Bangalore North','name' => 'Gaurav Kumar')));
var instance = new Razorpay({ key_id: 'YOUR_KEY_ID', key_secret: 'YOUR_SECRET' })
instance.transfers.reverse(transferId,{
amount:100,
notes: {
branch: "Acme Corp Bangalore North",
name: "Gaurav Kumar"
}
})
client = razorpay.Client(auth=("YOUR_ID", "YOUR_SECRET"))
client.transfer.reverse(transferId, {
"amount": 100,
"notes":{
"branch":"Acme Corp Bangalore North",
"name":"Gaurav Kumar"
}
})
require "razorpay"
Razorpay.setup('YOUR_KEY_ID', 'YOUR_SECRET')
transferId = "trf_EAznuJ9cDLnF7Y"
para_attr = {
"amount":100,
"notes": {
"branch": "Acme Corp Bangalore North",
"name": "Gaurav Kumar"
}
}
Razorpay::Transfer.fetch(transferId).reverse(para_attr)
import ( razorpay "github.com/razorpay/razorpay-go" )
client := razorpay.NewClient("YOUR_KEY_ID", "YOUR_SECRET")
data:= map[string]interface{}{
"amount": 100,
"notes": map[string]interface{}{
"branch": "Acme Corp Bangalore North",
"name": "Gaurav Kumar"
}
}
body, err := client.Transfer.Reverse("<transferId>", data, nil)
RazorpayClient client = new RazorpayClient("[YOUR_KEY_ID]", "[YOUR_KEY_SECRET]
");
string transferId = "trf_EAznuJ9cDLnF7Y";
Dictionary<string, object> transferRequest = new Dictionary<string, object>();
transferRequest.Add("amount","100");
Reversal transfer = client.Transfer.Fetch(transferId).Reversal(transferRequest);
razorpay route transfers reverse trf_JMNiqyuoFoJcXb \
--amount 100
curl -X POST https://api.razorpay.com/v1/transfers/trf_EAznuJ9cDLnF7Y/reversals \
-u [YOUR_KEY_ID]:[YOUR_KEY_SECRET]
-H 'content-type: application/json'
-d '{
"amount":100,
"notes":{
"branch":"Acme Corp Johor Bahru",
"name":"Nur Aisyah"
}
}'
RazorpayClient razorpay = new RazorpayClient("[YOUR_KEY_ID]", "[YOUR_KEY_SECRET]");
String transferId = "trf_EAznuJ9cDLnF7Y";
JSONObject transferRequest = new JSONObject();
transferRequest.put("amount","100");
JSONObject notes = new JSONObject();
notes.put("branch","Acme Corp Johor Bahru");
notes.put("name","Nur Aisyah");
transferParams.put("notes",notes);
Transfer transfer = razorpay.transfers.reversal(transferId,transferRequest);
$api = new Api($key_id, $secret);
$api->transfer->fetch($transferId)->reverse(array('amount'=>'100','notes' => array('branch' => 'Acme Corp Johor Bahru','name' => 'Nur Aisyah')));
var instance = new Razorpay({ key_id: 'YOUR_KEY_ID', key_secret: 'YOUR_SECRET' })
instance.transfers.reverse(transferId,{
amount:100,
notes: {
branch: "Acme Corp Johor Bahru",
name: "Nur Aisyah"
}
})
client = razorpay.Client(auth=("YOUR_ID", "YOUR_SECRET"))
client.transfer.reverse(transferId, {
"amount": 100,
"notes":{
"branch":"Acme Corp Johor Bahru",
"name":"Nur Aisyah"
}
})
require "razorpay"
Razorpay.setup('YOUR_KEY_ID', 'YOUR_SECRET')
transferId = "trf_EAznuJ9cDLnF7Y"
para_attr = {
"amount":100,
"notes": {
"branch": "Acme Corp Johor Bahru",
"name": "Nur Aisyah"
}
}
Razorpay::Transfer.fetch(transferId).reverse(para_attr)
import ( razorpay "github.com/razorpay/razorpay-go" )
client := razorpay.NewClient("YOUR_KEY_ID", "YOUR_SECRET")
data:= map[string]interface{}{
"amount": 100,
"notes": map[string]interface{}{
"branch": "Acme Corp Johor Bahru",
"name": "Nur Aisyah"
}
}
body, err := client.Transfer.Reverse("<transferId>", data, nil)
RazorpayClient client = new RazorpayClient("[YOUR_KEY_ID]", "[YOUR_KEY_SECRET]
");
string transferId = "trf_EAznuJ9cDLnF7Y";
Dictionary<string, object> transferRequest = new Dictionary<string, object>();
transferRequest.Add("amount","100");
Reversal transfer = client.Transfer.Fetch(transferId).Reversal(transferRequest);
razorpay route transfers reverse trf_JMNiqyuoFoJcXb \
--amount 100
{
"id": "rvrsl_EB0BWgGDAu7tOz",
"entity": "reversal",
"transfer_id": "trf_EAznuJ9cDLnF7Y",
"amount": 100,
"fee": 0,
"tax": 0,
"currency": "INR",
"notes": [],
"initiator_id": "CJoeHMNpi0nC7k",
"customer_refund_id": null,
"created_at": 1580456007
}
{
"error":{
"code":"BAD_REQUEST_ERROR",
"description":"The api key provided is invalid",
"source":"NA",
"step":"NA",
"reason":"NA",
"metadata":{
}
}
}
{
"id": "rvrsl_EB0BWgGDAu7tOz",
"entity": "reversal",
"transfer_id": "trf_EAznuJ9cDLnF7Y",
"amount": 100,
"fee": 0,
"tax": 0,
"currency": "MYR",
"notes": [],
"initiator_id": "CJoeHMNpi0nC7k",
"customer_refund_id": null,
"created_at": 1580456007
}
{
"error":{
"code":"BAD_REQUEST_ERROR",
"description":"The api key provided is invalid",
"source":"NA",
"step":"NA",
"reason":"NA",
"metadata":{
}
}
}
Route
Reverse a Transfer
Reverse a Transfer using the Razorpay API.
POST
/
v1
/
transfers
/
:id
/
reversals
curl -X POST https://api.razorpay.com/v1/transfers/trf_EAznuJ9cDLnF7Y/reversals \
-u [YOUR_KEY_ID]:[YOUR_KEY_SECRET]
-H 'content-type: application/json'
-d '{
"amount":100,
"notes":{
"branch":"Acme Corp Bangalore North",
"name":"Gaurav Kumar"
}
}'
RazorpayClient razorpay = new RazorpayClient("[YOUR_KEY_ID]", "[YOUR_KEY_SECRET]");
String transferId = "trf_EAznuJ9cDLnF7Y";
JSONObject transferRequest = new JSONObject();
transferRequest.put("amount","100");
JSONObject notes = new JSONObject();
notes.put("branch","Acme Corp Bangalore North");
notes.put("name","Gaurav Kumar");
transferParams.put("notes",notes);
Transfer transfer = razorpay.transfers.reversal(transferId,transferRequest);
$api = new Api($key_id, $secret);
$api->transfer->fetch($transferId)->reverse(array('amount'=>'100','notes' => array('branch' => 'Acme Corp Bangalore North','name' => 'Gaurav Kumar')));
var instance = new Razorpay({ key_id: 'YOUR_KEY_ID', key_secret: 'YOUR_SECRET' })
instance.transfers.reverse(transferId,{
amount:100,
notes: {
branch: "Acme Corp Bangalore North",
name: "Gaurav Kumar"
}
})
client = razorpay.Client(auth=("YOUR_ID", "YOUR_SECRET"))
client.transfer.reverse(transferId, {
"amount": 100,
"notes":{
"branch":"Acme Corp Bangalore North",
"name":"Gaurav Kumar"
}
})
require "razorpay"
Razorpay.setup('YOUR_KEY_ID', 'YOUR_SECRET')
transferId = "trf_EAznuJ9cDLnF7Y"
para_attr = {
"amount":100,
"notes": {
"branch": "Acme Corp Bangalore North",
"name": "Gaurav Kumar"
}
}
Razorpay::Transfer.fetch(transferId).reverse(para_attr)
import ( razorpay "github.com/razorpay/razorpay-go" )
client := razorpay.NewClient("YOUR_KEY_ID", "YOUR_SECRET")
data:= map[string]interface{}{
"amount": 100,
"notes": map[string]interface{}{
"branch": "Acme Corp Bangalore North",
"name": "Gaurav Kumar"
}
}
body, err := client.Transfer.Reverse("<transferId>", data, nil)
RazorpayClient client = new RazorpayClient("[YOUR_KEY_ID]", "[YOUR_KEY_SECRET]
");
string transferId = "trf_EAznuJ9cDLnF7Y";
Dictionary<string, object> transferRequest = new Dictionary<string, object>();
transferRequest.Add("amount","100");
Reversal transfer = client.Transfer.Fetch(transferId).Reversal(transferRequest);
razorpay route transfers reverse trf_JMNiqyuoFoJcXb \
--amount 100
curl -X POST https://api.razorpay.com/v1/transfers/trf_EAznuJ9cDLnF7Y/reversals \
-u [YOUR_KEY_ID]:[YOUR_KEY_SECRET]
-H 'content-type: application/json'
-d '{
"amount":100,
"notes":{
"branch":"Acme Corp Johor Bahru",
"name":"Nur Aisyah"
}
}'
RazorpayClient razorpay = new RazorpayClient("[YOUR_KEY_ID]", "[YOUR_KEY_SECRET]");
String transferId = "trf_EAznuJ9cDLnF7Y";
JSONObject transferRequest = new JSONObject();
transferRequest.put("amount","100");
JSONObject notes = new JSONObject();
notes.put("branch","Acme Corp Johor Bahru");
notes.put("name","Nur Aisyah");
transferParams.put("notes",notes);
Transfer transfer = razorpay.transfers.reversal(transferId,transferRequest);
$api = new Api($key_id, $secret);
$api->transfer->fetch($transferId)->reverse(array('amount'=>'100','notes' => array('branch' => 'Acme Corp Johor Bahru','name' => 'Nur Aisyah')));
var instance = new Razorpay({ key_id: 'YOUR_KEY_ID', key_secret: 'YOUR_SECRET' })
instance.transfers.reverse(transferId,{
amount:100,
notes: {
branch: "Acme Corp Johor Bahru",
name: "Nur Aisyah"
}
})
client = razorpay.Client(auth=("YOUR_ID", "YOUR_SECRET"))
client.transfer.reverse(transferId, {
"amount": 100,
"notes":{
"branch":"Acme Corp Johor Bahru",
"name":"Nur Aisyah"
}
})
require "razorpay"
Razorpay.setup('YOUR_KEY_ID', 'YOUR_SECRET')
transferId = "trf_EAznuJ9cDLnF7Y"
para_attr = {
"amount":100,
"notes": {
"branch": "Acme Corp Johor Bahru",
"name": "Nur Aisyah"
}
}
Razorpay::Transfer.fetch(transferId).reverse(para_attr)
import ( razorpay "github.com/razorpay/razorpay-go" )
client := razorpay.NewClient("YOUR_KEY_ID", "YOUR_SECRET")
data:= map[string]interface{}{
"amount": 100,
"notes": map[string]interface{}{
"branch": "Acme Corp Johor Bahru",
"name": "Nur Aisyah"
}
}
body, err := client.Transfer.Reverse("<transferId>", data, nil)
RazorpayClient client = new RazorpayClient("[YOUR_KEY_ID]", "[YOUR_KEY_SECRET]
");
string transferId = "trf_EAznuJ9cDLnF7Y";
Dictionary<string, object> transferRequest = new Dictionary<string, object>();
transferRequest.Add("amount","100");
Reversal transfer = client.Transfer.Fetch(transferId).Reversal(transferRequest);
razorpay route transfers reverse trf_JMNiqyuoFoJcXb \
--amount 100
{
"id": "rvrsl_EB0BWgGDAu7tOz",
"entity": "reversal",
"transfer_id": "trf_EAznuJ9cDLnF7Y",
"amount": 100,
"fee": 0,
"tax": 0,
"currency": "INR",
"notes": [],
"initiator_id": "CJoeHMNpi0nC7k",
"customer_refund_id": null,
"created_at": 1580456007
}
{
"error":{
"code":"BAD_REQUEST_ERROR",
"description":"The api key provided is invalid",
"source":"NA",
"step":"NA",
"reason":"NA",
"metadata":{
}
}
}
{
"id": "rvrsl_EB0BWgGDAu7tOz",
"entity": "reversal",
"transfer_id": "trf_EAznuJ9cDLnF7Y",
"amount": 100,
"fee": 0,
"tax": 0,
"currency": "MYR",
"notes": [],
"initiator_id": "CJoeHMNpi0nC7k",
"customer_refund_id": null,
"created_at": 1580456007
}
{
"error":{
"code":"BAD_REQUEST_ERROR",
"description":"The api key provided is invalid",
"source":"NA",
"step":"NA",
"reason":"NA",
"metadata":{
}
}
}
Available in🇮🇳 India🇸🇬 Singapore🇺🇸 United States
Use this endpoint to create reversals on a particular transfer_id.
- The amount specified is debited from the Linked Account balance and credited to your balance.
-
Partial reversals are also supported, and you can create multiple reversals on a
transfer_id. If you do not provide theamountparameter in the request, then the entire amount of the transfer is reversed.
Handy Tips
If a reversal ID is generated, the reversal was successful.
curl -X POST https://api.razorpay.com/v1/transfers/trf_EAznuJ9cDLnF7Y/reversals \
-u [YOUR_KEY_ID]:[YOUR_KEY_SECRET]
-H 'content-type: application/json'
-d '{
"amount":100,
"notes":{
"branch":"Acme Corp Bangalore North",
"name":"Gaurav Kumar"
}
}'
RazorpayClient razorpay = new RazorpayClient("[YOUR_KEY_ID]", "[YOUR_KEY_SECRET]");
String transferId = "trf_EAznuJ9cDLnF7Y";
JSONObject transferRequest = new JSONObject();
transferRequest.put("amount","100");
JSONObject notes = new JSONObject();
notes.put("branch","Acme Corp Bangalore North");
notes.put("name","Gaurav Kumar");
transferParams.put("notes",notes);
Transfer transfer = razorpay.transfers.reversal(transferId,transferRequest);
$api = new Api($key_id, $secret);
$api->transfer->fetch($transferId)->reverse(array('amount'=>'100','notes' => array('branch' => 'Acme Corp Bangalore North','name' => 'Gaurav Kumar')));
var instance = new Razorpay({ key_id: 'YOUR_KEY_ID', key_secret: 'YOUR_SECRET' })
instance.transfers.reverse(transferId,{
amount:100,
notes: {
branch: "Acme Corp Bangalore North",
name: "Gaurav Kumar"
}
})
client = razorpay.Client(auth=("YOUR_ID", "YOUR_SECRET"))
client.transfer.reverse(transferId, {
"amount": 100,
"notes":{
"branch":"Acme Corp Bangalore North",
"name":"Gaurav Kumar"
}
})
require "razorpay"
Razorpay.setup('YOUR_KEY_ID', 'YOUR_SECRET')
transferId = "trf_EAznuJ9cDLnF7Y"
para_attr = {
"amount":100,
"notes": {
"branch": "Acme Corp Bangalore North",
"name": "Gaurav Kumar"
}
}
Razorpay::Transfer.fetch(transferId).reverse(para_attr)
import ( razorpay "github.com/razorpay/razorpay-go" )
client := razorpay.NewClient("YOUR_KEY_ID", "YOUR_SECRET")
data:= map[string]interface{}{
"amount": 100,
"notes": map[string]interface{}{
"branch": "Acme Corp Bangalore North",
"name": "Gaurav Kumar"
}
}
body, err := client.Transfer.Reverse("<transferId>", data, nil)
RazorpayClient client = new RazorpayClient("[YOUR_KEY_ID]", "[YOUR_KEY_SECRET]
");
string transferId = "trf_EAznuJ9cDLnF7Y";
Dictionary<string, object> transferRequest = new Dictionary<string, object>();
transferRequest.Add("amount","100");
Reversal transfer = client.Transfer.Fetch(transferId).Reversal(transferRequest);
razorpay route transfers reverse trf_JMNiqyuoFoJcXb \
--amount 100
curl -X POST https://api.razorpay.com/v1/transfers/trf_EAznuJ9cDLnF7Y/reversals \
-u [YOUR_KEY_ID]:[YOUR_KEY_SECRET]
-H 'content-type: application/json'
-d '{
"amount":100,
"notes":{
"branch":"Acme Corp Johor Bahru",
"name":"Nur Aisyah"
}
}'
RazorpayClient razorpay = new RazorpayClient("[YOUR_KEY_ID]", "[YOUR_KEY_SECRET]");
String transferId = "trf_EAznuJ9cDLnF7Y";
JSONObject transferRequest = new JSONObject();
transferRequest.put("amount","100");
JSONObject notes = new JSONObject();
notes.put("branch","Acme Corp Johor Bahru");
notes.put("name","Nur Aisyah");
transferParams.put("notes",notes);
Transfer transfer = razorpay.transfers.reversal(transferId,transferRequest);
$api = new Api($key_id, $secret);
$api->transfer->fetch($transferId)->reverse(array('amount'=>'100','notes' => array('branch' => 'Acme Corp Johor Bahru','name' => 'Nur Aisyah')));
var instance = new Razorpay({ key_id: 'YOUR_KEY_ID', key_secret: 'YOUR_SECRET' })
instance.transfers.reverse(transferId,{
amount:100,
notes: {
branch: "Acme Corp Johor Bahru",
name: "Nur Aisyah"
}
})
client = razorpay.Client(auth=("YOUR_ID", "YOUR_SECRET"))
client.transfer.reverse(transferId, {
"amount": 100,
"notes":{
"branch":"Acme Corp Johor Bahru",
"name":"Nur Aisyah"
}
})
require "razorpay"
Razorpay.setup('YOUR_KEY_ID', 'YOUR_SECRET')
transferId = "trf_EAznuJ9cDLnF7Y"
para_attr = {
"amount":100,
"notes": {
"branch": "Acme Corp Johor Bahru",
"name": "Nur Aisyah"
}
}
Razorpay::Transfer.fetch(transferId).reverse(para_attr)
import ( razorpay "github.com/razorpay/razorpay-go" )
client := razorpay.NewClient("YOUR_KEY_ID", "YOUR_SECRET")
data:= map[string]interface{}{
"amount": 100,
"notes": map[string]interface{}{
"branch": "Acme Corp Johor Bahru",
"name": "Nur Aisyah"
}
}
body, err := client.Transfer.Reverse("<transferId>", data, nil)
RazorpayClient client = new RazorpayClient("[YOUR_KEY_ID]", "[YOUR_KEY_SECRET]
");
string transferId = "trf_EAznuJ9cDLnF7Y";
Dictionary<string, object> transferRequest = new Dictionary<string, object>();
transferRequest.Add("amount","100");
Reversal transfer = client.Transfer.Fetch(transferId).Reversal(transferRequest);
razorpay route transfers reverse trf_JMNiqyuoFoJcXb \
--amount 100
{
"id": "rvrsl_EB0BWgGDAu7tOz",
"entity": "reversal",
"transfer_id": "trf_EAznuJ9cDLnF7Y",
"amount": 100,
"fee": 0,
"tax": 0,
"currency": "INR",
"notes": [],
"initiator_id": "CJoeHMNpi0nC7k",
"customer_refund_id": null,
"created_at": 1580456007
}
{
"error":{
"code":"BAD_REQUEST_ERROR",
"description":"The api key provided is invalid",
"source":"NA",
"step":"NA",
"reason":"NA",
"metadata":{
}
}
}
{
"id": "rvrsl_EB0BWgGDAu7tOz",
"entity": "reversal",
"transfer_id": "trf_EAznuJ9cDLnF7Y",
"amount": 100,
"fee": 0,
"tax": 0,
"currency": "MYR",
"notes": [],
"initiator_id": "CJoeHMNpi0nC7k",
"customer_refund_id": null,
"created_at": 1580456007
}
{
"error":{
"code":"BAD_REQUEST_ERROR",
"description":"The api key provided is invalid",
"source":"NA",
"step":"NA",
"reason":"NA",
"metadata":{
}
}
}
Path Parameters
string
required
Unique identifier of the transfer to be reversed.
Request Parameters
integer
The amount to be reversed from the Linked Account to your account. If this parameter is not passed, the entire transfer amount will be reversed.
json object
Set of key-value pairs that can be associated with an entity. These pairs can be useful for storing additional information about the entity. A maximum of 15 key-value pairs, each of 256 characters (maximum), are supported. For example,
"region": "south", "city": "Bangalore".Response Parameters
string
The unique identifier of the reversal.
string
The name of the entity. Here, it is
reversal.string
The unique identifier of the transfer that was reversed.
integer
The amount that was reversed, in paise.
string
ISO currency code. We support route reversals only in INR.
integer
Timestamp in Unix. This indicates the time at which the reversal was created.
Errors
The api key/secret provided is invalid
The api key/secret provided is invalid
Code:
4xxThis error occurs when there is a mismatch between the API credentials passed in the API call and the API credentials generated on the Dashboard.Solution: Make sure the API Keys are active and entered correctly. Also, there should not be any whitespaces before or after the keys.The amount must be at least INR 1.00
The amount must be at least INR 1.00
Code:
400This error occurs when the amount is less than the minimum amount. The transaction amount expressed in the currency subunit, such as paise (in INR) should always be greater than or equal to ₹1.Solution: Make sure the amount is equal to or greater than the minimum amount of ₹1.transfer_id is not a valid id
transfer_id is not a valid id
Code:
400This error occurs when you pass an invalid transfer_id in the API endpoint.Solution: Make sure to pass a vaild transfer_id.The linked account does not have sufficient balance to process reversal.
The linked account does not have sufficient balance to process reversal.
Code:
400Insufficient balance in the linked account to complete the reversal.Solution: Ensure that you have sufficient balance in your linked account to complete the reversal.Was this page helpful?