Refund Transaction API

API Command: cancel_refund_transaction

The 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.

To learn more about different payment states, refer to Payment States Explanations.

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 that needs to be refunded.

Environment

Reference information for request parameters

ParameterReference
keyFor more information on how to generate the Key and Salt, refer to any of the following:

- Production: Generate Merchant Key and Salt
- Test: Generate Test Merchant Key and Salt
hashHash logic for this API is:
sha512(key|command|var1|salt)
sha512

Other request parameters

Other request parameters used for Refund Transaction API (which are not in Request parameters section) are listed in the following table:

ParameterDescription
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":""}

Response parameters

For the response parameters, refer to Additional Info for General APIs.

📘

Notes:

  • The response for Refund Transaction API in Test Environment is similar to the following as it is the limitation with Test Environment:
{
  "status": 236,
  "msg": "Refund Split Info must be of JSON format",
  "mihpayid": "403993715521937565"
}

Request parameters

Example values

Use the following sample values while trying out the API:

  • var1 (mihpayid): 403993715521937565
  • var2 (reference number for a refund provided by merchant): 20201105secrettokenaturend
Language
Click Try It! to start a request and see the response here!