Refund Transaction API

The Cancel Refund Transaction API (cancel_refund_transaction) can be used for the following purposes:

  • Cancel a transaction that is in ‘auth’ state at the moment.
  • Refund a transaction that is in a ‘captured’ state at the moment.

In this API, var1 is the Payu ID (mihpayid) of the transaction, var2 should contain the Token ID (unique token from the merchant), and var3 parameter should contain the amount which needs to be refunded.

Request parameters

ParameterDescriptionExample
keyThis parameter must contain the merchant key provided by PayU.
Reference: For more information on how to generate the Key and Salt, refer to any of the following:

Production: Generate Production Merchant Key and Salt
Test: Generate Test Merchant Key and Salt.
Your Test Key
commandThis parameter must have the API command name.cancel_refund_transaction
var1This parameter must contain the Payu ID (mihpayid) of the transaction. For more information on mihpayid, refer to the Post Parameters table.8000123
var2This parameter must contain the Token ID (unique token from the merchant) for the refund request. Token ID has to be generated at your end for each new refund request. It is an identifier for each new refund request which can be used for tracking it. It must be unique for every new refund request generated – otherwise the refund request would not be generated successfully.
Token ID length should not be greater than 23 characters7800456
var3For captured transaction:
This parameter must contain the amount which needs to be refunded. Both partial and full refunds are allowed.

For a partial refund, this var3 value would be less than the amount with which the transaction was made.
For a full refund: The var3 value would be equal to the amount with which the transaction was made.


For pre-auth transaction: 
If the transaction is in a pre-auth state currently, the full cancellation is allowed. The amount must be the same as the auth amount. A partial amount would not be allowed.
500
var4This parameter is for PayU internal Use only.
var5If a refund callback for a transaction is required on a specific URL, the URL must be specified in this parameter.
var6This parameter must contain the details of customer and funds need to be credited in a JSON format.
Note: This parameter is mandatory for instant refunds where the JSON format is similar to the following:
{"refund_mode":"2","be neficiary_full_name":""," beneficiary_account":"", "beneficiary_ifsc":""}.
hashThis parameter must contain the hash value to be calculated at your end. Following are the strings used for calculating the hash:
sha512(key|command|var1|salt
For more information on sha512, refer to
2a04a44ed058ca724a
17b4e4d4639aa15254a
343e0