post https://test.payu.in/merchant/postservice.php
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
Test Environment | https://test.payu.in/merchant/postservice?form=2 |
---|---|
Production Environment | https://info.payu.in/merchant/postservice?form=2 |
Reference information for request parameters
Parameter | Reference |
---|---|
key | For 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 |
hash | Hash 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:
Parameter | Description |
---|---|
var5 | If a refund callback for a transaction is required on a specific URL, the URL must be specified in this parameter. |
var6 | This 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" }
- The error_code value 102 should be treated as success; the rest are failures. For the list of error codes, refer to Error Codes for Refund Initiation.
Request parameters
Example values
Use the following sample values while trying out the API:
var1
(mihpayid): 403993715521937565var2
(reference number for a refund provided by merchant): 20201105secrettokenaturend