Route
Refund Payments and Reverse Transfer from a Linked Account
Refund Payments and reverse Transfer from a Linked Account using the Razorpay API.
POST
Use this endpoint to create refunds on a particular
payment_id.
-
The amount is deducted from your main account balance when refunding a payment. You can set the
reverse_allparameter totruein the refund POST request to recover the amount from the Linked Account. This will recover the amount for every transfer made on the payment before processing the refund to the customer. -
You can automate reversals with the
reverse_allparameter in the following refund scenarios:- Full refund
- Partial refund for a payment transferred to a single account.
reversal entity is created internally and linked for every reversal defined by the transfer_id.
Path Parameters
string
required
A unique identifier of the payment that should be refunded.
Request Parameters
string
required
The amount of refund in the smallest unit of currency. For example, for an amount of ₹200.35, the value of this field should be 20035.
boolean
Reverses transfer made to a linked account. Possible values:
true: Reverses transfer made to a linked account.false: Does not reverse transfer made to a linked account.
Response Parameters
string
Unique identifier of the refund.
string
Indicates the type of entity. Here, it is
refund.integer
The amount of refund in the smallest unit of currency. For example, for an amount of ₹200.35, the value of this field should be 20035.
string
The currency of refund. Currently, only INR is supported.
string
Unique identifier of the payment for which this refund has been requested.
integer
Timestamp, in Unix, of refund creation.
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.
string
Unique identifier that you can use for internal reference.
array
A dynamic array consisting of a unique reference number (either RRN, ARN or UTR) that is provided by the banking partner when a refund is processed. This reference number can be used by the customer to track the status of the refund with the bank.
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 sum of amount requested for refund is greater than the available amount
The sum of amount requested for refund is greater than the available amount
Code:
400This error occurs when the total transferred amount exceeds the payment amount.Solution: Make sure to check the amount passed with the payment made.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.payment_id is not a valid id
payment_id is not a valid id
Code:
400This error occurs when you pass an invalid payment_id in the API endpoint.Solution: Make sure to pass a vaild payment_id.